Skip to content

DeprecationWarning: elementwise comparison failed in Quantity #8752

Closed

Description

@pllim

Looking at #7928 , there are a lot of warnings like this:

astropy/nddata/mixins/tests/test_ndarithmetic.py::...
  .../astropy/units/quantity.py:858: DeprecationWarning: elementwise comparison failed;
this will raise an error in the future.
    return super().__ne__(other)

Which brought me to

def __ne__(self, other):
try:
try:
return super().__ne__(other)
except DeprecationWarning:
return np.not_equal(self, other)

Perhaps try ... except ... is not working as expected? Why not use catch_warnings? @mhvk , do you know?

Activity

  1. mhvk commented on May 24, 2019

    @mhvk
    Contributor

    I should really get rid of that altogether, and may even have a branch somewhere. Though in Time at least, I found that this ended up being a poor implementation there... (#8355).

  2. mhvk commented on May 24, 2019

    @mhvk
    Contributor

    Hmm, indeed, I do have an old branch. Checking whether it is still viable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions