Validate enums - #169
Conversation
… subsetting and alpha preservation
…iterative probing
…om_imageview_id class method
…olor blending objects
…ology and usage patterns
…or coordinate system and number format methods
…lorBlending initialization
… for consistency with naming conventions
…ColorBlending and Layer method docstrings
…ces for consistency with documentation style
…of setActiveFrameById
…g on carta_version property's built-in caching
…nding tests Co-authored-by: Copilot <copilot@github.com>
…o support user-specified CARTA version validation with flexible comparison operators
confluence
left a comment
There was a problem hiding this comment.
I'm going to wait until the other PRs have been resolved before doing a final review, but I have an alternative suggestion for specifying the links to protobuf and frontend enums:
- Create mix-in classes called
FrontendEnumandProtobufEnum. - For each of these, implement a registration mechanism for subclasses (similar to the region and view mechanism), which:
- Checks the subclass for an optional
snapshot_nameclass attribute (maybe this should be called something likeexternal_nameorreference_name-- and it should probably be in all caps for style consistency) - Updates a class dict that maps snapshot names to enum subclasses (if no custom
snapshot_nameis provided, the name of the class is used by default)
- Checks the subclass for an optional
- Make each class that is linked to a frontend or protobuf enum inherit one of these mixins.
Now by default enums won't be linked to anything, and you can access the mappings of the mixins to get the lists of frontend- and protobuf-linked enums (instead of having to tag every enum and parse them all manually), and you don't have to provide external names explicitly unless the class name is different.
… registry instead of manual snapshot_name assignment
|
I removed the unrelated code changes from |
|
I found that it would be better to make it work without launching CARTA. I will make a script in frontend to generate a list of enum and use it for validation. |
Description
Closes #157.
Need frontend CARTAvis/carta-frontend#2759 to be merged first.
Adds enum snapshot checks to keep Python constants aligned with frontend/protobuf enums.
What is implemented
How to test
--enable_scriptingBecause
ANNULUShas not been implemented yet, we do not add it toRegionTypeinconstants.py.