Skip to content
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

Implement context to allow object construction from strings #20

Open
artgoldberg opened this issue Apr 23, 2018 · 4 comments
Open

Implement context to allow object construction from strings #20

artgoldberg opened this issue Apr 23, 2018 · 4 comments

Comments

@artgoldberg
Copy link
Contributor

See example problem Andrew encountered and I debugged.

@jonrkarr
Copy link
Member

jonrkarr commented Apr 23, 2018 via email

@artgoldberg
Copy link
Contributor Author

Yeah, I didn't take the time to fully describe this yesterday.

The problem is that much of the initialization of some Models, at least as used in wc_lang, occurs in deserialize(), and programmatic described models, as in examples from Andrew and Ashwin don't use deserialize. E.g., see this commit to Andrew's model: https://github.com/KarrLab/h1_hesc/commit/16306c566bf340de34783d690e22b622fcc2f709#diff-a114e960f1ff4d57d99c5d511bbf74a1
This definition of a RateLawEquation fails
equation=RateLawEquation(expression='CycE_type[cytosol]')
because RateLawEquation.deserialize() is needed to initialize the equation modifiers. I hacked a fix, but it's not a long-term solution because it's complex because it requires that the the modeler track and provide species & compartment context for RateLawEquation.deserialize().

Fundamentally, the issue is that initialization of a Model should be distinguished from deserializing it. Initialization often needs some of the encompassing root Model, and should be able to accept a string or a parsed form for the Model. When the Model description comes from a cell in a file it's provided as a string. When it comes from a program it may be partially or completely parsed.

Programmatic descriptions should recognize the special encompassing root Model (as does PySB). A whole-cell model could be described in the context of the root Model. Instantiating individual Models can use the context to completely initialize the Model.

@jonrkarr
Copy link
Member

jonrkarr commented Apr 24, 2018 via email

@jonrkarr jonrkarr changed the title Enable concise programmatic representation of Models that doesn’t explicitly call deserialize() Implement context to allow object construction from strings May 4, 2018
@jonrkarr jonrkarr self-assigned this May 8, 2018
@jonrkarr
Copy link
Member

support filtering with pandas or similar style to pandas

@jonrkarr jonrkarr removed their assignment Feb 5, 2019
@jonrkarr jonrkarr added the future label Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants