gotran.input package

Submodules

gotran.input.cellml module

gotran.input.cellml.cellml2ode(model_source, **options)[source]

Convert a CellML model into an ode

Parameters:
  • model_source (str) – Path or url to CellML file
  • options (dict) – Optional parameters to control cellml parser
class gotran.input.cellml.CellMLParser(model_source, params=None, targets=None)[source]

Bases: object

This module parses a CellML XML-file and converts it to PyCC code

check_and_register_component_variables(comp, collected_states, collected_parameters, collected_equations)[source]

Check if component variables are allready collected

static default_parameters()[source]
get_iterator(name, item=None)[source]

Return an element tree iterator

get_parents(grouping, element=None)[source]

If group was used in the cellml use it to gather parent information about the components

parse_components(targets)[source]

Build a dictionary containing dictionarys describing each component of the cellml model

parse_connections()[source]
parse_documentation()[source]

Parse the documentation of the article

parse_imported_model()[source]

Parse any imported models

parse_single_component(comp, collected_states, collected_parameters, collected_equations)[source]

Parse a single component and create a Component object

parse_units()[source]

Parse any declared units in the model

sort_components(components, sorted_once=False)[source]
to_gotran()[source]

Generate a gotran file

gotran.input.mathml module

class gotran.input.mathml.MathMLBaseParser(use_sympy_integers=False)[source]

Bases: object

parse(root)[source]

Recursively parse a mathML subtree and return an list of tokens together with any state variable and derivative.

use_parenthesis(child, parent, first_operand=True)[source]

Return true if child operation need parenthesis

class gotran.input.mathml.MathMLCPPParser(use_sympy_integers=False)[source]

Bases: gotran.input.mathml.MathMLBaseParser

Module contents

gotran.input.cellml2ode(model_source, **options)[source]

Convert a CellML model into an ode

Parameters:
  • model_source (str) – Path or url to CellML file
  • options (dict) – Optional parameters to control cellml parser
class gotran.input.CellMLParser(model_source, params=None, targets=None)[source]

Bases: object

This module parses a CellML XML-file and converts it to PyCC code

check_and_register_component_variables(comp, collected_states, collected_parameters, collected_equations)[source]

Check if component variables are allready collected

static default_parameters()[source]
get_iterator(name, item=None)[source]

Return an element tree iterator

get_parents(grouping, element=None)[source]

If group was used in the cellml use it to gather parent information about the components

parse_components(targets)[source]

Build a dictionary containing dictionarys describing each component of the cellml model

parse_connections()[source]
parse_documentation()[source]

Parse the documentation of the article

parse_imported_model()[source]

Parse any imported models

parse_single_component(comp, collected_states, collected_parameters, collected_equations)[source]

Parse a single component and create a Component object

parse_units()[source]

Parse any declared units in the model

sort_components(components, sorted_once=False)[source]
to_gotran()[source]

Generate a gotran file