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-23044: PTC task should persist usable linearity models #364

Merged
merged 2 commits into from Apr 7, 2020

Conversation

plazas
Copy link
Contributor

@plazas plazas commented Mar 28, 2020

No description provided.

@plazas plazas requested a review from timj March 28, 2020 17:11
@@ -74,7 +76,7 @@ def check_metadata(obj, valid_start, instrument, chip_id, filepath, data_name):
"""
md = obj.getMetadata()
finst = md['INSTRUME']
fchip_id = md['DETECTOR']
fchip_id = md['DETECTOR_ID']
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you can change this because all the other calibration datasets use DETECTOR. This routine only works if we have standardized metadata. (although I don't know how the defects tests passed with this change). @SimonKrughoff what am I missing?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this definitely can't change. I have no idea how the tests didn't fail. I can look into it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've confirmed on a local checkout that this does break unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll go back to 'DETECTOR'. This is ambiguous and was stopping the code when I was passing the detector name instead of the id, which is what it actually expects. That's why I thought that changing the name would help clarify.

Copy link
Member

Choose a reason for hiding this comment

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

Please remember to squash your new change with the previous commit so that the change to the header name disappears from the history.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it deserves a comment in the code, but since I had pointed you at the CLO post in the past, I was surprised you found it ambiguous to the point that you'd change it unilaterally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please forgive me, but I can't find in my records the post that you are talking about. When I was trying to make the code work, I probably did not remember this post that you mention and decided to change the code in order to move forward in a way that I thought would make things clearer. I have changed the keyword back to just DETECTOR, so it's OK. I was also surprised to find that it was not clear by the name of the keyword that it was expecting an ID and not a name: after a few rounds of crashing and debugging and looking at the source code, then I was able to tell.

Copy link
Contributor

Choose a reason for hiding this comment

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

Here's an example: https://lsstc.slack.com/archives/C2JPMCF5X/p1575927103181300

You respond by saying

Thank you for pointing this out again! Sorry that I forgot. I’ll ask if I run into problems.

So I think there are other examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for posting this out again! I'm OK with changing the keyword back to "DETECTOR", which I already did, although I think that perhaps it should be "DETECTORID" or "DETECTORINDEX", IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

Noted.

factory_map = {'qe_curve': Curve, 'defects': Defects}
files = glob.glob(os.path.join(root, chip_name, '*.ecsv'))
factory_map = {'qe_curves': Curve, 'defects': Defects, 'linearizer': Linearizer}
files = glob.glob(os.path.join(root, chip_name, '*.ecsv')) + glob.glob(os.path.join(root,
Copy link
Member

Choose a reason for hiding this comment

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

In the interests of future proofing can we do this as:

files = []
extensions = (".ecsv", ".yaml")
for ext in extensions:
    files.extend(glob.glob(os.path.join(root, chip_name, f"*.{ext}")))

?

@@ -25,8 +26,12 @@ def read_one_chip(root, chip_name, chip_id):
A dictionary of objects constructed from the appropriate factory class.
The key is the validity start time as a `datetime` object.
"""
factory_map = {'qe_curve': Curve, 'defects': Defects}
files = glob.glob(os.path.join(root, chip_name, '*.ecsv'))
factory_map = {'qe_curves': Curve, 'defects': Defects, 'linearizer': Linearizer}
Copy link
Member

Choose a reason for hiding this comment

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

You need to turn this back to qe_curve. It's a rebase error (it used to be qe_curves but we changed it to qe_curve and on rebase you reverted that change).

@plazas plazas force-pushed the tickets/DM-23044 branch 2 times, most recently from 1d69c00 to d8ae82e Compare March 31, 2020 20:37
@plazas plazas merged commit 2c6956f into master Apr 7, 2020
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

4 participants