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

Fix waves check #57

Merged
merged 2 commits into from
Oct 29, 2024
Merged

Fix waves check #57

merged 2 commits into from
Oct 29, 2024

Conversation

hugobuddel
Copy link
Contributor

This is broken, because waves is a Quantity, and "Quantity truthiness is ambiguous, especially for logarithmic units and temperatures. Use explicit comparisons". In particular, the example in https://github.com/AstarVienna/ScopeSim_Templates/blob/main/scopesim_templates/calibration/calibration.py#L44 raises the quoted ValueError. Fixes https://github.com/AstarVienna/speXtra/pull/43/files#r1819593457

@hugobuddel
Copy link
Contributor Author

rg -t py "(\w+) = \((\w+) or " shows no similar code like waves = (waves or ...

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.23%. Comparing base (24a62b6) to head (e4c2c09).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #57       +/-   ##
===========================================
+ Coverage   56.78%   77.23%   +20.45%     
===========================================
  Files           8        8               
  Lines         789      795        +6     
===========================================
+ Hits          448      614      +166     
+ Misses        341      181      -160     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hugobuddel hugobuddel mentioned this pull request Oct 28, 2024
2 tasks
Copy link
Contributor

@teutoburg teutoburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@teutoburg teutoburg added bug Something isn't working tests Related to unit or integration tests labels Oct 29, 2024
@hugobuddel hugobuddel merged commit cec923d into main Oct 29, 2024
36 checks passed
@hugobuddel hugobuddel deleted the hb/waves branch October 29, 2024 12:42
@hugobuddel
Copy link
Contributor Author

Thanks for fixing!

Graag gedaan. I like the one-liners, but in the end I think this is also more clear. I still don't like it that we cannot just put the default in the function declaration..

One thing to note is that black_body_spectrum() claims to allow filter_curve to be None, but I couldn't get that to work properly in the tests. So I decided to do what any good developer would do, and ignored it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tests Related to unit or integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants