-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Check more things in test helpers #693
Conversation
ndcube/tests/helpers.py
Outdated
low_level_wcs = wcs1 | ||
if isinstance(wcs1, BaseHighLevelWCS): | ||
low_level_wcs = wcs1.low_level_wcs | ||
np.testing.assert_array_equal(low_level_wcs.pixel_to_world_values(*random_idx.T), low_level_wcs.pixel_to_world_values(*random_idx.T)) |
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.
Is this line just testing that low_level_wcs
is equivalent to itself?
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.
No, it was meant to test two different low level wcs from the input cubes.
This is a typo.
ndcube/tests/helpers.py
Outdated
@@ -95,9 +96,11 @@ def assert_metas_equal(test_input, expected_output): | |||
assert test_input[key] == expected_output[key] | |||
|
|||
|
|||
def assert_cubes_equal(test_input, expected_cube): | |||
def assert_cubes_equal(test_input, expected_cube, check_data=False): |
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.
Why make checking data an option? Why not always do it?
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.
Depending on the size of the data, this could slow down the unit test, especially if do not care if the data changed (or not).
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.
Let's make the default of check_data=True
then.
Co-authored-by: Stuart Mumford <stuart@cadair.com>
No description provided.