-
Notifications
You must be signed in to change notification settings - Fork 23
Do better with waveranges #936
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,7 +112,10 @@ def test_extracts_the_wave_range_needed(self): | |
| new_spec = extract_range_from_spectrum(spec, waverange) | ||
|
|
||
| assert len(new_spec.waverange) == 2 | ||
| assert new_spec.waverange[0] == 1.98 * u.um | ||
| # Cannot test for equality, because this does not hold in astropy.units: | ||
| # 1.98 * u.um == 19800.0 * u.AA | ||
| # assert new_spec.waverange[0] == 1.98 * u.um | ||
| assert abs(new_spec.waverange[0] == 1.98 * u.um) < 1e-10 * u.AA | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite understand this line. You're checking for the absolute values of the equality check? Wouldn't that always be a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, that should be a - sign in there, not an ==
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then it looks like something where we should really use |
||
| assert new_spec(1.98 * u.um).value == approx(12.8) | ||
|
|
||
| @pytest.mark.parametrize(("endpoint", "msg"), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.