Skip to content

unit_scatter.py example crashes on Python 3.4 #5286

Closed

Description

@mdboom

Both Numpy 1.9 and 1.10 have the same issue. Python 2.7 seems fine.

Traceback (most recent call last):
  File "/Users/mdroettboom/Work/builds/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/mdroettboom/Work/builds/matplotlib/examples/units/basic_units.py", line 221, in __mul__
    return TaggedValue(value, unit)
  File "/Users/mdroettboom/Work/builds/matplotlib/examples/units/basic_units.py", line 130, in __new__
    return object.__new__(cls, value, unit)
TypeError: object() takes no parameters

Activity

  1. added this to the milestone on Oct 20, 2015
  2. added
    Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
    on Oct 20, 2015
  3. jenshnielsen commented on Oct 20, 2015

    @jenshnielsen
    Member

    I had a simple fix in #3838 but it's really not the right way to do it.

  4. mdboom commented on Oct 20, 2015

    @mdboom
    MemberAuthor

    Great! I think merging #3838 is fine.

  5. mdboom commented on Oct 20, 2015

    @mdboom
    MemberAuthor

    Closed by #3838

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

    Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions