Skip to content

TimeType comparisons fail on inf #536

@shumpohl

Description

@shumpohl

Currently TimeType casts float to TimeType for comparisons. This leads to crashes when doing something like TimeType.from_float(1.1) < float('inf') because infinity cannot be represented as an integer fraction. The error message is not clear because it only says ValueError: invalid digits.

Should we have a max time? somewhing like 1e30ns which is a few orders of magnitude larger than the age of the universe. If one creates a TimeType with a larger absolute value qupulse does no longer garantuee corectness.

  • Better error message if a non-finite float(NaN, inf, -inf) is encountered.
  • Do not convert other value to TimeType by default for comparisons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions