-
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
need help with abstract groups #15
Comments
same deal with ShapesGroups probably... |
Yes, as a user of an |
One further wrinkle is xmlschema's |
Since the dict is just a temporary intermediate... I think we could just as easily handle that during dataclass instantiation, see #13 (comment) ... |
Thinking about it, this is actually something that pydantic should be able to help us out with. Looks like it can actually handle Unions to some degree, but the members of the Union all have to be sort of "disjoint" in what their validators would accept, as pydantic just tries to decode with all of the members in sequence until one validates. This would probably work for us: There is also some ongoing work on "disciminated unions" where you declare a specific field in your subclasses that is assigned a unique value in each one, but it's not ready yet: |
Looking at one of the failing test files (
spim.xml
) I see that we're getting the error:spim.ome.xml
has an<Instrument>
with a child<Laser>
(which I gather is one of the concrete implementations of a LightSourceGroup?) ... whereas the generated model is looking for the literal keylight_source_group
...@jmuhlich, Code generation aside for the moment, what should the behavior be? should it be that, any children of
Instrument
that are concrete subtypes ofLightSource
should be added to thelight_source_group
list during__init__
? If I have that correct, I can probably make it happen somehow... but curious to hear your thoughtsThe text was updated successfully, but these errors were encountered: