Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-35278: Increase version of ptcDataset and make it backwards compatible #217

Merged
merged 2 commits into from Jun 22, 2022

Conversation

plazas
Copy link
Contributor

@plazas plazas commented Jun 21, 2022

No description provided.

@plazas plazas requested a review from czwa June 21, 2022 17:43
Copy link
Contributor

@czwa czwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small issues that I'd like to be a bit clearer.

@@ -440,6 +440,9 @@ def fromTable(cls, tableList):
inDict['badAmps'] = []
inDict['photoCharge'] = dict()

calibVersion = metadata['PTC_VERSION']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need a check on calibVersion for this warning message? It seems like that message should only trigger if calibVersion == 1.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch, thanks. I had the message inside the loop, with the check, but when I decided to just have one message outside the loop, I did not put a check.

@@ -471,6 +473,11 @@ def fromTable(cls, tableList):
inDict['finalMeans'][ampName] = record['FINAL_MEANS']
inDict['badAmps'] = record['BAD_AMPS']
inDict['photoCharge'][ampName] = record['PHOTO_CHARGE']
if calibVersion == 1.0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a docstring to the class that mentions that v1.1 adds the ptcTurnoff attribute? I think it'll be easier to understand changes if it doesn't require looking for code tests on calibVersion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. On a more general note, are the docstrings the only places where version changes are tracked? I just want to make sure that we don't have to update another document (or perhaps this is the time to decide if we want o create + maintain such an external document).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know of a better place, so I think adding the changes to the docstring is the minimum we should be doing. I don't think we'll have so many of these that we'll need to have major release notes.

Copy link
Contributor

@czwa czwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solves all my concerns, now.

@@ -471,6 +473,11 @@ def fromTable(cls, tableList):
inDict['finalMeans'][ampName] = record['FINAL_MEANS']
inDict['badAmps'] = record['BAD_AMPS']
inDict['photoCharge'][ampName] = record['PHOTO_CHARGE']
if calibVersion == 1.0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know of a better place, so I think adding the changes to the docstring is the minimum we should be doing. I don't think we'll have so many of these that we'll need to have major release notes.

@plazas plazas merged commit 06bda20 into main Jun 22, 2022
@plazas plazas deleted the tickets/DM-35278 branch June 22, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants