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

Ensure that quantities are converted to Magnitude instances if needed. #5183

Merged
merged 1 commit into from Jul 18, 2016

Conversation

mhvk
Copy link
Contributor

@mhvk mhvk commented Jul 16, 2016

This fixes the second issue raised in #5178, allowing quantities to be converted to magnitudes as needed.

In current master:

(10.*u.STmag).physical.to(u.STmag)
<Quantity 10.0 mag(ST)>

With this PR:

(10.*u.STmag).physical.to(u.STmag)
<Magnitude 10.0 mag(ST)>

@pllim
Copy link
Member

pllim commented Jul 16, 2016

Thanks! Is the .physical part compulsory? So, I cannot simply do (10.*u.STmag).to(u.STmag)?

@mhvk
Copy link
Contributor Author

mhvk commented Jul 16, 2016

The .physical is just to ensure one triggers the error, which needs conversion from a physical quantity to a magnitude; (10.*u.STmag).to(u.STmag) worked fine as it was.

@mhvk
Copy link
Contributor Author

mhvk commented Jul 16, 2016

@adrn - would you be able to have a look? I think this change is fine, but a second look is always good...

@adrn
Copy link
Member

adrn commented Jul 18, 2016

@mhvk looks fine to me!

@mhvk mhvk merged commit 290a39c into astropy:master Jul 18, 2016
@mhvk
Copy link
Contributor Author

mhvk commented Jul 18, 2016

@adrn - thanks for the quick review! Merged...

@astrobot
Copy link

@mhvk - thanks for merging this! However, I noticed the following issue with this pull request:

  • Changelog entry not present (or pull request number missing) and neither the Affects-dev nor the no-changelog-entry-needed label are set

Would it be possible to fix this? Thanks!

This is an experimental bot being written by @astrofrog - let me know if the message above is incorrect!

@mhvk mhvk deleted the quantity-to-magnitude-conversion branch July 18, 2016 18:43
mhvk added a commit to mhvk/astropy that referenced this pull request Jul 18, 2016
mhvk added a commit to mhvk/astropy that referenced this pull request Jul 18, 2016
mhvk added a commit that referenced this pull request Jul 18, 2016
@mhvk
Copy link
Contributor Author

mhvk commented Jul 18, 2016

See #5187 for the missing changelog entry.

@pllim
Copy link
Member

pllim commented Jul 19, 2016

I can confirmed that this fixed my problem. Thanks!!!

@eteq eteq modified the milestones: v1.3.0, v1.2.2 Dec 21, 2016
eteq pushed a commit that referenced this pull request Dec 21, 2016
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.

None yet

5 participants