Skip to content

Interface for code generation - from Model manipulation #84

@skeating

Description

@skeating

Remaining items from this section of #21

  • Iterate over all equations
  • Topological sort of equations
  • Renaming variables if needed?
  • Mark a variable as
    • Modifiable parameter
    • System output of interest (also called derived quantity in pycml)
  • Cython + CVODE code gen - this is more for weblab-cg
    • Basic system of ODEs
    • Add interfaces for setting parameters & reading outputs
    • Handling a purely algebraic system

@MauriceHendrix it would be useful if you added things here as you encounter them; since I think these are things that will directly impact you

  • Would be useful if model.get_symbols accepted a list instead of single equation model.get_symbols([eqations])

  • Would be useful to have a sort of "dimensionally_equivalent" (that's how pycml calls it) which cheks of 2 things are in the same sort of unit, ignoring conversion factor

  • Shortcut functions requested: shortcut for factor = model.units.get_conversion_factor(1 * current_units, secondary_units)
    ideally I guess I'd do something like factor = model.get_conversion_factor(eq.lhs, desired_units) (and return 1.0 if the units are the same)? see Shortcut conversion factor #98

get_equations_for features:

  • the lexicographical_sort flag is not quite what I need No longer needed.
    Would it be possible to have the output ordered according to the input symbols. so that I don't have to do:
for x in symbols:
    equations.append(model.get_equations_for([x]))```
* [ ] Can we add a feature that stops recursion past a list of given symbols, so you don't include those symbols or their dependencies? right now I've got to do:
```equations = []
for x in symbols:
    if x not in unwanted_symbols:
        equations.append(model.get_equations_for([x]))```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions