Skip to content

Time comparisons sometimes fail to fail #10651

Closed

Description

@mhvk

From #10646 (comment)

In [21]: TimeDelta(1*u.day, scale='tai') < Time('J2000')                                                                            
Out[21]: True

The reason this fails is that the comparisons first try to get both arguments to the same class and scale, and this works when it wasn't expected to work:

In [35]: Time(TimeDelta(1<<u.day, scale='tt'))                                                         
Out[35]: <TimeDelta object: scale='tt' format='jd' value=1.0>

It is not completely obvious whether generically a superclass passing back a subclass unchanged is OK, but for Time is shouldn't happen!

Activity

  1. mhvk commented on Oct 6, 2020

    @mhvk
    ContributorAuthor

    fixed in current master (by #10656, I think)

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions