Skip to content

Commit

Permalink
Merge pull request #29 from lsst/tickets/DM-42636
Browse files Browse the repository at this point in the history
DM-42636: Support day_obs dimension in tests
  • Loading branch information
timj authored Feb 28, 2024
2 parents 061c520 + 992388f commit 70d828b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.11
rev: v0.2.0
hooks:
- id: ruff
- repo: https://github.com/pycqa/isort
Expand Down
9 changes: 9 additions & 0 deletions python/lsst/cell_coadds/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ def generate_data_id(
skymap="test_skymap", tract=tract, patch=patch, cell_x=cell_x, cell_y=cell_y
)

if "day_obs" in universe:
day_obs_element = universe["day_obs"]
day_obs_record = day_obs_element.RecordClass(id=20240201, instrument="test")
else:
day_obs_record = None

# A dictionary with all the relevant records.
record = {
"instrument": instrument_record,
Expand All @@ -108,6 +114,9 @@ def generate_data_id(
"physical_filter": physical_filter_record,
}

if day_obs_record:
record["day_obs"] = day_obs_record

# A dictionary with all the relevant recordIds.
record_id = record.copy()
for key in ("visit", "detector"):
Expand Down

0 comments on commit 70d828b

Please sign in to comment.