Skip to content

Commit

Permalink
Fix docs about using timespan fields in expressions.
Browse files Browse the repository at this point in the history
"datetime_begin" and "datetime_end" are old and no supported in all
contexts, while "timestamp" is just wrong, and dimension-qualification
being optional is only sometimes true.
  • Loading branch information
TallJimbo committed Jul 13, 2023
1 parent 50ff5f6 commit 0615ff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions doc/lsst.daf.butler/queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ Few examples of valid expressions using some of the constructs:
(visit = 100 OR visit = 101) AND exposure % 2 = 1
visit.datetime_begin > T'2020-03-30 12:20:33'
visit.timespan.begin > T'2020-03-30 12:20:33'
exposure.datetime_begin > T'58938.515'
exposure.timespan.begin > T'58938.515'
visit.datetime_end < T'mjd/58938.515/tai'
visit.timespan.end < T'mjd/58938.515/tai'
ingest_date < T'2020-11-06 21:10:00'
Expand Down
8 changes: 5 additions & 3 deletions python/lsst/daf/butler/cli/opt/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,11 @@ def _config_split(*args: Any) -> dict[str, str]:
"--order-by",
help=unwrap(
"""One or more comma-separated names used to order records. Names can be dimension names,
metadata names optionally prefixed by a dimension name and dot, or
timestamp_begin/timestamp_end (with optional dimension name). To reverse ordering for a name
prefix it with a minus sign."""
metadata field names, or "timespan.begin" / "timespan.end" for temporal dimensions.
In some cases the dimension for a metadata field or timespan bound can be inferred, but usually
qualifying these with "<dimension>.<field>" is necessary.
To reverse ordering for a name, prefix it with a minus sign.
"""
),
multiple=True,
callback=split_commas,
Expand Down

0 comments on commit 0615ff0

Please sign in to comment.