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-27147: rework collection names and add levels of indirection for long-lived repos #327
Conversation
python/lsst/obs/base/_instrument.py
Outdated
them with the standard collection name delimeter. If provided, | ||
these are appended to the names of the `~CollectionType.RUN` | ||
these are inserted into to the names of the `~CollectionType.RUN` |
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.
extra "to" here
python/lsst/obs/base/_instrument.py
Outdated
|
||
Returns | ||
------- | ||
name : `str` | ||
Run collection name. | ||
""" | ||
return cls.makeCollectionName("calib", "unbounded", *suffixes) | ||
tail = labels + ("unbounded",) | ||
return cls.makeCollectionName("calib", *tail) |
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.
I'm pretty sure that:
return cls.makeCollectionName("calib", *labels, "unbounded")
works fine, so here and below there should be no need to make the temporary list.
if os.path.isabs(self.path): | ||
if not os.path.isabs(root): | ||
root = os.path.abspath(root) | ||
chainName = os.path.relpath(self.path, root) |
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.
Part of me feels that pathlib.Path.relative_to
is what you are really wanting to use here which should tell you if the two don't overlap but this would all be simpler as ButlerURI:
path_uri = ButlerURI(self.path)
root_uri = ButlerURI(root)
if path_uri.relative_to(root_uri) is None:
raise ValueError(...)
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.
The ButlerURI
approach sounds perfect; I'll go with that.
python/lsst/obs/base/ingest_tests.py
Outdated
# the original exception indicating that we can't hard-link | ||
# on this filesystem to be turned into a nonzero exit code, which | ||
# then trips the test assertion. | ||
except AssertionError as err: |
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 we could list both errors here then so we don't need to worry about it again?
e094457
to
07cb2b8
Compare
return | ||
if self.chainName is None: | ||
if os.path.isabs(self.path): | ||
if not os.path.isabs(root): |
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.
This if can be removed. The ButlerURI constructor will do it anyhow.
07cb2b8
to
eebffa6
Compare
Instead of these extra strings being appended to the end of collection names, they're now inserted directly after "<instrument>/calib", so when we name a set of related collections after a ticket branch, all of those collections will start with a common prefix.
This changes the interface for ConvertRepoTask, but not its default behavior or the 'butler convert' command-line interface.
We no longer rely on per-instrument overrides to point each specific refcat at the right RUN collection, and add a level of indirection to make it easier to add new refcats later.
...and note its limitations.
Ideally this label would be something intrinsic to the version of the curated calibs, but that's not avalable, and we need something here to make room for multiple curated calibration writes over the lifetime of the data repo.
eebffa6
to
f2f70b8
Compare
f2f70b8
to
84eda07
Compare
No description provided.