Skip to content

Commit

Permalink
(DiamondLightSource/hyperion#1307) change DetectorParams detector_siz…
Browse files Browse the repository at this point in the history
…e_constants validator to allow the declared type
  • Loading branch information
rtuck99 committed Jun 12, 2024
1 parent 6f4b73a commit 564f970
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dodal/devices/detector/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def create_beamxy_and_runnumber(cls, values: dict[str, Any]) -> dict[str, Any]:
def _parse_detector_size_constants(
cls, det_type: str, values: dict[str, Any]
) -> DetectorSizeConstants:
return constants_from_type(det_type)
return (
det_type
if isinstance(det_type, DetectorSizeConstants)
else constants_from_type(det_type)
)

@validator("directory", pre=True)
def _parse_directory(cls, directory: str, values: dict[str, Any]) -> str:
Expand Down

0 comments on commit 564f970

Please sign in to comment.