Skip to content

Mutated type in Quantity #509

@cmft

Description

@cmft

If I do a np.shape over a Quantity, the operation mutates the type of the .magnitude

See the example below :

#pint.__version__  ('0.8')
#numpy.__version__ ('1.10.1')

import pint
import numpy as np

ureg = pint.UnitRegistry()
q = ureg.Quantity(1)
print type(q.magnitude) # <type 'int'>
np.shape(q) #Out[6]: ()
print type(q.magnitude) # <type 'numpy.ndarray'>

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions