Skip to content

erf and erfc support (from scipy.special) #73

Open

Description

@mikofski

Just a quick note:

erf and erfc ufunc from scipy.special raise ValueError

>>> erf(range(10) * pq.dimensionless)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-12-513cf3bec89d> in <module>()
----> 1 erf(range(10) * pq.dimensionless)

c:\Python27\lib\site-packages\quantities\quantity.pyc in __array_prepare__(self, obj, context)
    234                 """ufunc %r not supported by quantities
    235                 please file a bug report at https://github.com/python-quantities
--> 236                 """
    237                 )
    238         return res

ValueError: ufunc %r not supported by quantities
                please file a bug report at https://github.com/python-quantities

Activity

  1. mikofski commented on Dec 10, 2013

    @mikofski
    Author

    This can be fixed by adding a erf and erfc to p_dict in dimensionality.py near line 357 and by importing erf and erfc from scipy.special near the top

    9   import numpy as np
    +   from scipy.special import erf, erfc
    
    357 p_dict[np.logaddexp2] = _d_dimensionless
    +   p_dict[erf] = _d_dimensionless
    +   p_dict[erfc] = _d_dimensionless
    
  2. added a commit that references this issue on Feb 29, 2016
  3. added
    enhancement
    numpy-integration
    interoperability
    on Nov 17, 2026
  4. added this to the 0.18.0 milestone on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementinteroperabilitynumpy-integration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions