Skip to content

Commit

Permalink
Move universe-specific docs to subclass
Browse files Browse the repository at this point in the history
This confuses doc string validators.

* numpydoc validation is disabled for this method.
* D401 has to be in a different place for ruff and pydocstyle
  This means RUF100 has to be removed.
  • Loading branch information
timj committed Jan 18, 2025
1 parent 8c4c54f commit 91c79b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ select = [
"D", # pydocstyle
"UP", # pyupgrade
]
extend-select = [
"RUF100", # Warn about unused noqa
]

[tool.ruff.lint.pycodestyle]
max-doc-length = 79
Expand All @@ -148,6 +145,7 @@ exclude = [
'^commands\.', # Click docstrings, not numpydoc
'^__init__$',
'\._[a-zA-Z_]+$', # Private methods.
'siav2.SIAv2DafButlerHandler.get_band_information', # inheritDoc
]

[tool.coverage.report]
Expand Down
24 changes: 13 additions & 11 deletions python/lsst/dax/obscore/siav2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from lsst.daf.butler import Butler, DimensionGroup, Timespan
from lsst.daf.butler.pydantic_utils import SerializableRegion, SerializableTime
from lsst.sphgeom import Region, UnionRegion
from lsst.utils import inheritDoc
from lsst.utils.iteration import ensure_iterable
from lsst.utils.logging import getLogger
from pydantic import BaseModel, field_validator, model_validator
Expand Down Expand Up @@ -272,16 +273,6 @@ def get_band_information(
info : `dict` [ `str`, `typing.Any` ]
Dictionary that will be provided to `from_instrument_or_band`
when calculating the band and instrument queries.
Notes
-----
The base class implementation assumes the default dimension universe.
Each physical filter is checked against configuration to determine
whether it overlaps the requested band. If it does that filter is
stored in the returned dict with key ``filters`` where that dict maps
instrument names to a set of matching filters. Additionally, the
``bands`` key is a set of bands associated with those filters
independent of instrument.
"""
raise NotImplementedError()

Expand Down Expand Up @@ -469,9 +460,20 @@ class SIAv2DafButlerHandler(SIAv2Handler):
def get_all_instruments(self) -> list[str]:
return [rec.name for rec in self.butler.query_dimension_records("instrument")]

@inheritDoc(SIAv2Handler)
def get_band_information(
self, instruments: list[str], band_intervals: Iterable[Interval]
) -> dict[str, Any]:
) -> dict[str, Any]: # noqa: D401
"""
Notes
-----
Each physical filter is checked against configuration to determine
whether it overlaps the requested band. If it does that filter is
stored in the returned dict with key ``filters`` where that dict maps
instrument names to a set of matching filters. Additionally, the
``bands`` key is a set of bands associated with those filters
independent of instrument.
""" # noqa: D401
matching_filters = defaultdict(set)
matching_bands = set()
with self.butler.query() as query:
Expand Down

0 comments on commit 91c79b1

Please sign in to comment.