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-42636: Support day_obs dimension in tests #29

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@
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")

Check warning on line 101 in python/lsst/cell_coadds/test_utils.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/cell_coadds/test_utils.py#L100-L101

Added lines #L100 - L101 were not covered by tests
else:
day_obs_record = None

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

if day_obs_record:
record["day_obs"] = day_obs_record

Check warning on line 118 in python/lsst/cell_coadds/test_utils.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/cell_coadds/test_utils.py#L118

Added line #L118 was not covered by tests

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