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-16765: Changes when adding obs_lsst tests #125

Merged
merged 13 commits into from Dec 27, 2018
Merged

Conversation

SimonKrughoff
Copy link
Contributor

@parejkoj do you mind having a look at this?

Copy link
Collaborator

@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.

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')
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do now...

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')
Copy link
Collaborator

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.

Copy link
Contributor

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)
Copy link
Collaborator

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor

@PaulPrice PaulPrice left a comment

Choose a reason for hiding this comment

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

Trivial comments only.

exp = self.butler.get(name, self.dataIds[name])

exp_md = self.butler.get(name+"_md", self.dataIds[name])
Copy link
Contributor

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()))
Copy link
Contributor

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.)

Copy link
Contributor Author

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).

@@ -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
Copy link
Contributor

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?

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')
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

@SimonKrughoff SimonKrughoff merged commit a0cda83 into master Dec 27, 2018
@timj timj deleted the tickets/DM-16765 branch August 17, 2020 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants