-
Notifications
You must be signed in to change notification settings - Fork 8
Added M14 model #33
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
Added M14 model #33
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
==========================================
+ Coverage 99.52% 99.55% +0.03%
==========================================
Files 4 4
Lines 209 224 +15
==========================================
+ Hits 208 223 +15
Misses 1 1
Continue to review full report at Codecov.
|
Seems to be failing to build
Oh, may have just been spamming TravisCI too much. Yep, all good |
src/color_laws.jl
Outdated
a = ai * (x < m14_xi1) + m14_av * ((x >= m14_xi1) & (x < m14_xi3)) | ||
b = bi * (x < m14_xi1) + m14_bv * ((x >= m14_xi1) & (x < m14_xi3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is perfectly legal and very efficient, but I find these lines hard to read, it took me a while to realise that this should be equivalent to something like
a = zero(m14_av)
b = zero(m14_bv)
if x < m14_xi1
# Infrared
a = 0.574 * x^1.61
b = -0.527 * x^1.61
elseif x < m14_xi3
# Optical
a = m14_a_spl(x)
b = m14_b_spl(x)
end
which also saves you some computations above. An alternative would be
a = x < m14_xi1 ? ai : x < m14_xi3 ? m14_av : zero(m14_av)
b = x < m14_xi1 ? bi : x < m14_xi3 ? m14_bv : zero(m14_bv)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that reads so much better, thanks! Just changed it c042984
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like some unneccessary comments can be removed, otherwise rebase and I can release as part of v0.10
A comment about version numbers: new features in the 0.x series don't require a minor version bump. Unless we break the API, we can simply bump the patch version, avoiding releasing a breaking version each time, creating annoying headaches to anyone that cares about version compatibilities. |
Ok, should be good to go |
https://dust-extinction.readthedocs.io/en/stable/api/dust_extinction.parameter_averages.M14.html?highlight=M14
Contributing to #10