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-30046: Defer reading refcats in forcedPhotCcd #177

Merged
merged 1 commit into from May 26, 2021

Conversation

MorganSchmitz
Copy link
Contributor

Jira ticket

Jenkins run #34305

containedIds = {0} # zero as a parent ID means "this is a parent"
for record in refCat:
if expPolygon.contains(record.getCoord().getVector()) and record.getParent() in containedIds:
record.setFootprint(record.getFootprint().transform(refWcs, expWcs, expRegion))
mergedRefCat.append(record)
containedIds.add(record.getId())
if mergedRefCat is None:
Copy link
Member

Choose a reason for hiding this comment

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

Question more than a comment - will we get here only if refCats is an empty list? Would it ever be the case where refCats have empty tables, in which case this might still have to be raised? Sure, it wasn't raised earlier, but just wondering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, reading it I think you're right, if all records are empty we wouldn't raise. I'm never quite sure what happens with empty things in general, and the best to handle it in particular. From what I gathered at discussions following DM-29862, I'm not sure there really is a standard way of dealing with such cases yet.

As you say, we never raised before anyway; this addition was just Jim figuring we might as well throw a clearer exception since we needed to change the way we handled mergedRefCat. I'm going to go ahead and merge - I'm sure we can live with postponing handling the case of empty-only records until after this weekly gets tagged :)

Thanks for the instantaneous review, Arun!

Copy link
Member

Choose a reason for hiding this comment

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

If refCats was empty, then line 398 before would have thrown an IndexError. Now, we make it throw a RuntimeError. I'm betting this doesn't make any difference, unless the file calling this was catching specific exceptions in which case that would have to be changed as well. Just wanted to point that out here.

@MorganSchmitz MorganSchmitz merged commit 64487bb into master May 26, 2021
@MorganSchmitz MorganSchmitz deleted the tickets/DM-30046 branch May 26, 2021 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants