question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scipy.special.erf incompatible with astropy.units.Quantity

See original GitHub issue

Attempting to call scipy.special.erf on a Quantity object yields the following:

Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import astropy.units as u
>>> from scipy.special import erf
>>> erf(1. * u.dimensionless_unscaled)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Software/users/modules/7/software/anaconda3/5.0.1/lib/python3.6/site-packages/astropy/units/quantity.py", line 621, in __array_ufunc__
    converters, unit = converters_and_unit(function, method, *inputs)
  File "/Software/users/modules/7/software/anaconda3/5.0.1/lib/python3.6/site-packages/astropy/units/quantity_helper.py", line 465, in converters_and_unit
    .format(function.__name__))
TypeError: Unknown ufunc erf.  Please raise issue on https://github.com/astropy/astropy
>>> import astropy
>>> astropy.__version__
'2.0.2'
>>> np.__version__
'1.13.3'

It would be nice to support the error function, as it is not especially obscure.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kyleaomancommented, Nov 13, 2017

I might actually have time to do this this week, I’ll take a look. When you attempted this before, did you compile a list of functions requiring attention? Would be useful to get me started if you did.

1reaction
mhvkcommented, Nov 13, 2017

Yes, we should support them, and in fact have issues reminding us that we should: #4092 and #6390. I’m going to close this one, as it is a duplicate… See #4092 for a work-around. And if you have time to implement this in quantity_helpers, that would be great. I once started but was discouraged by the large number of functions, but really we should have this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

scipy.special.erf function can't be evaluated on Quantities · Issue ...
Dimensionless quantities raise a "TypeError: Unknown ufunc" exception when the scipy erf function is ... scipy.special.erf incompatible with astropy.units.
Read more >
scipy.special.erf — SciPy v1.9.3 Manual
Returns the error function of complex argument. It is defined as 2/sqrt(pi)*integral(exp(-t**2), t=0..z) . ... The cumulative of the unit normal distribution is ......
Read more >
Units and Quantities (astropy.units) — Astropy v5.2
The most convenient way to create a Quantity is to multiply or divide a value by one of the built-in units. It works...
Read more >
Release Notes — poppy v1.0.4.dev14+g1dccb8d
Improved support for astropy Quantities, including being able to ... Expanded documentation and example code for usage of astropy Units.
Read more >
galpy.df.streamdf — galpy v1.7.0 documentation
_progenitor_Omega= numpy.array([acfs[3],acfs[4] ... the output unit of streamdf.misalignment has been changed to ... +special.erf((self.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found