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-31924: update to new system for catalog ID generation #168

Merged
merged 6 commits into from Apr 27, 2023

Conversation

TallJimbo
Copy link
Member

No description provided.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

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

I've wondered about our modification of inputs in runQuantum in all these Tasks, instead of generating the idFactory inside run itself. Maybe that will make more sense when I review the pipe_tasks ticket, but I wonder whether we could clean that up if we're needing to modify the API here anyway.

python/lsst/ap/association/diaForcedSource.py Outdated Show resolved Hide resolved
python/lsst/ap/association/diaForcedSource.py Show resolved Hide resolved
python/lsst/ap/association/diaPipe.py Show resolved Hide resolved
python/lsst/ap/association/diaPipe.py Outdated Show resolved Hide resolved
@@ -187,7 +189,7 @@ def run(self,
Filter band of the science image.
ccdVisitId : `int`
Identifier for this detector+visit.
funcs : `lsst.pipe.tasks.functors.Functors`
funcs : `lsst.pipe.tasks.functors.Functors`, optional
Functors to apply to the catalog's columns.
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing the new idGenerator docstring.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I must have ultimately intended to remove the idGenerator argument instead, since it isn't actually used in run and I didn't mark ccdVisitId as deprecated. I think that's because it uses just the ccdVisitId (instead of e.g. also making an lsst.afw.table.IdFactory) and I was going for minimal changes. If you'd prefer for me to deprecate ccdVisitId and pass an idGenerator instance for better consistency with other tasks, I can do that instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question! I think since we don't need the packer itself and this operates per-detector/visit, we can keep it as-is. Also, all that's used for is a log message and setting the value in the table.

Copy link
Member Author

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

I wonder whether we could clean that up if we're needing to modify the API here anyway.

I don't see one or the other as clearly better here, so I'm inclined to just leave things as they are. Passing the data ID is nice in that it moves more logic inside run, but passing the IdGenerator lets it do some abstracting over the "is there a data ID" question, avoiding what may be a lot of if data_id is None checks in run.

python/lsst/ap/association/diaPipe.py Show resolved Hide resolved
@@ -187,7 +189,7 @@ def run(self,
Filter band of the science image.
ccdVisitId : `int`
Identifier for this detector+visit.
funcs : `lsst.pipe.tasks.functors.Functors`
funcs : `lsst.pipe.tasks.functors.Functors`, optional
Functors to apply to the catalog's columns.
Copy link
Member Author

Choose a reason for hiding this comment

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

I think I must have ultimately intended to remove the idGenerator argument instead, since it isn't actually used in run and I didn't mark ccdVisitId as deprecated. I think that's because it uses just the ccdVisitId (instead of e.g. also making an lsst.afw.table.IdFactory) and I was going for minimal changes. If you'd prefer for me to deprecate ccdVisitId and pass an idGenerator instance for better consistency with other tasks, I can do that instead.

@@ -187,7 +188,7 @@ def run(self,
Filter band of the science image.
ccdVisitId : `int`
Identifier for this detector+visit.
funcs : `lsst.pipe.tasks.functors.Functors`
funcs : `lsst.pipe.tasks.functors.Functors`, optional
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 we can just remove this funcs entirely: it's entirely unused: the code uses self.funcs, set in __init__.

This was a bug, but a very minor one a the IDs in the forced-phot
catalogs aren't really used and probably don't need to exist.  But as
long as they do it's best to make these IDs embed the data IDs like all
other kinds of source IDs (including diffim forced source IDs a few
lines above this change).
This deprecation isn't strictly necessary to move away from code being
deprecated elsewhere on this ticket, but it makes this task more
consistent with all of the others
This was apparently unused.  If we need something like this back, we
should pass a CatalogIdGenerator instance instead for consistency with
other tasks.
This was being ignored in favor of self.funcs already.
@TallJimbo TallJimbo merged commit 5c265b4 into main Apr 27, 2023
1 check passed
@TallJimbo TallJimbo deleted the tickets/DM-31924 branch April 27, 2023 02:03
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