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

nondeterministic random number seeds in MeasurePsf candidate reservation

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: pipe_tasks
    • Labels:
      None
    • Templates:
    • Story Points:
      1
    • Team:
      Data Release Production

      Description

      MeasurePsfTask randomly reserves a fraction of its candidates for validation, in a way that is supposed to be deterministic. This seems to be broken; I've identified at least two problems:

      • CharacterizeImageTask does not pass the expId argument to MeasurePsfTask.run, letting it default to zero.
      • MeasurePsfTask uses Python's built-in random module instead of afw.math.Random. Contrary to its own documentation, calling random.seed(0) does not always produce deterministic results (though I've only been able to trigger this the first time I tried it):

        In [3]: random.seed(0)
         
        In [4]: random.random()
        Out[4]: 0.7579544029403025
         
        In [5]: random.seed(0)
         
        In [6]: random.random()
        Out[6]: 0.8444218515250481
         
        In [7]: random.seed(0)
         
        In [8]: random.random()
        Out[8]: 0.8444218515250481
         
        In [9]: random.seed(0)
         
        In [10]: random.random()
        Out[10]: 0.8444218515250481
        

      I have no idea what could be going on in the built-in random module (and it's hard to report upstream since I was only able to trigger it once), but we should switch to our own random number generator regardless.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pgee Perry Gee
                Reporter:
                jbosch Jim Bosch
                Reviewers:
                Lauren MacArthur
                Watchers:
                Jim Bosch, Lauren MacArthur, Perry Gee
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel