-
Notifications
You must be signed in to change notification settings - Fork 80
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
fix parsing and writing of COMPARAM-SPEC #243
Conversation
d0c1722
to
dee3122
Compare
It turns out that files containing "COMPARAM-SPEC" root elements were ignored for PDX files using ODX 2.2. (also, the writing code got slightly broken recently.) I'm not 100% sure if this still works with ODX 2.0, though... Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io> Signed-off-by: Florian Jost <florian.jost@mbition.io>
proposed by [at]kayoub5. Thanks! Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io> Signed-off-by: Florian Jost <florian.jost@mbition.io>
Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io> Signed-off-by: Florian Jost <florian.jost@mbition.io>
dcb7d2f
to
d2f9ce9
Compare
Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io> Signed-off-by: Florian Jost <florian.jost@mbition.io>
odxtools/database.py
Outdated
|
||
cp_spec = root.find("COMPARAM-SPEC") | ||
if cp_spec is not None: | ||
comparam_specs.append(ComparamSpec.from_et(cp_spec, [])) |
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.
This may look strange at first, but between 2.0 and 2.2 only the XML tag changed, the content of the COMPARAM-SPEC in 2.0 is basically a COMPARAM-SUBSET in 2.2
This way the code needed for 2.0 support remains minimal
comparam_specs.append(ComparamSpec.from_et(cp_spec, [])) | |
comparam_specs.append(ComparamSubset.from_et(cp_spec, [])) |
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.
ah, I see. it's better to append these objects to comparam_subsets
then, though? (This would also make conversion of datasets from odx 2.0 to 2.2 easier.) I've implemented it this way for now: adf3dfb
It seems like what ODX 2.0 calls "COMPARAM-SPEC" is called "COMPARAM-SUBSET" in ODX 2.2. Let's thus always use `.comparam_subset` for these objects. thanks to [at]kayoub5 for the clarifications. Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io> Signed-off-by: Florian Jost <florian.jost@mbition.io>
4985121
to
adf3dfb
Compare
It turns out that files containing "COMPARAM-SPEC" root elements were ignored for PDX files using ODX 2.2. (also, the writing code got slightly broken recently.)
I'm not 100% sure if this still works with ODX 2.0 files, though...
Andreas Lauser <andreas.lauser@mercedes-benz.com>, on behalf of MBition GmbH.
Provider Information