carrascomj / rust_sbml

SBML parser + bindings to python
https://docs.rs/rust_sbml
Apache License 2.0
8 stars 4 forks source link

Support of SBML levels 1 and 2 #11

Open Armavica opened 3 years ago

Armavica commented 3 years ago

Hello, Thank you for maintaining this project. I downloaded models from BioModels which are in SBML Level 2, hence incompatible with rust_sbml which follows the Level 3 specification. Is there a plan to support Level 2 (and possibly Level 1) in rust_sbml? If so, I would be very happy to contribute. What would be the best way to make the different levels coexist within the library?

carrascomj commented 3 years ago

Hi,

It would be fantastic to support them. However, to give an answer about "best way", I would need to study the problem a bit.

Iff the Level 1 and 2 are merely a subset of Level 3, it could be implemented through #[serde(flatten)]. More likely, It may turn out to be the same problem as extensions, which is something that I am not very sure how to tackle best: I want to find some elegant way to mimic the "inheritance" of these extensions without duplicating too much code.

With that said, feel free to prototype and experiment! I am open to suggestions and PRs, of course.

P.D.: I need to write down a CONTRIBUTING file.

Armavica commented 3 years ago

Ok, thank you for your answer! From what I can see, it is unfortunately not just subsets: some fields that are optional in Level 2 are required in Level 3. I will experiment a bit and come back here later. I downloaded the 1017 curated models of Biomodels and have plenty of real-world examples to try (for information, 93 of them are Level 3 and the rest are Level 2).