E465 Units examples broken · Issue #4802 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Units examples broken #4802
@dopplershift

Description

@dopplershift

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0