def components_extractor(model: myokit.Model): i = 0 components = model.components() component_iter = components.__iter__() component_size = model.count_components() while i < component_size: a_component = component_iter.__next__() if a_component not in components_list: components_list.append(a_component) i += 1
def _get_parameter_names(self, model: myokit.Model): """Gets parameter names of the ODE model, i.e. initial conditions are excluded. Arguments: model {myokit.Model} -- A myokit model. Returns: List -- List of parameter names. """ parameter_names = [] for component in model.components(sort=True): parameter_names += [ var.qname() for var in component.variables( state=False, inter=False, bound=False, sort=True) ] return parameter_names