Skip to content

Commit

Permalink
Update the nextVisit schema
Browse files Browse the repository at this point in the history
The field "instrument" was added to the schema of summit nextVist
messages. Therefore the fan-out service no longer needs to add the
"instrument" field to the fanned-out messages.
  • Loading branch information
hsinfang committed Jan 12, 2024
1 parent f2b01a0 commit 8dcfad5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class NextVisitModel:
"Next Visit Message"
salIndex: int
scriptSalIndex: int
instrument: str,
groupId: str
coordinateSystem: int
position: typing.List[int]
Expand All @@ -40,16 +41,13 @@ class NextVisitModel:

def add_detectors(
self,
instrument: str,
message: dict,
active_detectors: list,
) -> list[dict[str, str]]:
"""Adds and duplicates next visit messages for fanout.
Parameters
----------
instrument: `str`
The instrument to load detectors for.
message: `str`
The next visit message.
active_detectors: `list`
Expand All @@ -62,7 +60,6 @@ def add_detectors(
message_list: list[dict[str, str]] = []
for active_detector in active_detectors:
temp_message = message.copy()
temp_message["instrument"] = instrument
temp_message["detector"] = active_detector
# temporary change to modify short filter names to format expected by butler
if temp_message["filters"] != "" and len(temp_message["filters"]) == 1:
Expand Down Expand Up @@ -371,7 +368,7 @@ async def main() -> None:
in_process_requests_gauge = hsc_in_process_requests_gauge
case _:
raise Exception(
f"no matching case for salIndex {next_visit_message_updated.salIndex} to add instrument value"
f"no matching case for salIndex {next_visit_message_updated.salIndex} to know the instrument"
)

try:
Expand Down

0 comments on commit 8dcfad5

Please sign in to comment.