Skip to content

Fix bug with raising to a negative power. - #8263

Merged
pllim merged 1 commit into
astropy:masterfrom
mhvk:units-fix-negative-power
Dec 12, 2018
Merged

pllim merged 1 commit into
astropy:masterfrom
mhvk:units-fix-negative-power

Conversation

@mhvk

@mhvk mhvk commented Dec 11, 2018

Copy link
Copy Markdown
Contributor

This is a regression introduced by gh-7649 and reported in gh-8260.
Before this fix:

v2 = 1*u.m**2/u.s**2
(v2 ** (-1/2)).to(u.s/u.m)

leads to a unit conversion error because the bases are in the
wrong order.

fixes #8260

@bsipocz - this is a pretty bad bug, so may drive the 3.1.1 release...

This is a regression introduced by astropygh-7649 and reported in astropygh-8260.
Before this fix:
```
v2 = 1*u.m**2/u.s**2
(v2 ** (-1/2)).to(u.s/u.m)
```
leads to a unit conversion error because the bases are in the
wrong order.
@mhvk mhvk added this to the 3.1.1 milestone Dec 11, 2018
@mhvk
mhvk requested a review from adrn December 11, 2018 20:02
@pllim pllim added the 🔥 Critical label Dec 11, 2018
@codecov

codecov Bot commented Dec 11, 2018

Copy link
Copy Markdown

Codecov Report

Merging #8263 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8263   +/-   ##
=======================================
  Coverage   86.91%   86.91%           
=======================================
  Files         383      383           
  Lines       57889    57889           
  Branches     1056     1056           
=======================================
  Hits        50313    50313           
  Misses       6962     6962           
  Partials      614      614
Impacted Files Coverage Δ
astropy/units/core.py 95.43% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4bee4a...400292f. Read the comment docs.

@bsipocz

bsipocz commented Dec 11, 2018 •

Copy link
Copy Markdown
Member

@bsipocz - this is a pretty bad bug, so may drive the 3.1.1 release...

We haven't announced yet. Should hold it off, too? announcement went out this afternoon.

@StanczakDominik StanczakDominik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! Thanks for the quick fix!

@pllim pllim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved by user who encountered this bug.

@pllim
pllim merged commit ba2e4a7 into astropy:master Dec 12, 2018
@mhvk
mhvk deleted the units-fix-negative-power branch December 12, 2018 18:47
@StanczakDominik

Copy link
Copy Markdown

I just wanted to reconfirm that I checked again whether this solves our units issues in plasmapy and all tests are green - this fix appears to have worked 😄

@mhvk

mhvk commented Dec 13, 2018

Copy link
Copy Markdown
Contributor Author

@StanczakDominik - thanks for checking, and of course for reporting in the first place - with the new test, at least this bug will not return!

bsipocz pushed a commit that referenced this pull request Dec 13, 2018
Fix bug with raising to a negative power.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

units: 's / m' and 's / m' are not convertible

4 participants