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

Port pipe_tasks to Python 3

    XMLWordPrintable

    Details

    • Story Points:
      3
    • Sprint:
      Alert Production F16 - 9, Alert Production F16 - 10, Alert Production F16 - 11, Alert Production F16 - 11b, Alert Production F16 - 11c
    • Team:
      Alert Production

      Attachments

        Issue Links

          Activity

          No builds found.
          tjenness Tim Jenness created issue -
          tjenness Tim Jenness made changes -
          Field Original Value New Value
          Link This issue relates to DM-6179 [ DM-6179 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7309 [ DM-7309 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          nlust Nate Lust made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7324 [ DM-7324 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7328 [ DM-7328 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7293 [ DM-7293 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7245 [ DM-7245 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7289 [ DM-7289 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7246 [ DM-7246 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7258 [ DM-7258 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7303 [ DM-7303 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7261 [ DM-7261 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7152 [ DM-7152 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7262 [ DM-7262 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7296 [ DM-7296 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7297 [ DM-7297 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7243 [ DM-7243 ]
          tjenness Tim Jenness made changes -
          Link This issue is blocked by DM-7288 [ DM-7288 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7298 [ DM-7298 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7305 [ DM-7305 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7306 [ DM-7306 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7307 [ DM-7307 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7308 [ DM-7308 ]
          nlust Nate Lust made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          swinbank John Swinbank made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          swinbank John Swinbank made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          fred3m Fred Moolekamp made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          fred3m Fred Moolekamp made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          fred3m Fred Moolekamp made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          fred3m Fred Moolekamp made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          fred3m Fred Moolekamp made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          Parejkoj John Parejko made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          Parejkoj John Parejko made changes -
          Sprint Alert Production F16 - 9 [ 247 ]
          fred3m Fred Moolekamp made changes -
          Assignee Fred Moolekamp [ fred3m ]
          fred3m Fred Moolekamp made changes -
          Status To Do [ 10001 ] In Progress [ 3 ]
          Parejkoj John Parejko made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          spietrowicz Steve Pietrowicz made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          Hide
          fred3m Fred Moolekamp added a comment -

          Lauren MacArthur I had to change the tolerance on the testProcessCcd tests in pipe_tasks. It appears that the previous restrictions were too tight but can you verify that the new values I've chosen fall within acceptable limits? See https://github.com/lsst/pipe_tasks/pull/77/commits/9daa645ad793354a20849348fef3720909006b34

          Show
          fred3m Fred Moolekamp added a comment - Lauren MacArthur I had to change the tolerance on the testProcessCcd tests in pipe_tasks. It appears that the previous restrictions were too tight but can you verify that the new values I've chosen fall within acceptable limits? See https://github.com/lsst/pipe_tasks/pull/77/commits/9daa645ad793354a20849348fef3720909006b34
          Hide
          fred3m Fred Moolekamp added a comment -

          All of the tests pass with the current parameter values but per Tim Jenness and Russell Owen the setL method in afw is broken, which truncates visit ID's to 32 bits. This will need to be fixed before this ticket can be completed.

          Show
          fred3m Fred Moolekamp added a comment - All of the tests pass with the current parameter values but per Tim Jenness and Russell Owen the setL method in afw is broken, which truncates visit ID's to 32 bits. This will need to be fixed before this ticket can be completed.
          Hide
          lauren Lauren MacArthur added a comment -

          I didn't change the tolerances, just the values, so it's not obvious why the tolerances are now too stringent (and by so much!). Did the test pass on whatever compiler you're using in a pre-DM-6815 state? Is it possible your stack is not entirely in sync with master (I doubt it, but it's worth a double check)??

          These tolerances were set here by Russell Owen, so he may have some opinion as to how tight they ought to be (although he does say in the commit message that the choice was arbitrary).

          Show
          lauren Lauren MacArthur added a comment - I didn't change the tolerances, just the values, so it's not obvious why the tolerances are now too stringent (and by so much!). Did the test pass on whatever compiler you're using in a pre- DM-6815 state? Is it possible your stack is not entirely in sync with master (I doubt it, but it's worth a double check)?? These tolerances were set here by Russell Owen , so he may have some opinion as to how tight they ought to be (although he does say in the commit message that the choice was arbitrary).
          Hide
          fred3m Fred Moolekamp added a comment -

          The difference is the python 3 vs python 2 stack. The python 3 stack was just rebuilt today, so it is definitely up to date, and I rebased my working version of pipe_tasks. Unless we believe this is a bug in the code running in python 3 the best thing to do might be to open up a ticket to review the requirements of the test and leave the current tolerances for the python 3 port. Tim Jenness, John Swinbank, does that sound reasonable?

          Show
          fred3m Fred Moolekamp added a comment - The difference is the python 3 vs python 2 stack. The python 3 stack was just rebuilt today, so it is definitely up to date, and I rebased my working version of pipe_tasks. Unless we believe this is a bug in the code running in python 3 the best thing to do might be to open up a ticket to review the requirements of the test and leave the current tolerances for the python 3 port. Tim Jenness , John Swinbank , does that sound reasonable?
          Hide
          swinbank John Swinbank added a comment -

          Those changes look very substantial to me: I'm not comfortable with them without more explanation. Correct me if I'm wrong, but I don't think we've seen switching to Python 3 making a big change to our numerics elsewhere.

          We do know we get numerical differences between Mac and Linux (although they're quite small). Have you checked this test on both platforms?

          Show
          swinbank John Swinbank added a comment - Those changes look very substantial to me: I'm not comfortable with them without more explanation. Correct me if I'm wrong, but I don't think we've seen switching to Python 3 making a big change to our numerics elsewhere. We do know we get numerical differences between Mac and Linux (although they're quite small). Have you checked this test on both platforms?
          fred3m Fred Moolekamp made changes -
          Link This issue relates to DM-7686 [ DM-7686 ]
          fred3m Fred Moolekamp made changes -
          Link This issue relates to RFC-227 [ RFC-227 ]
          swinbank John Swinbank made changes -
          Assignee Fred Moolekamp [ fred3m ]
          Hide
          swinbank John Swinbank added a comment -

          (After discussion with Simon Krughoff, setting this back to the AP team and letting Fred off the hook!)

          Show
          swinbank John Swinbank added a comment - (After discussion with Simon Krughoff , setting this back to the AP team and letting Fred off the hook!)
          swinbank John Swinbank made changes -
          Team Alert Production [ 10300 ]
          mrawls Meredith Rawls made changes -
          Assignee Meredith Rawls [ mrawls ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          rowen Russell Owen made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          rowen Russell Owen made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          mrawls Meredith Rawls made changes -
          Story Points 3
          krughoff Simon Krughoff made changes -
          Sprint Alert Production F16 - 9 [ 247 ] Alert Production F16 - 9, Alert Production F16 - 10 [ 247, 284 ]
          krughoff Simon Krughoff made changes -
          Rank Ranked higher
          mrawls Meredith Rawls made changes -
          Epic Link DM-6179 [ 24693 ]
          mrawls Meredith Rawls made changes -
          Epic Link DM-6179 [ 24693 ]
          Hide
          mrawls Meredith Rawls added a comment - - edited

          Thanks to some sleuthing by John Parejko, we discovered that python's random number generator spits out different values in py2 and py3, which is likely behind this discrepancy. Running this simple code (from this site) yields different results in our py2 and py3.

          import random
          random.seed(0)
          for x in range(0, 10):
              random.randint(0, 1000000)
          

          py2 result:
          844422
          757955
          420572
          258917
          511275
          404934
          783799
          303313
          476597
          583382

          py3 result:
          885440
          403958
          794772
          933488
          441001
          42450
          271493
          536110
          509532
          424604

          However, doing the same thing with from numpy import random gives the same set of values in both cases:
          985772
          305711
          435829
          117952
          963395
          152315
          882371
          359783
          304137
          122579

          Show
          mrawls Meredith Rawls added a comment - - edited Thanks to some sleuthing by John Parejko , we discovered that python's random number generator spits out different values in py2 and py3, which is likely behind this discrepancy. Running this simple code ( from this site ) yields different results in our py2 and py3. import random random.seed(0) for x in range(0, 10): random.randint(0, 1000000) py2 result: 844422 757955 420572 258917 511275 404934 783799 303313 476597 583382 py3 result: 885440 403958 794772 933488 441001 42450 271493 536110 509532 424604 However, doing the same thing with from numpy import random gives the same set of values in both cases: 985772 305711 435829 117952 963395 152315 882371 359783 304137 122579
          tjenness Tim Jenness made changes -
          Link This issue relates to DM-7390 [ DM-7390 ]
          Hide
          mrawls Meredith Rawls added a comment -

          Unfortunately, it appears that changing import random to from numpy import random in both measurePsf and imageDifference has no change on what testProcessCcd.py spits out in either python version. (I also took care to change random.sample() -> numpy.random.choice().)

          Show
          mrawls Meredith Rawls added a comment - Unfortunately, it appears that changing import random to from numpy import random in both measurePsf and imageDifference has no change on what testProcessCcd.py spits out in either python version. (I also took care to change random.sample() -> numpy.random.choice() .)
          mrawls Meredith Rawls made changes -
          Epic Link DM-7362 [ 26448 ]
          Hide
          mrawls Meredith Rawls added a comment -

          The aforementioned random was not the underlying issue here at all - the numerical differences are being caused by a difference in the background model. This is outside the scope of this ticket, so I'm going to wrap it up and open new tickets pertaining to meas_algorithms. A full writeup of what I found is here on Community. My only changes to the code wound up being formatting tweaks, including DM-7769.

          Show
          mrawls Meredith Rawls added a comment - The aforementioned random was not the underlying issue here at all - the numerical differences are being caused by a difference in the background model. This is outside the scope of this ticket, so I'm going to wrap it up and open new tickets pertaining to meas_algorithms . A full writeup of what I found is here on Community . My only changes to the code wound up being formatting tweaks, including DM-7769 .
          mrawls Meredith Rawls made changes -
          Link This issue relates to DM-8017 [ DM-8017 ]
          Hide
          mrawls Meredith Rawls added a comment - - edited

          Your name came up as a possible reviewer for this, Nate Lust. Please let me know if you can't do it - thanks!

          Show
          mrawls Meredith Rawls added a comment - - edited Your name came up as a possible reviewer for this, Nate Lust . Please let me know if you can't do it - thanks!
          mrawls Meredith Rawls made changes -
          Status In Progress [ 3 ] In Review [ 10004 ]
          Reviewers Nate Lust [ nlust ]
          mrawls Meredith Rawls made changes -
          Link This issue relates to DM-8032 [ DM-8032 ]
          Hide
          nlust Nate Lust added a comment -

          I was away last week, and am just getting back to the swing of things. We have a planning meeting today, but I will get to this in the next day or two. Does this time frame work for you?

          Show
          nlust Nate Lust added a comment - I was away last week, and am just getting back to the swing of things. We have a planning meeting today, but I will get to this in the next day or two. Does this time frame work for you?
          Hide
          mrawls Meredith Rawls added a comment -

          That's fine. I think it should be a quick review. Thank you!

          Show
          mrawls Meredith Rawls added a comment - That's fine. I think it should be a quick review. Thank you!
          Hide
          nlust Nate Lust added a comment -

          Just a few minor points, but I think they might be addressed in a ticket you mentioned. Please make sure they are covered in work somewhere, and that this passes jenkins and is rebased up to current. Then you are good to merge.

          Show
          nlust Nate Lust added a comment - Just a few minor points, but I think they might be addressed in a ticket you mentioned. Please make sure they are covered in work somewhere, and that this passes jenkins and is rebased up to current. Then you are good to merge.
          nlust Nate Lust made changes -
          Status In Review [ 10004 ] Reviewed [ 10101 ]
          tjenness Tim Jenness made changes -
          Link This issue is triggering DM-8032 [ DM-8032 ]
          tjenness Tim Jenness made changes -
          Link This issue relates to DM-8032 [ DM-8032 ]
          tjenness Tim Jenness made changes -
          Link This issue is triggering DM-8017 [ DM-8017 ]
          tjenness Tim Jenness made changes -
          Link This issue relates to DM-8017 [ DM-8017 ]
          Hide
          mrawls Meredith Rawls added a comment -

          Thanks, yes, I opened new tickets because there's a deeper py2/py3 background mismatch beyond the scope of this py3 port.

          It turns out the py2 Jenkins is failing because of a string issue that I missed before. (I must have only checked it with py3 Jenkins.) I traced the problem to something in matchBackground that uses listField from pex_config. I'll let you know once I fix it so py2 Jenkins passes and ask you to please take a final look.

          Show
          mrawls Meredith Rawls added a comment - Thanks, yes, I opened new tickets because there's a deeper py2/py3 background mismatch beyond the scope of this py3 port. It turns out the py2 Jenkins is failing because of a string issue that I missed before. (I must have only checked it with py3 Jenkins.) I traced the problem to something in matchBackground that uses listField from pex_config . I'll let you know once I fix it so py2 Jenkins passes and ask you to please take a final look.
          Hide
          mrawls Meredith Rawls added a comment -

          I've gotten pipe_tasks and pex_config to pass py2 Jenkins by making a tickets/DM-7292 branch for pex_config and editing pex_config/listField per Tim Jenness' suggestion. However, the full build I ran failed on obs_subaru. Something I didn't touch, pex_config/dictField, is apparently causing a FieldValidationError when obs_subaru is tested. I can't tell if this problem arose indirectly from my small edit to pex_config/listField or not? It's strings all the way down. Here is the relevant Jenkins brain dump. Input appreciated.

          Show
          mrawls Meredith Rawls added a comment - I've gotten pipe_tasks and pex_config to pass py2 Jenkins by making a tickets/ DM-7292 branch for pex_config and editing pex_config/listField per Tim Jenness ' suggestion. However, the full build I ran failed on obs_subaru . Something I didn't touch, pex_config/dictField , is apparently causing a FieldValidationError when obs_subaru is tested. I can't tell if this problem arose indirectly from my small edit to pex_config/listField or not? It's strings all the way down. Here is the relevant Jenkins brain dump. Input appreciated.
          Hide
          tjenness Tim Jenness added a comment -

          My guess is that listField needs the same str translation fix.

          Show
          tjenness Tim Jenness added a comment - My guess is that listField needs the same str translation fix.
          Hide
          mrawls Meredith Rawls added a comment -

          I did put your str translation fix in listField, but it looks to me like dictField is written differently and doesn't explicitly use {{dtype}}s.

          Show
          mrawls Meredith Rawls added a comment - I did put your str translation fix in listField , but it looks to me like dictField is written differently and doesn't explicitly use {{dtype}}s.
          krughoff Simon Krughoff made changes -
          Sprint Alert Production F16 - 9, Alert Production F16 - 10 [ 247, 284 ] Alert Production F16 - 9, Alert Production F16 - 10, Alert Production F16 - 11 [ 247, 284, 289 ]
          krughoff Simon Krughoff made changes -
          Sprint Alert Production F16 - 9, Alert Production F16 - 10, Alert Production F16 - 11 [ 247, 284, 289 ] Alert Production F16 - 9, Alert Production F16 - 10, Alert Production F16 - 11, Alert Production F16 - 11b [ 247, 284, 289, 295 ]
          krughoff Simon Krughoff made changes -
          Rank Ranked higher
          krughoff Simon Krughoff made changes -
          Sprint Alert Production F16 - 9, Alert Production F16 - 10, Alert Production F16 - 11, Alert Production F16 - 11b [ 247, 284, 289, 295 ] Alert Production F16 - 9, Alert Production F16 - 10, Alert Production F16 - 11, Alert Production F16 - 11b, Alert Production F16 - 11c [ 247, 284, 289, 295, 296 ]
          Hide
          mrawls Meredith Rawls added a comment -

          This went much deeper than it needed to... turns out there were still a couple from builtins import str lines in pipe_tasks that shouldn't have been there. They're gone now, and Jenkins is happy on py2 and py3! The tickets/DM-7292 branch of pex_config is identical to master and may be ignored. Nate Lust, please confirm you are OK with me going ahead and merging.

          Show
          mrawls Meredith Rawls added a comment - This went much deeper than it needed to... turns out there were still a couple from builtins import str lines in pipe_tasks that shouldn't have been there. They're gone now, and Jenkins is happy on py2 and py3! The tickets/ DM-7292 branch of pex_config is identical to master and may be ignored. Nate Lust , please confirm you are OK with me going ahead and merging.
          Hide
          mrawls Meredith Rawls added a comment -

          Discussed with Nate in Slack, fixed up a couple last tiny things, all good!

          Show
          mrawls Meredith Rawls added a comment - Discussed with Nate in Slack, fixed up a couple last tiny things, all good!
          mrawls Meredith Rawls made changes -
          Resolution Done [ 10000 ]
          Status Reviewed [ 10101 ] Done [ 10002 ]
          tjenness Tim Jenness made changes -
          Remote Link This issue links to "Page (Confluence)" [ 14231 ] This issue links to "Page (Confluence)" [ 14231 ]
          tjenness Tim Jenness made changes -
          Link This issue blocks DM-7756 [ DM-7756 ]

            People

            Assignee:
            mrawls Meredith Rawls
            Reporter:
            tjenness Tim Jenness
            Reviewers:
            Nate Lust
            Watchers:
            Fred Moolekamp, John Parejko, John Swinbank, Lauren MacArthur, Meredith Rawls, Nate Lust, Tim Jenness
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.