sys-bio / temp-biomodels

Temporary place for coordination of updating existing Biomodels
Creative Commons Zero v1.0 Universal
2 stars 2 forks source link

Add SED-ML model changes for all possible parameters #101

Closed jonrkarr closed 2 years ago

jonrkarr commented 2 years ago

The purpose is to communicate what part of a model a user should be able to modify in a way that enables (a) authors to curate how others should edit their model and (b) is agnostic to model format.

The newValue of these changes would be the same as the current value so that models aren't actually changed. SED-ML is an imperfect format for this, but i think reusing SED-ML is better than asking the community to adopt another format.

This can be done with this method:

https://github.com/biosimulators/Biosimulators_utils/blob/9ae25783177a663057a3ff50ebf90393f2cb58be/biosimulators_utils/model_lang/sbml/utils.py#L25

luciansmith commented 2 years ago

It looks like that method returns ModelAttributeChange objects that I can use to create ModelChange objects? That should work.

I can't figure out how to reach the function from biosimulators_utils. There's no 'model_lang' or 'sbml' child of biosimulators_utils, and trying various auto-complete menus didn't bring it up. What would I import?

jonrkarr commented 2 years ago

You can use from biosimulators_utils.model_lang.sbml.utils import get_parameters_variables_outputs_for_simulation or similar.

We're not importing everything into __init__.py because that would end up loading every dependency.

luciansmith commented 2 years ago

Oh! OK, didn't know you could do that. Thank you!

jonrkarr commented 2 years ago

This works for any Python symbol. Various other packages use this too. Our package isn't doing anything special.

For BioSimulators-utils, almost everything is intended to be viewed as the "public" API and everything is fine to use. Since different simulation tools needed different subsets of functionality, much of the package had to be "public". I haven't tried to clearly delineate what should be thought of as public vs private.

luciansmith commented 2 years ago

Yeah, that was me admitting an unfamiliarity with python package structures ;-)

That approach seems reasonable to me. I guess the only issue is that it makes discoverability slightly more difficult, but given the target audience, that seems reasonable.

luciansmith commented 2 years ago

Done!