Skip to content

Add non-remote unit tests for the RHEF filter (#210) - #345

Open
Khan-Tzar wants to merge 2 commits into
sunpy:mainfrom
Khan-Tzar:fix/210-rhef-tests
Open

Khan-Tzar wants to merge 2 commits into
sunpy:mainfrom
Khan-Tzar:fix/210-rhef-tests

Conversation

@Khan-Tzar

Copy link
Copy Markdown

Fixes #210.
The existing tests for the RHEF filter (sunkit_image.radial.rhef) are all
figure / remote_data tests, so the filter has no coverage when the test suite
is run without network access. This adds non-remote unit tests that run the
filter on the synthetic maps already used elsewhere in test_radial.py.
Covered
return type (sunpy.map.GenericMap) and shape, on both test maps
auto-generated vs explicitly supplied radial_bin_edges
a range of upsilon values: None, a float, and a (low, high) tuple
the scipy, numpy and none ranking methods (their outputs are not
asserted equal, since scipy and numpy can differ on tied values)
an unknown method raises NotImplementedError
filtered (non-fill) values stay within the unit interval, as expected from
radial histogram equalisation
a vignette only adds NaNs relative to the same call without one
Run locally under Python 3.11: the new tests pass and the full non-remote
test_radial.py suite stays green (21 passed).
Not included

The existing rhef tests are all figure/remote-data tests. These exercise
sunkit_image.radial.rhef on the synthetic test maps already in the suite,
covering: return type and shape, auto vs supplied radial_bin_edges, a range of
upsilon values (None, float, tuple), the scipy/numpy/none ranking methods, that
an unknown method raises NotImplementedError, that filtered values stay within
the unit interval, and that a vignette only adds NaNs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need Tests for RHE

1 participant