Skip to content

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Jan 23, 2023

This PR significantly rewrites the Visit class to have matching fields to the SAL nextVisit spec (as modified for Kafka and Python). Since the nextVisit spec allows for states we hadn't previously considered in the prototype, I've also added checks or TODOs to the main codebase.

Such code is brittle to changes in the Visit API.
This brings the field in alignment with the SAL nextVisit spec.
This brings the fields in alignment with the SAL nextVisit spec. To
support drop-in initialization of a Visit object from events, position
must be a (non-hashable) list, not a tuple. However, all Visit objects
are still effectively immutable, even if the class is not.
@kfindeisen kfindeisen marked this pull request as ready for review February 7, 2023 22:44
@kfindeisen
Copy link
Member Author

Tested with d_2023_02_03 and the uploader workaround from #47.

This brings the field in alignment with the SAL nextVisit spec.
This brings the field in alignment with the SAL nextVisit spec.
This brings the field in alignment with the SAL nextVisit spec. The
activator code has been patched to handle nimages == 0, but the handler
could be made more coherent.
This brings the field in alignment with the SAL nextVisit spec.
@bsmartradio bsmartradio self-requested a review February 8, 2023 23:39
Copy link
Contributor

@bsmartradio bsmartradio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me. I also double checked the files in case a changed variable was missed but didn't find anything.

The field is implemented as an IntEnum, since the actual message
protocols treat it as a short. Visits may have topocentric coordinates
instead of equatorial, so add a check to MiddlewareInterface that the
coordinates really are ra/dec.
The field is implemented as an IntEnum, since the actual message
protocols treat it as a short. Visits may have altaz or instrument
coordinates rather than sky, so implement a check
in MiddlewareInterface that the coordinates really are sky angle.
This change brings Visit in alignment with the SAL nextVisit spec.
Note that salIndex is only present in the Kafka version of the message,
and generally has a different value from scriptSalIndex.
@kfindeisen kfindeisen merged commit 2d84b9c into main Feb 10, 2023
@kfindeisen kfindeisen deleted the tickets/DM-36771 branch February 10, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants