# Port obs_cfht to Python 3

## Details

• Type: Story
• Status: Done
• Priority: Major
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Templates:
• Story Points:
1
• Sprint:
• Team:

## Description

This ticket covers the work required to get obs_cfht working with Python 3.

## Activity

Hide
Tim Jenness added a comment -

Running futurize quickly on obs_cfht suggests only minor fixes are required:

• print function,
• checking whether divisions should be integer divisions in a couple of places,
• deciding whether long should be imported from past.builtins.
Show
Tim Jenness added a comment - Running futurize quickly on obs_cfht suggests only minor fixes are required: print function, checking whether divisions should be integer divisions in a couple of places, deciding whether long should be imported from past.builtins .
Hide
John Parejko added a comment -

Doing this to finish py3 porting.

Show
John Parejko added a comment - Doing this to finish py3 porting.
Hide
John Parejko added a comment -

So, I accidentally pushed these three commits to master. They pass Jenkins, and validate_drp shows a small change but still within the spec (see below). Fred: could you please look at the three latest commits on obs_cfht and check them? Unless I'm told otherwise, I'm of a mind to just leave them there.

https://github.com/lsst/obs_cfht/commits/tickets/DM-7309

validate_drp results below:

pre-py3:

 minimum: PF1=15% of diffs more than PA2 = 15.00 mmag (target is < 20 %) design : PF1=15% of diffs more than PA2 = 15.00 mmag (target is < 10 %) stretch: PF1=21% of diffs more than PA2 = 10.00 mmag (target is < 5 %) ... PF1 : 15.59 % < 10.00 % == False 

post-py3:

 minimum: PF1=16% of diffs more than PA2 = 15.00 mmag (target is < 20 %) design : PF1=16% of diffs more than PA2 = 15.00 mmag (target is < 10 %) stretch: PF1=24% of diffs more than PA2 = 10.00 mmag (target is < 5 %) ... PF1 : 16.67 % < 10.00 % == False 

Show
John Parejko added a comment - So, I accidentally pushed these three commits to master. They pass Jenkins, and validate_drp shows a small change but still within the spec (see below). Fred: could you please look at the three latest commits on obs_cfht and check them? Unless I'm told otherwise, I'm of a mind to just leave them there. https://github.com/lsst/obs_cfht/commits/tickets/DM-7309 validate_drp results below: pre-py3: minimum: PF1=15% of diffs more than PA2 = 15.00 mmag (target is < 20 %) design : PF1=15% of diffs more than PA2 = 15.00 mmag (target is < 10 %) stretch: PF1=21% of diffs more than PA2 = 10.00 mmag (target is < 5 %) ... PF1 : 15.59 % < 10.00 % == False post-py3: minimum: PF1=16% of diffs more than PA2 = 15.00 mmag (target is < 20 %) design : PF1=16% of diffs more than PA2 = 15.00 mmag (target is < 10 %) stretch: PF1=24% of diffs more than PA2 = 10.00 mmag (target is < 5 %) ... PF1 : 16.67 % < 10.00 % == False
Hide
John Parejko added a comment -

And, actually, re-running it, that difference is apparently within the run-to-run noise (some random seed isn't getting set?).

Show
John Parejko added a comment - And, actually, re-running it, that difference is apparently within the run-to-run noise (some random seed isn't getting set?).
Hide
Fred Moolekamp added a comment -

The coding changes look good to me. It might be worth opening a ticket to look into variances in the validate_drp results to understand where they are coming from.

Show
Fred Moolekamp added a comment - The coding changes look good to me. It might be worth opening a ticket to look into variances in the validate_drp results to understand where they are coming from.
Hide
John Parejko added a comment -

It appears that the difference I'm seeing above is the problem specified in DM-6163. Looks like we're in the clear here.

In the interest of transparency, these are the relevant commits:

Show
John Parejko added a comment - It appears that the difference I'm seeing above is the problem specified in DM-6163 . Looks like we're in the clear here. In the interest of transparency, these are the relevant commits: https://github.com/lsst/obs_cfht/commit/706a1e83e023d3607a16d9b9d2eaa9cb2989177a https://github.com/lsst/obs_cfht/commit/ed003298d1a53686c19293d42b24b01828891c35 https://github.com/lsst/obs_cfht/commit/6c39fbd916ab01d73a85ac8eb6d6882038f88711
Hide
John Parejko added a comment -

Final jenkins run passed, merged lsst_py3 addition. We're in the home stretch!

Show
John Parejko added a comment - Final jenkins run passed, merged lsst_py3 addition. We're in the home stretch!

## People

• Assignee:
John Parejko
Reporter:
Tim Jenness
Reviewers:
Fred Moolekamp
Watchers:
Fabio Hernandez, Fred Moolekamp, John Parejko, Tim Jenness