-
Notifications
You must be signed in to change notification settings - Fork 14
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
Adding testing and validation #188
Adding testing and validation #188
Conversation
@stephen-hoover I added some basic tests for the parsing (and this also sets up a basic testing framework). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all LGTM!
Some comments on things related to this PR that I've found useful:
- There's a
pd.testing.assert_frame_equal
function which is great for testing changes to DataFrames. Similarly,pd.testing.assert_series_equal
. - I find set literals easier to read than function calls,
set([10]) == {10}
. - For testing with random numbers, I'd suggest creating a
np.random.Generator
object with controlled seed in the test function. That would require modifyingadd_config_parameter_column
to accept an optionalGenerator
parameter, which seems out of scope for this PR.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
||
|
||
def test_add_config_parameter_column__error(): | ||
f = {'weird_function': {}} | ||
with pytest.raises(ValueError) as e: | ||
with pytest.raises(ValueError, match="Unknown type of parameter"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! I didn't know about the match
kwarg. That's useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Josh told me about this one today -- it's so nice!
* DOC/TST Added documentation, moved configs, added (some) tests * Adding dev-requirements * datetotimestep is computing based on another column, instead of a constant * cleaning up * Fixing merge * TST making fixes based on tests * TST cleaning up test cases
Various changes: