Add prefix-based inheritance to codegen#1028
Merged
Merged
Conversation
mr-c
reviewed
Apr 24, 2026
mr-c
reviewed
Apr 24, 2026
3784431 to
23a6f93
Compare
mr-c
reviewed
Apr 24, 2026
mr-c
left a comment
Member
There was a problem hiding this comment.
In general, this looks good! Lets see this output of this PR in action before we merge & release
ffabc7b to
862c21b
Compare
mr-c
reviewed
Apr 25, 2026
c679446 to
5338b18
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1028 +/- ##
==========================================
+ Coverage 70.82% 71.58% +0.76%
==========================================
Files 52 53 +1
Lines 10118 9912 -206
Branches 2119 2058 -61
==========================================
- Hits 7166 7096 -70
+ Misses 2386 2264 -122
+ Partials 566 552 -14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
20741c2 to
600fb8d
Compare
a9fc2c0 to
8cc33b7
Compare
This commit adds th epossibility to specify a parent parser for each prefix in a Schema SALAD specification. The idea is that each extensions could come with a different namespace, and would define its own parser for its classes. With this commit, a user can leverage the `--codegen-parent` option to explicitly map a prefix to a parent parser (e.g., a Python module) with a "prefix=package" syntax. For example: ```bash --codegen-parent "https://w3id.org/cwl/salad=schema_salad.metaschema" ``` Inheritance is not able to automatically reconstruct the whole class hierarchy, meaning that if B inherits from A and C inherits from B, the user must manually specify the mapping also for namespace A. However, we do not expect huge parser hierarchies for schema SALAD specifications.
Co-authored-by: Michael R. Crusoe <1330696+mr-c@users.noreply.github.com>
8cc33b7 to
dce82ba
Compare
092af65 to
4628956
Compare
8262e2d to
4e0714d
Compare
4e0714d to
33f6420
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds the possibility to specify a parent parser for each prefix in a Schema SALAD specification. The idea is that each extensions should come with a different namespace, and would define its own parser for its classes.
With this commit, a user can leverage the
--codegen-parentoption to explicitly map a prefix to a parent parser (e.g., a Python module) with a "prefix=package" syntax. For example:--codegen-parent "https://w3id.org/cwl/salad=schema_salad.metaschema"Inheritance is not able to automatically reconstruct the whole class hierarchy, meaning that if B inherits from A and C inherits from B, the user must manually specify the mapping also for namespace A. However, we do not expect huge parser hierarchies for schema SALAD specifications.