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-42160: eo_pipe/cp_verify parity: dark #294

Merged
merged 3 commits into from Jan 22, 2024
Merged

DM-42160: eo_pipe/cp_verify parity: dark #294

merged 3 commits into from Jan 22, 2024

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Jan 12, 2024

Add method to copy calibration statistics to isrStatistics.

@@ -104,6 +104,12 @@ class IsrStatisticsTaskConfig(pexConfig.Config):
}
)

doCalibDistributionStatistics = pexConfig.Field(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
doCalibDistributionStatistics = pexConfig.Field(
doCopyCalibDistributionStatistics = pexConfig.Field(

Copy link
Member

Choose a reason for hiding this comment

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

The field appears to be about copying the distribution statistics, not whether it should compute them or not.

ampStats = {}

for calibType in ('bias', 'dark', 'flat'):
if calibType in kwargs and kwargs[calibType] is not None:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if calibType in kwargs and kwargs[calibType] is not None:
if kwargs.get(calibType, None) is not None:

Copy link
Member

Choose a reason for hiding this comment

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

Would either of these work if no keyword arguments are passed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Taking the more compact suggestion. Even if nothing is passed, kwargs still is defined in this scope, so it should be fine.

for amp in inputExp.getDetector():
ampStats = {}

for calibType in ('bias', 'dark', 'flat'):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for calibType in ('bias', 'dark', 'flat'):
for calibType in ("bias", "dark", "flat"):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this in the dev guide, or is this convention to align with packages that are running black? I've accepted the suggestion (I know I'm horribly inconsistent with string quoting), but wanted to know where to point others on this topic.

Copy link
Member

Choose a reason for hiding this comment

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

black always uses double quotes.

Copy link
Member

Choose a reason for hiding this comment

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

The dev guide only says to be consistent on quoting within a single file.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, given that it's single quotes elsewhere, it can stay as they are now.

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've replaced all single with double quotes in this file, and will try to be more consistent in the future.

@czwa czwa merged commit bfa3fc5 into main Jan 22, 2024
2 checks passed
@czwa czwa deleted the tickets/DM-42160 branch January 22, 2024 20:27
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

3 participants