Closed
Milestone
Description
So far when running examples out of the units/ subdirectories, I see:
radian_demo.py:
Traceback (most recent call last):
File "radian_demo.py", line 10, in <module>
x = [val*radians for val in np.arange(0, 15, 0.01)]
File "radian_demo.py", line 10, in <listcomp>
x = [val*radians for val in np.arange(0, 15, 0.01)]
TypeError: __array_wrap__() missing 1 required positional argument: 'context'
artist_tests.py:
Traceback (most recent call last):
File "/Users/rmay/repos/matplotlib/examples/units/basic_units.py", line 126, in __new__
return object.__new__(subcls, value, unit)
TypeError: object.__new__(TaggedValue_of_int) is not safe, use int.__new__()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "artist_tests.py", line 34, in <module>
line = lines.Line2D([0*cm, 1.5*cm], [0*cm, 2.5*cm], lw=2, color='black', axes=ax)
File "/Users/rmay/repos/matplotlib/examples/units/basic_units.py", line 224, in __rmul__
return self*lhs
File "/Users/rmay/repos/matplotlib/examples/units/basic_units.py", line 221, in __mul__
return TaggedValue(value, unit)
File "/Users/rmay/repos/matplotlib/examples/units/basic_units.py", line 130, in __new__
return object.__new__(cls, value, unit)
TypeError: object() takes no parameters
units_scatter.py:
Traceback (most recent call last):
File "/Users/rmay/repos/matplotlib/examples/units/basic_units.py", line 126, in __new__
return object.__new__(subcls, value, unit)
TypeError: object.__new__(TaggedValue_of_MaskedArray) is not safe, use numpy.ndarray.__new__()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "units_scatter.py", line 18, in <module>
xsecs = secs*np.ma.MaskedArray((1, 2, 3, 4, 5, 6, 7, 8), (1, 0, 1, 0, 0, 0, 1, 0), np.float)
File "/Users/rmay/repos/matplotlib/examples/units/basic_units.py", line 221, in __mul__
return TaggedValue(value, unit)
File "/Users/rmay/repos/matplotlib/examples/units/basic_units.py", line 130, in __new__
return object.__new__(cls, value, unit)
TypeError: object() takes no parameters
Anyone have any clues?
Activity
dopplershift commentedon Jul 27, 2015
This is on OSX with Python 3.4 and Numpy 1.9.2
jenshnielsen commentedon Jul 27, 2015
They have not been ported to python 3. I have an old stalled pr to fix that in #3838 However I don't think that is the right solution and haven't had the chance to more about it
jenshnielsen commentedon Nov 11, 2015
This is mostly fixed by the merge of #3838 however we should probably rework how the meta classes are done
dopplershift commentedon Aug 16, 2017
The examples all work on Python 3.6 with Numpy 1.13 on master. I'm closing this since the original problem is fixed.