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

enum constants in daf_base.DateTime can cause confusion


    • Type: Bug
    • Status: Done
    • Priority: Major
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: daf_base
    • Templates:
    • Story Points:
    • Sprint:
      Alert Production F16 - 9, Alert Production F16 - 10
    • Team:
      Alert Production


      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.


          Container Issues

            Issue Links



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


                  • Created:

                    Summary Panel