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-20763: Add initial support for Gen3 Butler to obs_decam #216

Merged
merged 4 commits into from Aug 27, 2019

Conversation

parejkoj
Copy link
Contributor

No description provided.

python/lsst/obs/hsc/hscMapper.py Show resolved Hide resolved
pass
else:
self.assertIsNotNone(self.butler.registry.find(self.butler.collection, dt, self.dataId))
super().setUp()
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit of a nitpick, but seeing this in action makes me think that it might be slightly better for the base class interface to be an abstractmethod that takes all of the setUp attributes as arguments, which would be called by the base-class setUp. That makes it harder for the derived class to forget something and get delayed, harder-to-interpret errors. Of course, this is just test code, so it's not like it's a case where immediate vs. delayed errors are a big deal.

Copy link
Member

Choose a reason for hiding this comment

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

Also, since the setUp being called here is not the unittest setUp, it might be clearer to rename the method in the parent class so it's clear you are calling the IngestTestBase one and not the TestCase one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timj : I don't understand what you mean by "not the unittest setUp"? It's the MRO's job to sort that out. And unittest doesn't do anything in setUp anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Why leave it to the MRO? It seems to me to be much clearer to have no doubt as to which parent method is being called. Calling it setUp gives it connotations that TestCase is involved somewhere.

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'm still confused: this is setUp, which is only called if this is a TestCase. That's the whole point. The MRO will call whatever parent setUps are available, in the appropriate order.

Copy link
Member

Choose a reason for hiding this comment

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

Does python really call all setUps that are available? Doesn't it only do that if the method explicitly asks the parent to be called? If you think it's not at all confusing to people which setUp is being called (but I don't think it's both) then leave it. I'm saying I have to think about which one is being called and if it was called something else then that would be clearer to me (one of the parent classes is not a TestCase).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TestCase does not define setUp though.

Copy link
Member

Choose a reason for hiding this comment

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

I am less concerned with the naming here and more with the fact that you are passing objects to the base setUp by setting them as attributes before the call, rather than just passing them naturally as arguments.

Remove HSC_FILTER_NAMES as those are now fully handled by the FilterDefintions.

rawFormatter.makefilters() is now done in the base class.

Add tests of Instrument
@TallJimbo TallJimbo force-pushed the tickets/DM-20763 branch 2 times, most recently from 5913239 to 251f583 Compare August 26, 2019 20:18
This duplicates some data, but it's still cleaner than trying to
programmatically rewrite filter names, especially when you consider
the fact that we'll eventually just remove half of these lines.
@parejkoj parejkoj merged commit d8d0679 into master Aug 27, 2019
@timj timj deleted the tickets/DM-20763 branch February 25, 2021 17:44
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

4 participants