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

Move input unit conversion and bounds checking to base class #240

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

lpsinger
Copy link
Contributor

@lpsinger lpsinger commented Sep 5, 2024

There are two goals of this PR:

  1. Self-document what units these models expect by advertising the models in standard astropy.modeling.Model metadata.
  2. Eliminate input preparation code that was previously duplicated in every dust extinction model subclass.

@karllark
Copy link
Owner

karllark commented Sep 5, 2024

Please add a description to this PR to describe in words the goal. Thanks.

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 97.53086% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.66%. Comparing base (d2e54ba) to head (4b977da).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
dust_extinction/baseclasses.py 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #240      +/-   ##
==========================================
- Coverage   99.89%   99.66%   -0.23%     
==========================================
  Files           9        9              
  Lines         938      900      -38     
==========================================
- Hits          937      897      -40     
- Misses          1        3       +2     

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

@lpsinger
Copy link
Contributor Author

lpsinger commented Sep 5, 2024

Please add a description to this PR to describe in words the goal. Thanks.

Done.

Copy link
Owner

@karllark karllark left a comment

Choose a reason for hiding this comment

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

This is a a really nice PR. Really neat to see how to use the astropy modeling machinery to get the units in x right. Thanks for putting it in.

docs/dust_extinction/dev_model.rst Outdated Show resolved Hide resolved
dust_extinction/averages.py Show resolved Hide resolved
dust_extinction/helpers.py Outdated Show resolved Hide resolved
Copy link
Owner

@karllark karllark left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks!

@karllark karllark merged commit f4cc6cd into karllark:master Sep 16, 2024
15 of 17 checks passed
@lpsinger lpsinger deleted the astropy-modeling-units branch September 16, 2024 15:09
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.

2 participants