# port of ctrl_events to python 3

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s: None
• Labels:
None
• Story Points:
2
• Epic Link:
• Team:
Data Facility

#### Activity

Hide
Steve Pietrowicz added a comment - - edited

Updated code to Python 3 compatibility.

Did a "futurize -1 -w .", made additional fixes, and committed. Then did a "futurize -w .", which pointed out that I needed to update a example
program in examples/ that used the old pex.logging code. I updated that to use pex.log.

Made an additional fix daf_base. Previously doing this:

from lsst.daf.base import PropertySet
root = PropertySet()
root.set("blank", "")

worked. Under Python 3 this gave an error. Added an additional check in daf_base/tickets/DM-7169 for this. I'm unsure if there's a "more correct" way of checking for this condition.

These changes have been committed and pushed to their respective ticket branches.

Show
Steve Pietrowicz added a comment - - edited Updated code to Python 3 compatibility. Did a "futurize -1 -w .", made additional fixes, and committed. Then did a "futurize -w .", which pointed out that I needed to update a example program in examples/ that used the old pex.logging code. I updated that to use pex.log. Made an additional fix daf_base. Previously doing this: from lsst.daf.base import PropertySet root = PropertySet() root.set("blank", "") worked. Under Python 3 this gave an error. Added an additional check in daf_base/tickets/ DM-7169 for this. I'm unsure if there's a "more correct" way of checking for this condition. These changes have been committed and pushed to their respective ticket branches.
Hide
Steve Pietrowicz added a comment -

Can you please take a look at these changes? I believe they are complete.

There are changes in

ctrl_events/tickets/DM-7169
daf_base/tickets/DM-7169

The fix for daf_base was because setting a PropertySet value to "" broke baseLib.i
(see comment above this one)

Show
Steve Pietrowicz added a comment - Can you please take a look at these changes? I believe they are complete. There are changes in ctrl_events/tickets/ DM-7169 daf_base/tickets/ DM-7169 The fix for daf_base was because setting a PropertySet value to "" broke baseLib.i (see comment above this one)
Hide
Steve Pietrowicz added a comment -

And I should say, while this change makes things backwards compatible, there's still some question in my mind about whether or not empty strings should be allowed to be set in a PropertySet in this first place. I do not believe empty sets or empty tuples are allowed.

Show
Steve Pietrowicz added a comment - And I should say, while this change makes things backwards compatible, there's still some question in my mind about whether or not empty strings should be allowed to be set in a PropertySet in this first place. I do not believe empty sets or empty tuples are allowed.
Hide
Tim Jenness added a comment -

I think the fix is still correct for strings in general. It's orthogonal to the question of whether an empty string is acceptable.

Show
Tim Jenness added a comment - I think the fix is still correct for strings in general. It's orthogonal to the question of whether an empty string is acceptable.
Hide
Tim Jenness added a comment -

Oh, I see. For other strings that code doesn't matter because it's only using the exemplar to work out the type.

Show
Tim Jenness added a comment - Oh, I see. For other strings that code doesn't matter because it's only using the exemplar to work out the type.
Hide
Tim Jenness added a comment -

Minor comments on PR. Not sure if we want to have pex_logging and log in the same package. Looks straightforward. Merge if it builds fine on Jenkins for py2 and py3 (py3 as far as ctrl_events, py2 for lsst_distrib).

Show
Tim Jenness added a comment - Minor comments on PR. Not sure if we want to have pex_logging and log in the same package. Looks straightforward. Merge if it builds fine on Jenkins for py2 and py3 (py3 as far as ctrl_events, py2 for lsst_distrib).
Hide
Steve Pietrowicz added a comment -

It occurred to me on the way to lunch that I might have another pex_logging creeping around in there somewhere still, after that find in examples/.

I'll get rid of all those references.

Show
Steve Pietrowicz added a comment - It occurred to me on the way to lunch that I might have another pex_logging creeping around in there somewhere still, after that find in examples/. I'll get rid of all those references.
Hide
Steve Pietrowicz added a comment -

I took out the last references to pex.logging, and sent it through the Jenkins build, which completed successfully for py2 and py3.

changes merged to daf_base
$git push Counting objects: 1, done. Writing objects: 100% (1/1), 245 bytes | 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) To git@github.com:lsst/daf_base.git a28b38a..3a3e718 master -> master changes merged to ctrl_events cd ctrl_events bash-4.2$ git push
Counting objects: 1, done.
Writing objects: 100% (1/1), 245 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To git@github.com:lsst/ctrl_events.git
b6b4f2a..8e83922 master -> master

Show
Steve Pietrowicz added a comment - I took out the last references to pex.logging, and sent it through the Jenkins build, which completed successfully for py2 and py3. changes merged to daf_base $git push Counting objects: 1, done. Writing objects: 100% (1/1), 245 bytes | 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) To git@github.com:lsst/daf_base.git a28b38a..3a3e718 master -> master changes merged to ctrl_events cd ctrl_events bash-4.2$ git push Counting objects: 1, done. Writing objects: 100% (1/1), 245 bytes | 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) To git@github.com:lsst/ctrl_events.git b6b4f2a..8e83922 master -> master

#### People

Assignee:
Steve Pietrowicz
Reporter:
Steve Pietrowicz
Reviewers:
Tim Jenness
Watchers:
Steve Pietrowicz, Tim Jenness
Votes:
0 Vote for this issue
Watchers:
2 Start watching this issue

#### Dates

Created:
Updated:
Resolved:

#### Jenkins

No builds found.