Repository navigation
Use converters in Quantity ufuncs instead of just scaling (closes #2496) - #3586
Conversation
|
I'm not sure what went wrong the the AppVeyor build, but I've restarted it to see if there's any better luck. |
|
Argh, same problem still. It looks like it's failing to download miniconda--it gets a 403 (forbidden) when it tries to. Not sure why though since when I try to download from the same URL locally it works fine? |
|
Very odd. Also, what happened to travis? (thanks for adding labels, etc.) |
|
Huh. What did happen to Travis? |
|
I'll rebase and push up again... |
25542dd to
8d877b6
Compare
|
Haven't looked through with a fine-toothed comb, but I get what you're doing here and a huge 👍 to the idea. |
|
@astrofrog, @mdboom, @embray -- I think this is all OK, and it does pass the very extensive test suite, but it would be great to get a detailed review just to be sure. |
|
Looks fine to me on reading. |
|
@mdboom - are you happy with this? If so, do merge so I can rebase the |
Use converters in Quantity ufuncs instead of just scaling (closes #2496)
Use converters in Quantity ufuncs instead of just scaling (closes #2496)
In
ufuncevaluations, quantities are converted to the correct unit by multiplying with a constant. This is correct in most cases, but not if an equivalency likeu.doppleris in place, which can not be described by a single scale factor. As a result, with such equivalencies in place, the code is wrong (see #2496). Here, theufuncmechanism is replaced such that instead of a constant scale factor, one uses an actual unit converter function -- this was in fact already used to calculate the scale factor, so should not lead to any slowdown.cc @mdboom, @astrofrog