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-16765: Changes when adding obs_lsst tests #125
Conversation
a00e725
to
48bd00f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem ok to me.
@@ -80,6 +82,7 @@ def setUp_tests(self, butler, mapper, dataIds): | |||
self.butler = butler | |||
self.mapper = mapper | |||
self.dataIds = dataIds | |||
self.log = Log.getLogger('ObsTests') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use the logger anywhere in these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do now...
python/lsst/obs/base/mapper_tests.py
Outdated
if not isinstance(location, lsst.daf.persistence.butlerLocation.ButlerComposite): | ||
self._test_map(location, dataId) | ||
else: | ||
self.log.info('ButlerComposite datasets are not tested for mapper functions') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe log.warn
? At least have some more information as to why they aren't tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warn does seem appropriate.
self._test_map(location, dataId) | ||
else: | ||
self.log.info('ButlerComposite datasets are not tested for mapper functions') | ||
location = self.mapper.map("raw", dataId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment about why this is different from the above: it took me a fair bit of staring to figure it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trivial comments only.
python/lsst/obs/base/butler_tests.py
Outdated
exp = self.butler.get(name, self.dataIds[name]) | ||
|
||
exp_md = self.butler.get(name+"_md", self.dataIds[name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space either side of +
.
exp = self.butler.get(name, self.dataIds[name]) | ||
|
||
exp_md = self.butler.get(name+"_md", self.dataIds[name]) | ||
self.assertEqual(type(exp_md), type(exp.getMetadata())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test that the objects themselves are equal (as they should be)? (I expect there's no PropertyList::operator==
, so this is annoying, but it really needs to be done.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, no. As Jim explained in science pipelines some time ago, we are not completely strict about round tripping the metadata, so there are a few cards in one that aren't in the other.
His suggestion was that this is the best we can do at the moment (and is better than we were doing before).
python/lsst/obs/base/mapper_tests.py
Outdated
@@ -71,8 +72,10 @@ def setUp_mapper(self, | |||
dataIds and the results of calling them in queryMetadata | |||
metadata_output_path : `str` | |||
path to metadata output associated with dataIds['raw'] | |||
map_python_type : `str` | |||
map_python_type : class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be `type`
instead of class
?
python/lsst/obs/base/mapper_tests.py
Outdated
if not isinstance(location, lsst.daf.persistence.butlerLocation.ButlerComposite): | ||
self._test_map(location, dataId) | ||
else: | ||
self.log.info('ButlerComposite datasets are not tested for mapper functions') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warn does seem appropriate.
self._test_map(location, dataId) | ||
else: | ||
self.log.info('ButlerComposite datasets are not tested for mapper functions') | ||
location = self.mapper.map("raw", dataId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
The parameter that determins whether the configs and metadata will be tested defaults to True since that was what was implied before the change to make those tests optional.
e83988c
to
a0cda83
Compare
@parejkoj do you mind having a look at this?