-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
References should provide direct access to the referenced object #27
Comments
Should we leave the |
I don't mind the |
Pydantic doesn't allow fields that start with an underscore for some reason. There are some ongoing issues and PRs around this, not really sure where it stands. I'll leave them visible for now and see how it goes. |
After spending some time on this it's proving harder than I thought, and there are some wrinkles. I currently have an API that works like this: >>> filter_set.emission_filter_ref[0].ref
FilterRef(id='Filter:5')
This seems OK, but I was planning on adding the "convenient" proxies so you could write I'll submit a PR as it stands and probably move on to something else. I'm happy to work with this API for now and see how it feels. |
All of the Reference types in the schema are effectively pointers to entities defined elsewhere in the document. It would be nice if the Python API gave direct access to those referenced objects.
Currently:
Ideally:
To avoid creating any circular reference chains, the implementation should probably store weakrefs internally and provide proxy containers that perform the dereferencing upon access. The root OME object can walk its children in post_init and set all of these weakrefs, but this only helps with read-only use cases. Developing a good write API will be challenging.
The text was updated successfully, but these errors were encountered: