Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7745

enum constants in daf_base.DateTime can cause confusion

    Details

    • Templates:
    • Story Points:
      1
    • Sprint:
      Alert Production F16 - 9, Alert Production F16 - 10
    • Team:
      Alert Production

      Description

      Whilst looking at DM-7742 I started to wonder why the DateTime constructor did not complain when it was given an MJD time system instead of a UTC time scale.

      It seems we have two issues with DateTime that can lead to subtle bugs not being caught:

      1. Both the TimeScale and DateSystem enums share values in Python land. This means that in Python you can pass in an MJD but C++ will treat it as UTC. We should ensure that both these enums convert to different sets of integers in Python so that we can trap system/scale confusion.
      2. The DateTime constructor does not check all cases. It assumes that if the scale is not TT or TAI then the user probably meant UTC. The code in DateTime should never use an else to assume UTC but should always check and trigger and exception if the value is not recognized.

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  rowen Russell Owen
                  Reporter:
                  tjenness Tim Jenness
                  Watchers:
                  Kian-Tat Lim, Paul Price, Russell Owen, Tim Jenness
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel