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-30843: Raise RepeatableQuantumError if HealSparsePropertyMapTask given inconsistent inputs. #542

Merged
merged 1 commit into from Jun 29, 2021

Conversation

erykoff
Copy link
Contributor

@erykoff erykoff commented Jun 29, 2021

No description provided.

@@ -570,7 +578,13 @@ def run(self, sky_map, tract, band, coadd_dict, input_map_dict, visit_summary_di
total_inputs[inmap] += 1

# Retrieve the correct visitSummary row
if visit not in visit_summary_dict:
msg = f"Visit {visit} not found in visit_summaries."
Copy link
Contributor

Choose a reason for hiding this comment

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

I go back and forth over time with this in my own code, so whatever you want to do is fine, but recently I have been more a fan of putting the message string right in the Exception constructor. Its sometimes less lines, and a bit clearer how they link together

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You know, I first wrote it as a single call (which I prefer in general!), but the message string was too long for the line and had to be split up anyway. I think this is more readable than a multi-line string, so I'm going to leave it as is.

row = visit_summary_dict[visit].find(detector_id)
if row is None:
msg = f"Visit {visit} / detector_id {detector_id} not found in visit_summaries."
Copy link
Contributor

Choose a reason for hiding this comment

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

same

@erykoff erykoff merged commit 50a3888 into master Jun 29, 2021
@erykoff erykoff deleted the tickets/DM-30843 branch June 29, 2021 22:02
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