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-14114: Add interface for camera specialization #31

Merged
merged 2 commits into from Apr 18, 2018
Merged

Conversation

pschella
Copy link
Collaborator

No description provided.

Copy link
Member

@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've left a few minor comments, but I think this is enough for me to rebase on and start making some progress. You probably have a better idea than I do now of what's missing here in order to get the conversion scripts working (since I've been away from that for a week). If you want to add anything else to the PR before merging, just ping me if you'd like me to take a look.

raise NotImplementedError('Must be specified by derived class')

physicalFilters = []
sensors = []
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't really make sense to me that camera is an instance property while the others are class attributes.

I think I'd probably just make camera a class attribute that's set to None, and document in the class that all that matters is that subclass instances have these attributes; that will let subclasses that need to override them at the instance level while allowing those that don't to override them at the class level.

dataUnitName : `str`
Name of the `DataUnit` (e.g. ``"Camera"``).
values : `dict`
Dictionary of ``columnName, value`` pairs.
Copy link
Member

Choose a reason for hiding this comment

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

Should document that value is itself a dictionary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is? I had assumed it looked something like: {"camera": "HSC", "abstract_filter": "i", "physical_filter": "HSC_i", "visit": 3}. Did you have something else in mind?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I was confused by the fact that the argument is called values in the doc but value in the code (and I was looking at the line where you do **value below). Just rename the argument and I think it'll all make sense.

def addDataUnit(self, unit, replace=False):
"""Add a new `DataUnit`, optionally replacing an existing one
(for updates).
def addDataUnitEntry(self, dataUnitName, value):
Copy link
Member

Choose a reason for hiding this comment

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

Should there be an abstract version of this in the base Registry class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but at this point it is easier to copy the SqlRegistry API back into Registry after the dust settles.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Assuming nobody else is working on an alternative Registry implementation yet.

@pschella pschella merged commit 0467a65 into master Apr 18, 2018
@ktlim ktlim deleted the tickets/DM-14114 branch August 25, 2018 06:50
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