Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: [RLOS2023][WIP] add option for storing output and grid language redefinition #4627

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions python/tests/test_framework/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pytest

# conftest.py
def pytest_addoption(parser):
parser.addoption(
"--store_output",
action="store",
default=False,
help="Store output file for tests.",
)


def pytest_configure(config):
_store_output = config.getoption("--store_output")
# Store the custom_arg_value in a global variable or a custom configuration object.
# For example, you can store it in a global variable like this:
global STORE_OUTPUT
STORE_OUTPUT = _store_output
269 changes: 101 additions & 168 deletions python/tests/test_framework/test_configs/cb.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,90 +49,56 @@
"--cb_explore 2"
]
},
[
{"*": [
{
"+": [
{
"--epsilon": [
0.1,
0.2,
0.3
]
}
]
},
{
"+": [
{
"--first": [
1,
2
]
}
]
},
{
"+": [
{
"--bag": [
5,
6,
7
]
}
]
},
{
"+": [
{
"--cover": [
1,
2,
3
]
}
]
},
{
"+": [
{
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
}
]
},
{
"+": [
{
"--synthcover": [
""
]
}
]
},
{
"+": [
{
"--regcb": [
""
]
}
]
},
{
"+": [
{
"--softmax": [
""
]
}
]
}
]}
]],
{
"--epsilon": [
0.1,
0.2,
0.3
]
},
{
"--first": [
1,
2
]
},
{
"--bag": [
5,
6,
7
]
},
{
"--cover": [
1,
2,
3
]
},
{
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
},
{
"--synthcover": [
""
]
},
{
"--regcb": [
""
]
},
{
"--softmax": [
""
]
}
],
"grids_expression": "g0 * (g1 + g2 + g3 + g4 + g5 +g6 + g7 + g8)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is hard to track down which one is g3 for example. Maybe we can turn current list into disctionary with explicit namings?

"output": [
"--readable_model",
"-p"
Expand Down Expand Up @@ -188,6 +154,7 @@
]
}
],
"grids_expression": "g0 * g1",
"output": [
"--readable_model",
"-p"
Expand Down Expand Up @@ -241,90 +208,56 @@
"--cb_explore_adf"
]
},
[
{"*": [
{
"+": [
{
"--epsilon": [
0.1,
0.2,
0.3
]
}
]
},
{
"+": [
{
"--first": [
1,
2
]
}
]
},
{
"+": [
{
"--bag": [
5,
6,
7
]
}
]
},
{
"+": [
{
"--cover": [
1,
2,
3
]
}
]
},
{
"+": [
{
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
}
]
},
{
"+": [
{
"--synthcover": [
""
]
}
]
},
{
"+": [
{
"--regcb": [
""
]
}
]
},
{
"+": [
{
"--softmax": [
""
]
}
]
}
]}
]],
{
"--epsilon": [
0.1,
0.2,
0.3
]
},
{
"--first": [
1,
2
]
},
{
"--bag": [
5,
6,
7
]
},
{
"--cover": [
1,
2,
3
]
},
{
"--squarecb": [
"--gamma_scale 1000",
"--gamma_scale 10000"
]
},
{
"--synthcover": [
""
]
},
{
"--regcb": [
""
]
},
{
"--softmax": [
""
]
}
],
"grids_expression": "g0 * (g1 + g2 + g3 + g4 + g5 +g6 + g7 + g8)",
"output": [
"--readable_model",
"-p"
Expand Down
2 changes: 2 additions & 0 deletions python/tests/test_framework/test_configs/classification.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
]
}
],
"grids_expression": "g0",
"output": [
"--readable_model",
"-p"
Expand Down Expand Up @@ -92,6 +93,7 @@
]
}
],
"grids_expression": "g0",
"output": [
"--readable_model",
"-p"
Expand Down
Loading
Loading