Better compatibility with uncertainties package
See original GitHub issueDescription
The uncertainties package is an extremely powerful tool for error propagation that is well integrated with NumPy.
Currently Astropy QTable objects work with uncertainties’ uarrays (essentially NumPy arrays). However, multiplying or dividing a uarray by an astropy unit returns the following error:
TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'IrreducibleUnit'
Likewise, uncertainties’ scalar type, ufloat, is not supported - multiplying a ufloat by a unit returns the following error:
TypeError: unsupported operand type(s) for *: 'Variable' and 'IrreducibleUnit'
Fixing these incompatibilities and probably others I haven’t found could be a boon to Astropy.
Additional context
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Welcome to the uncertainties package - PythonHosted.org
The uncertainties package is a free, cross-platform program that transparently handles calculations with numbers with uncertainties (like 3.14±0.01). It can ...
Read more >uncertainties Python package Documentation - Read the Docs
The uncertainties package is a free, cross-platform program that transparently handles calculations with numbers.
Read more >uncertainties - PyPI
The uncertainties package takes the pain and complexity out of uncertainty calculations. Detailed information about this package can be found on its main ......
Read more >Uncertainty propagation the easy way in #Python - YouTube
Luckily there is a package in Python for that. To quote that package : "The uncertainties package takes the pain and complexity out...
Read more >uncertainty - The Kitchin Research Group
Back in 2013 I wrote about using the uncertainties package to propagate uncertainties. The problem setup was for finding the uncertainty in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The branch is definitely meant for astropy! Part of what was holding it up is how to deal with reductions (like
mean()
) and in particular when to drop the covariances (subtracting the mean of a 1000x1000 image would otherwise create a covariance matrix of 10^12 points…). But also how to sensibly deal with, say, dividing all rows in a 1000x1000 image by a 1000-length column.Any help with it would definitely be appreciated. Though partially it is really about defining expectations and writing tests.
(Sorry this is a bit vague, I haven’t looked at it recently.)
As far as I’m aware, none of those handle covariances – this is the really nice part of the
uncertainties
package: withc = a+b-a
, your variable will not just equalb
, but also have its uncertainty; innddata
and so on, it would have the uncertainty ofa
included since the parts are assumed to be independent.