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

Check more things in test helpers #693

Merged
merged 4 commits into from
Apr 26, 2024
Merged

Check more things in test helpers #693

merged 4 commits into from
Apr 26, 2024

Conversation

nabobalis
Copy link
Contributor

No description provided.

Cadair
Cadair previously requested changes Apr 25, 2024
ndcube/tests/helpers.py Outdated Show resolved Hide resolved
@nabobalis nabobalis requested a review from Cadair April 25, 2024 15:13
@nabobalis nabobalis removed the request for review from Cadair April 26, 2024 09:30
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))
Copy link
Member

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?

Copy link
Contributor Author

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.

@@ -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):
Copy link
Member

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?

Copy link
Contributor Author

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).

Copy link
Member

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.

@DanRyanIrish DanRyanIrish merged commit 4858041 into sunpy:main Apr 26, 2024
17 of 18 checks passed
@nabobalis nabobalis deleted the wcs branch April 26, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants