-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Model builder fix #78
Conversation
I don't know what's supposed to happen tho
The Model Renderer only accepts one base class and ignores the others, where the one that synthesizes classes on the fly would (if it didn't error out) deal with multiple base classes. This is inconsistent. @apalala What was the intention here? |
I've decided to go for single inheritance now, i.e |
I'm going to let it generate the base classes as well, then this should be ready for merge. |
@Victorious3 This is a complex set of changes, so I won't review them in detail. I'll test for regressions, though:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #70
Multiple base classes aren't carried over to the generated python code, insteadThis is intentional@tatsumasu
only gets the first one (without any::
)It might be a good idea to synthesize classes with a directive, i.e something like
Then only one argument to the rules would be accepted
With these changes the model could be part of the generated parser as well.
I also found that the generated model (python source code) isn't of much use if you rely on the base classes being defined elsewhere. It would need a parameter to add an import statement or some other way to inject them (importlib). - This is now part of the PR
Changes
base_type
forto_python_model
which corresponds to the one you can pass toModelBuilderSemantics
, this feature was previously unavailable for generated models--base-type
that exposes the abovetypes
(takes precedence over generated types if specified) andcontext
that are passed onrule::Class::BaseClass