Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Public Attributes | Private Member Functions | List of all members
CellMLToNektar.translators.ConfigurationStore Class Reference
Inheritance diagram for CellMLToNektar.translators.ConfigurationStore:
Inheritance graph
[legend]
Collaboration diagram for CellMLToNektar.translators.ConfigurationStore:
Collaboration graph
[legend]

Public Member Functions

def __init__
 
def read_configuration_file
 
def finalize_config
 
def find_current_vars
 
def annotate_currents_for_pe
 
def expose_variables
 
def annotate_metadata_for_pe
 
def find_transmembrane_potential
 
def find_membrane_capacitance
 
def find_lookup_variables
 
def validate_metadata
 

Public Attributes

 doc
 
 options
 
 unit_definitions
 
 V_definitions
 
 V_variable
 
 Cm_definitions
 
 Cm_variable
 
 lut_config
 
 i_stim_definitions
 
 i_stim_var
 
 i_ionic_definitions
 
 i_ionic_vars
 
 i_ionic_negated
 
 i_stim_negated
 
 dt_variable
 
 i_data_clamp_current
 
 i_data_clamp_conductance
 
 metadata_vars
 

Private Member Functions

def _create_var_def
 
def _check_var_def
 
def _parse_var
 
def _parse_Vm
 
def _parse_Cm
 
def _parse_currents
 
def _find_variable
 
def _process_ci_elts
 
def _find_transmembrane_currents_from_voltage_ode
 
def _find_var
 
def _parse_lookup_tables
 
def _set_lut_defaults
 

Detailed Description

A container for configuration information, read in from XML
configuration files.  The file structure is described in the
read_configuration_file method.

Definition at line 1807 of file translators.py.

Constructor & Destructor Documentation

def CellMLToNektar.translators.ConfigurationStore.__init__ (   self,
  doc,
  options = None 
)
Create a new store.

doc specifies a CellML document, the processing of which this configuration store will affect.

If given, options should be an optparse.Values instance containing command-line options.

Definition at line 1813 of file translators.py.

1814  def __init__(self, doc, options=None):
1815  """Create a new store.
1816 
1817  doc specifies a CellML document, the processing of which this configuration store will affect.
1818 
1819  If given, options should be an optparse.Values instance containing command-line options.
1820  """
1821  self.doc = doc
1822  doc._cml_config = self
1823  self.options = options
1824  self.unit_definitions = cellml_component.create_new(doc.model, '*lookup_table_units*')
1825  self.unit_definitions.xml_parent = doc.model # Needed for looking up standard units
1826  # Transmembrane potential
1827  self.V_definitions = [u'membrane,V']
1828  self.V_variable = None
1829  # Membrane capacitance
1830  self.Cm_definitions = []
1831  self.Cm_variable = None
1832  # Lookup table configuration
1833  self.lut_config = {}
1834  # Ionic currents configuration
1835  self.i_stim_definitions = [u'membrane,i_Stim']
1836  self.i_stim_var = None
1837  self.i_ionic_definitions = [u'membrane,i_.*']
1838  self.i_ionic_vars = []
1839  # Whether GetIIonic will need to negate the sum of i_ionic_vars
1840  self.i_ionic_negated = False
1841  # Whether the stimulus magnitude is positive, rather than negative
1842  self.i_stim_negated = False
1843  # Other variables that may be set by other code, for example an InterfaceGenerator
1844  self.dt_variable = None
1846  self.i_data_clamp_conductance = None
1847  return

Member Function Documentation

def CellMLToNektar.translators.ConfigurationStore._check_var_def (   self,
  var_elt,
  var_desc 
)
private
Check a variable definition is syntactically valid.

If type == 'name', it must have text content of the form "component_name,variable_name".
If type == 'oxmeta', it must have text content drawn from METADATA_NAMES.
If type == 'config-name', it must have text content either 'stimulus' or 'transmembrane_potential'.

Definition at line 1978 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_var().

1979  def _check_var_def(self, var_elt, var_desc):
1980  """Check a variable definition is syntactically valid.
1981 
1982  If type == 'name', it must have text content of the form "component_name,variable_name".
1983  If type == 'oxmeta', it must have text content drawn from METADATA_NAMES.
1984  If type == 'config-name', it must have text content either 'stimulus' or 'transmembrane_potential'.
1985  """
1986  defn_type = getattr(var_elt, u'type', u'name')
1987  if defn_type == u'name':
1988  name_parts = unicode(var_elt).strip().split(',')
1989  if len(name_parts) != 2:
1990  raise ConfigurationError('Invalid definition of ' + var_desc + ': '
1991  + unicode(var_elt))
1992  elif defn_type == u'oxmeta':
1993  if unicode(var_elt) not in cellml_metadata.METADATA_NAMES:
1994  raise ConfigurationError('"' + unicode(var_elt) + '" is not a valid oxmeta name')
1995  elif defn_type == u'config-name':
1996  if unicode(var_elt) not in [u'stimulus', u'transmembrane_potential', u'membrane_capacitance']:
1997  raise ConfigurationError('"' + unicode(var_elt) + '" is not a name known to the config file')
1998  else:
1999  raise ConfigurationError('"' + defn_type + '" is not a valid variable definition type')
2000  return
def CellMLToNektar.translators.ConfigurationStore._create_var_def (   self,
  content,
  defn_type 
)
private
Create a variable definition object.

Definition at line 1973 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._find_var(), and CellMLToNektar.translators.ConfigurationStore.find_lookup_variables().

1974  def _create_var_def(self, content, defn_type):
1975  """Create a variable definition object."""
1976  xml_fragment = '<var type="%s">%s</var>' % (defn_type, content)
1977  return amara.parse(str(xml_fragment)).var
def CellMLToNektar.translators.ConfigurationStore._find_transmembrane_currents_from_voltage_ode (   self)
private
Analyse the expression for dV/dt to determine the transmembrane currents.

Looks for an equation defining dV/d(something) and assumes the something is
time; this will be checked during code generation for Chaste.  It then finds
all variables on the RHS of this equation which have the same units as the
stimulus current (self.i_stim_var) and identifies these as transmembrane
currents.  Will automatically exclude the stimulus current.

If self.V_variable is not set, returns the empty list.

Definition at line 2074 of file translators.py.

References CellMLToNektar.optimize.PartialEvaluator._process_ci_elts(), CellMLToNektar.translators.ConfigurationStore._process_ci_elts(), CellMLToNektar.utilities.call_if(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.translators.ConfigurationStore.i_ionic_negated, CellMLToNektar.translators.ConfigurationStore.i_stim_negated, CellMLToNektar.translators.ConfigurationStore.i_stim_var, and CellMLToNektar.translators.ConfigurationStore.V_variable.

Referenced by CellMLToNektar.translators.ConfigurationStore.find_current_vars().

2076  """Analyse the expression for dV/dt to determine the transmembrane currents.
2077 
2078  Looks for an equation defining dV/d(something) and assumes the something is
2079  time; this will be checked during code generation for Chaste. It then finds
2080  all variables on the RHS of this equation which have the same units as the
2081  stimulus current (self.i_stim_var) and identifies these as transmembrane
2082  currents. Will automatically exclude the stimulus current.
2083 
2084  If self.V_variable is not set, returns the empty list.
2085  """
2086  if not self.V_variable:
2087  DEBUG('config', "Transmembrane potential not configured, so can't determine currents from its ODE")
2088  return []
2089  if self.i_stim_var:
2090  current_units = [self.i_stim_var.component.get_units_by_name(self.i_stim_var.units)]
2091  else:
2092  from CellMLToNektarTranslator import CellMLToNektarTranslator
2093  current_units = CellMLToNektarTranslator.get_current_units_options(self.doc.model)
2094  ionic_vars = []
2095 
2096  def find_units_match(test_units, units_list, remove_match=False, keep_only_match=False):
2097  """Look for a units definition dimensionally equivalent to test_units within units_list.
2098 
2099  If remove_match is True, remove the first match from the list.
2100  If keep_only_match is True, remove all entries except the first match from the list.
2101  Return the matching units, or None if there are no matches.
2102  """
2103  for units in units_list:
2104  if test_units.dimensionally_equivalent(units):
2105  match = units
2106  break
2107  else:
2108  match = None
2109  if match and remove_match:
2110  units_list.remove(match)
2111  if match and keep_only_match:
2112  units_list[:] = [match]
2113  return match
2114 
2115  def clear_values(expr, process_definitions=False):
2116  """Recursively clear saved values for variables in this expression.
2117 
2118  If process_definitions is True, recursively treat expressions defining variables
2119  used in this expression, too.
2120  """
2121  def process_var(var):
2122  var.unset_values()
2123  var._unset_binding_time(only_temporary=True)
2124  if process_definitions:
2125  defn = var.get_dependencies()
2126  if defn:
2127  if isinstance(defn[0], mathml_apply):
2128  clear_values(defn[0].eq.rhs, process_definitions=True)
2129  elif isinstance(defn[0], cellml_variable):
2130  process_var(defn[0])
2131  def process_ci(ci_elt):
2132  process_var(ci_elt.variable)
2133  self._process_ci_elts(expr, process_ci)
2134 
2135  def check_if_current(ci_elt, vars_found):
2136  """Check if this is a transmembrane current."""
2137  v = ci_elt.variable
2138  if v.get_source_variable(recurse=True) is not self.i_stim_var:
2139  vars_found.append(v)
2140  # Check units
2141  u = v.component.get_units_by_name(v.units)
2142  if find_units_match(u, current_units, keep_only_match=True):
2143  ionic_vars.append(v.get_source_variable(recurse=True))
2144  ionic_vars[-1]._cml_ref_in_dvdt = ci_elt # Hack for data clamp support (#2708)
2145  # Fake this variable being 1 so we can check the sign of GetIIonic
2146  if not v.is_statically_const(ignore_annotations=True):
2147  v.set_value(1.0)
2148 
2149  def bfs(func, vars, *args, **kwargs):
2150  """Do a breadth first search of the definitions of variables in vars.
2151 
2152  func is the recursive function to call. It will be given the list of defining expressions
2153  as its first argument, and args and kwargs as remaining arguments.
2154  """
2155  def get_defn(var):
2156  defn = var.get_dependencies()
2157  if defn:
2158  var._set_binding_time(BINDING_TIMES.static, temporary=True)
2159  if isinstance(defn[0], cellml_variable):
2160  defn = get_defn(defn[0])
2161  else:
2162  assert isinstance(defn[0], mathml_apply)
2163  var.unset_values()
2164  defn = defn[0].eq.rhs
2165  return defn
2166  defns = []
2167  for var in vars:
2168  defn = get_defn(var)
2169  if defn:
2170  defns.append(defn)
2171  if defns:
2172  func(defns, *args, **kwargs)
2173 
2174  def find_currents(exprs, depth=0, maxdepth=2):
2175  """Find ionic currents by searching the given expressions.
2176 
2177  On the initial call, exprs should contain just the definition of dV/dt (i.e. the RHS).
2178 
2179  Uses breadth-first search of the equation dependency tree to find variables that
2180  have units dimensionally equivalent to one of the current formulations that Chaste
2181  can handle, or equivalent to the stimulus current's units if one is defined.
2182 
2183  Initially, A_per_F is removed from the list, since the RHS of dV/dt should always
2184  have equivalent dimensions. If another option can't be found within maxdepth levels,
2185  we restart the search with A_per_F included. The depth limit is intended to guard against
2186  unexpectedly finding something that isn't a current; it's somewhat dodgy, but won't
2187  break on any model I know, and I haven't thought of a better approach yet.
2188 
2189  When one variable with suitable units is found, further ionic currents must have units
2190  equivalent to its to be found. Also once one ionic current is found, only the remaining
2191  expressions at its depth will be processed.
2192  """
2193  if depth == 0 and maxdepth > 0:
2194  dvdt_units = exprs[0].xml_parent.eq.lhs.get_units()
2195  A_per_F = find_units_match(dvdt_units, current_units, remove_match=True)
2196 # # We could do this check, but actually it doesn't catch much and later checks will pick up on the problem
2197 # if A_per_F is None and not self.i_stim_var:
2198 # raise ConfigurationError('Units ' + dvdt_units.description() + ' of dV/dt are not equivalent to V/s - unable to continue.')
2199  # Process all expressions at this depth
2200  vars_found = []
2201  for expr in exprs:
2202  self._process_ci_elts(expr, check_if_current, vars_found=vars_found)
2203  if not ionic_vars and depth != maxdepth:
2204  # Process the definitions of expressions at this depth
2205  bfs(find_currents, vars_found, depth+1, maxdepth)
2206  # If we reached maxdepth unsuccessfully, try again with A_per_F included (if it was an option)
2207  if not ionic_vars and depth == 0 and maxdepth > 0 and A_per_F:
2208  current_units.append(A_per_F)
2209  find_currents(exprs, depth, maxdepth=-1)
2210 
2211  def assign_values_for_stimulus_check(exprs, found_stim=Sentinel()):
2212  """Assign temporary values to variables in order to check the stimulus sign.
2213 
2214  This will process defining expressions in a breadth first search until the stimulus
2215  current is found. Each variable that doesn't have its definitions processed will
2216  be given a value as follows:
2217  - stimulus current = 1
2218  - other currents = 0
2219  - other variables = 1
2220  The stimulus current is then negated from the sign expected by Chaste if evaluating
2221  dV/dt gives a positive value.
2222  """
2223  assert len(current_units) == 1 # We are using the stimulus units
2224  vars = []
2225  def f(ci_elt):
2226  v = ci_elt.variable
2227  if v.get_source_variable(recurse=True) is self.i_stim_var:
2228  v.set_value(1.0)
2229  found_stim.set()
2230  else:
2231  u = v.component.get_units_by_name(v.units)
2232  if u.dimensionally_equivalent(current_units[0]):
2233  v.set_value(0.0)
2234  elif not v.is_statically_const(ignore_annotations=True):
2235  v.set_value(1.0)
2236  vars.append(v)
2237  for expr in exprs:
2238  self._process_ci_elts(expr, f)
2239  if not found_stim:
2240  bfs(assign_values_for_stimulus_check, vars, found_stim=found_stim)
2241 
2242  # Iterate over all expressions in the model, to find the one for dV/d(something)
2243  for expr in (e for e in self.doc.model.get_assignments() if isinstance(e, mathml_apply) and e.is_ode()):
2244  # Assume the independent variable is time; if it isn't, we'll catch this later
2245  (dep_var, time_var) = expr.assigned_variable()
2246  if dep_var.get_source_variable(recurse=True) is self.V_variable:
2247  # Recursively search for ionic currents
2248  find_currents([expr.eq.rhs])
2249  if not ionic_vars:
2250  # The sign checks below will be nonsense in this case. An error will be raised later.
2251  break
2252  # Check the sign of the RHS
2253  self.i_ionic_negated = expr.eq.rhs.evaluate() > 0.0
2254  clear_values(expr.eq.rhs, process_definitions=True)
2255  if self.i_stim_var:
2256  # Check the sign of the stimulus current
2257  assign_values_for_stimulus_check([expr.eq.rhs])
2258  self.i_stim_negated = expr.eq.rhs.evaluate() > 0.0
2259  clear_values(expr.eq.rhs, process_definitions=True)
2260  # Found dV/d(something); don't check any more expressions
2261  break
2262  DEBUG('config', "Found ionic currents from dV/dt: ", ionic_vars)
2263  call_if(self.i_ionic_negated, DEBUG, 'config', "Ionic current is negated")
2264  call_if(self.i_stim_negated, DEBUG, 'config', "Stimulus current is negated")
2265  return ionic_vars
def call_if
# Miscellaneous functions # # ...
Definition: utilities.py:255
def CellMLToNektar.translators.ConfigurationStore._find_var (   self,
  oxmeta_name,
  definitions 
)
private
Find the variable object in the model for a particular concept.

Will look for a variable annotated with the given oxmeta_name first, then
try the list of definitions from the configuration file in turn.

Definition at line 2266 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._create_var_def(), and CellMLToNektar.translators.ConfigurationStore._find_variable().

Referenced by CellMLToNektar.translators.ConfigurationStore.find_membrane_capacitance(), and CellMLToNektar.translators.ConfigurationStore.find_transmembrane_potential().

2267  def _find_var(self, oxmeta_name, definitions):
2268  """Find the variable object in the model for a particular concept.
2269 
2270  Will look for a variable annotated with the given oxmeta_name first, then
2271  try the list of definitions from the configuration file in turn.
2272  """
2273  var = None
2274  # Prepend an oxmeta definition
2275  oxmeta_defn = self._create_var_def(oxmeta_name, 'oxmeta')
2276  for defn in [oxmeta_defn] + definitions:
2277  var = self._find_variable(defn)
2278  if var:
2279  break
2280  return var
def CellMLToNektar.translators.ConfigurationStore._find_variable (   self,
  defn,
  pe_done = False 
)
private
Find a variable matching the given definition.

If pe_done is True, then partial evaluation has been performed
on the model, so looking for variables by name needs to look for
variables called compname__varname in the single component.

Definition at line 2031 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore.Cm_variable, CellMLToNektar.translators.ConfigurationStore.i_stim_var, and CellMLToNektar.translators.ConfigurationStore.V_variable.

Referenced by CellMLToNektar.translators.ConfigurationStore._find_var(), and CellMLToNektar.translators.ConfigurationStore.find_lookup_variables().

2032  def _find_variable(self, defn, pe_done=False):
2033  """Find a variable matching the given definition.
2034 
2035  If pe_done is True, then partial evaluation has been performed
2036  on the model, so looking for variables by name needs to look for
2037  variables called compname__varname in the single component.
2038  """
2039  defn_type = getattr(defn, u'type', u'name')
2040  if defn_type == u'name':
2041  name_parts = unicode(defn).strip().split(',')
2042  if pe_done:
2043  try:
2044  var = self.doc.model.component.get_variable_by_name(u'__'.join(name_parts))
2045  except KeyError:
2046  var = None
2047  else:
2048  var = self.doc.model.xml_xpath(u'cml:component[@name="%s"]/cml:variable[@name="%s"]'
2049  % tuple(name_parts))
2050  if var:
2051  var = var[0]
2052  elif defn_type == u'oxmeta':
2053  var = self.doc.model.get_variable_by_oxmeta_name(str(defn), throw=False)
2054  elif defn_type == u'config-name':
2055  if unicode(defn) == u'stimulus':
2056  var = self.i_stim_var
2057  elif unicode(defn) == u'transmembrane_potential':
2058  var = self.V_variable
2059  elif unicode(defn) == u'membrane_capacitance':
2060  var = self.Cm_variable
2061  else:
2062  raise ConfigurationError('"' + str(defn) + '" is not a valid configuration file variable name')
2063  else:
2064  raise ConfigurationError('"' + defn_type + '" is not a valid variable definition type')
2065  return var
def CellMLToNektar.translators.ConfigurationStore._parse_Cm (   self,
  cm_elt 
)
private
Parse definition of variable holding the cell membrane capacitance.

Definition at line 2019 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._parse_var(), and CellMLToNektar.translators.ConfigurationStore.Cm_definitions.

Referenced by CellMLToNektar.translators.ConfigurationStore.read_configuration_file().

2020  def _parse_Cm(self, cm_elt):
2021  """Parse definition of variable holding the cell membrane capacitance."""
2022  self.Cm_definitions = self._parse_var(cm_elt, 'membrane_capacitance')
def CellMLToNektar.translators.ConfigurationStore._parse_currents (   self,
  currents 
)
private
Parse definitions of ionic and stimulus currents.

Definition at line 2023 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._parse_var(), CellMLToNektar.translators.ConfigurationStore.i_ionic_definitions, and CellMLToNektar.translators.ConfigurationStore.i_stim_definitions.

Referenced by CellMLToNektar.translators.ConfigurationStore.read_configuration_file().

2024  def _parse_currents(self, currents):
2025  """Parse definitions of ionic and stimulus currents."""
2026  if hasattr(currents, u'stimulus'):
2027  self.i_stim_definitions = self._parse_var(currents.stimulus, 'stimulus current')
2028  if hasattr(currents, u'ionic_match'):
2029  self.i_ionic_definitions = self._parse_var(currents.ionic_match, 'ionic currents')
2030  return
def CellMLToNektar.translators.ConfigurationStore._parse_lookup_tables (   self,
  lookup_tables 
)
private
Parse a lookup_tables element.

Definition at line 2319 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._set_lut_defaults(), and CellMLToNektar.translators.ConfigurationStore.lut_config.

Referenced by CellMLToNektar.translators.ConfigurationStore.read_configuration_file().

2320  def _parse_lookup_tables(self, lookup_tables):
2321  """Parse a lookup_tables element."""
2322  for lt in lookup_tables.lookup_table:
2323  var_type = getattr(lt.var, u'type', u'name')
2324  var_name = unicode(lt.var).strip()
2325  config_key = (var_type, var_name)
2326  if not config_key in self.lut_config:
2327  self.lut_config[config_key] = {}
2328  self._set_lut_defaults(self.lut_config[config_key])
2329  for elt in lt.xml_element_children():
2330  if elt.localName != u'var':
2331  self.lut_config[config_key]['table_' + elt.localName] = unicode(elt).strip()
2332  if hasattr(lt, u'units'):
2333  try:
2334  units = self.unit_definitions.get_units_by_name(lt.units)
2335  except KeyError:
2336  raise ConfigurationError('The units "%s" referenced by the lookup table for "%s" do not exist'
2337  % (lt.units, var_name))
2338  self.lut_config[config_key]['table_units'] = units
2339  return
def CellMLToNektar.translators.ConfigurationStore._parse_var (   self,
  elt,
  name 
)
private
Parse definition of a special variable.

Definition at line 2001 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._check_var_def().

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_Cm(), CellMLToNektar.translators.ConfigurationStore._parse_currents(), and CellMLToNektar.translators.ConfigurationStore._parse_Vm().

2002  def _parse_var(self, elt, name):
2003  """Parse definition of a special variable."""
2004  if hasattr(elt, 'var'):
2005  # List of possibilities
2006  defs = []
2007  for vardef in elt.var:
2008  self._check_var_def(vardef, name)
2009  defs.append(vardef)
2010  else:
2011  # Old style - single variable given by text content
2012  self._check_var_def(elt, name)
2013  defs = [elt]
2014  return defs
def CellMLToNektar.translators.ConfigurationStore._parse_Vm (   self,
  vm_elt 
)
private
Parse definition of variable holding the transmembrane potential.

Definition at line 2015 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._parse_var(), and CellMLToNektar.translators.ConfigurationStore.V_definitions.

Referenced by CellMLToNektar.translators.ConfigurationStore.read_configuration_file().

2016  def _parse_Vm(self, vm_elt):
2017  """Parse definition of variable holding the transmembrane potential."""
2018  self.V_definitions = self._parse_var(vm_elt, 'transmembrane_potential')
def CellMLToNektar.translators.ConfigurationStore._process_ci_elts (   self,
  elt,
  func,
  kwargs 
)
private
Recursively apply func to any ci elements in the tree rooted at elt.

Definition at line 2066 of file translators.py.

References CellMLToNektar.optimize.PartialEvaluator._process_ci_elts(), and CellMLToNektar.translators.ConfigurationStore._process_ci_elts().

Referenced by CellMLToNektar.translators.ConfigurationStore._find_transmembrane_currents_from_voltage_ode(), and CellMLToNektar.translators.ConfigurationStore._process_ci_elts().

2067  def _process_ci_elts(self, elt, func, **kwargs):
2068  """Recursively apply func to any ci elements in the tree rooted at elt."""
2069  if isinstance(elt, mathml_ci):
2070  func(elt, **kwargs)
2071  else:
2072  for child in getattr(elt, 'xml_children', []):
2073  self._process_ci_elts(child, func, **kwargs)
def CellMLToNektar.translators.ConfigurationStore._set_lut_defaults (   self,
  lut_dict 
)
private
Set default configuration for a lookup table.

Definition at line 2340 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_lookup_tables(), and CellMLToNektar.translators.ConfigurationStore.finalize_config().

2341  def _set_lut_defaults(self, lut_dict):
2342  """Set default configuration for a lookup table."""
2343  def_dict = optimize.LookupTableAnalyser._LT_DEFAULTS
2344  for k, v in def_dict.iteritems():
2345  if k != 'table_var':
2346  lut_dict[k] = v
2347  lut_dict['table_units'] = None
2348  return
def CellMLToNektar.translators.ConfigurationStore.annotate_currents_for_pe (   self)
Annotate ionic & stimulus current vars so PE doesn't remove them.
Also annotate the membrane capacitance, if defined.

Definition at line 2349 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore.Cm_variable, CellMLToNektar.translators.ConfigurationStore.i_ionic_vars, and CellMLToNektar.translators.ConfigurationStore.i_stim_var.

2350  def annotate_currents_for_pe(self):
2351  """Annotate ionic & stimulus current vars so PE doesn't remove them.
2352  Also annotate the membrane capacitance, if defined."""
2353  if self.i_stim_var:
2354  self.i_stim_var.set_pe_keep(True)
2355  for var in self.i_ionic_vars:
2356  var.set_pe_keep(True)
2357  if self.Cm_variable:
2358  self.Cm_variable.set_pe_keep(True)
2359  return
def CellMLToNektar.translators.ConfigurationStore.annotate_metadata_for_pe (   self)

Definition at line 2379 of file translators.py.

References CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.metadata_vars, and CellMLToNektar.translators.ConfigurationStore.metadata_vars.

2380  def annotate_metadata_for_pe(self):
2381  "Annotate all vars tagged with metadata so PE doesn't remove them."
2382  for var in self.metadata_vars:
2383  var.set_pe_keep(True)
2384  return
def CellMLToNektar.translators.ConfigurationStore.expose_variables (   self)
Expose variables for access with GetAnyVariable if desired.

Definition at line 2360 of file translators.py.

References CellMLToNektar.utilities.DEBUG(), CellMLToNektar.CellMLToNektarTranslator.CellMLToNektarTranslator.metadata_vars, and CellMLToNektar.translators.ConfigurationStore.metadata_vars.

2361  def expose_variables(self):
2362  """Expose variables for access with GetAnyVariable if desired."""
2363  def annotate(var):
2364  t = var.get_type()
2365  if t == VarTypes.Constant:
2366  var.set_is_modifiable_parameter(True)
2367  elif t in [VarTypes.Computed, VarTypes.Free, VarTypes.Mapped]:
2368  var.set_is_derived_quantity(True)
2369  if self.options.expose_annotated_variables:
2370  for var in self.metadata_vars:
2371  if (not self.options.use_chaste_stimulus or
2372  not var.oxmeta_name in cellml_metadata.STIMULUS_NAMES):
2373  annotate(var)
2374  DEBUG('translate', "+++ Exposed annotated variables")
2375  if self.options.expose_all_variables:
2376  for var in self.doc.model.get_all_variables():
2377  annotate(var)
2378  DEBUG('translate', "+++ Exposed all variables")
def CellMLToNektar.translators.ConfigurationStore.finalize_config (   self)
Having read all the configuration files, apply to the model.

Definition at line 1960 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._set_lut_defaults(), CellMLToNektar.translators.ConfigurationStore.find_current_vars(), CellMLToNektar.translators.ConfigurationStore.find_membrane_capacitance(), CellMLToNektar.translators.ConfigurationStore.find_transmembrane_potential(), and CellMLToNektar.translators.ConfigurationStore.lut_config.

1961  def finalize_config(self):
1962  """Having read all the configuration files, apply to the model."""
1963  # If no LT options given, add defaults
1964  if not self.lut_config:
1965  config_key = ('config-name', 'transmembrane_potential')
1966  self.lut_config[config_key] = {}
1967  self._set_lut_defaults(self.lut_config[config_key])
1968  # Identify the variables in the model
1971  if not self.options.protocol:
1972  self.find_current_vars()
def CellMLToNektar.translators.ConfigurationStore.find_current_vars (   self)
Find the variables representing currents.

Definition at line 2281 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._find_transmembrane_currents_from_voltage_ode(), CellMLToNektar.translators.ConfigurationStore.i_ionic_definitions, CellMLToNektar.translators.ConfigurationStore.i_ionic_vars, and CellMLToNektar.translators.ConfigurationStore.i_stim_var.

Referenced by CellMLToNektar.translators.ConfigurationStore.finalize_config().

2282  def find_current_vars(self):
2283  """Find the variables representing currents."""
2284  # Find the stimulus current, if it exists for this kind of model (some are self-excitatory)
2285  if not self.doc.model.is_self_excitatory():
2286  # self.i_stim_var = self._find_var('membrane_stimulus_current', self.i_stim_definitions)
2287  # DEBUG('config', 'Found stimulus', self.i_stim_var)
2288  if not self.i_stim_var:
2289  # No match :(
2290  msg = "No stimulus current found; you'll have trouble generating Nektar code"
2291  if self.options.fully_automatic:
2292  raise ConfigurationError(msg)
2293  else:
2294  print >>sys.stderr, msg
2295  self.i_stim_var = None
2296  # For other ionic currents, try using the equation for dV/dt unless told otherwise
2297  if not self.options.use_i_ionic_regexp:
2299  else:
2300  for defn in self.i_ionic_definitions:
2301  if getattr(defn, u'type', u'name') != u'name':
2302  raise ConfigurationError('Ionic current definitions have to have type "name"')
2303  regexps = unicode(defn).strip().split(',')
2304  comp_re = re.compile(regexps[0] + '$')
2305  var_re = re.compile(regexps[1] + '$')
2306  for component in getattr(self.doc.model, u'component', []):
2307  if comp_re.match(unicode(component.name).strip()):
2308  for var in getattr(component, u'variable', []):
2309  if (var is not self.i_stim_var and
2310  var_re.match(unicode(var.name).strip())):
2311  self.i_ionic_vars.append(var)
2312  if not self.i_ionic_vars:
2313  msg = "No ionic currents found; you'll have trouble generating Nektar code"
2314  if self.options.fully_automatic:
2315  raise ConfigurationError(msg)
2316  else:
2317  print >>sys.stderr, msg
2318  return
def CellMLToNektar.translators.ConfigurationStore.find_lookup_variables (   self)
Find the variable objects used as lookup table keys.

This method translates the variable names given in the configuration file into objects
in the document, and then uses those objects as keys in our lut_config dictionary.
The ultimate source variable for the variable specified is used, in order to avoid
complications caused by intermediaries being removed (e.g. by PE).

The table settings are also units-converted to match the units of the key variable.

Definition at line 2411 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._create_var_def(), CellMLToNektar.translators.ConfigurationStore._find_variable(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.utilities.LOG(), and CellMLToNektar.translators.ConfigurationStore.lut_config.

2412  def find_lookup_variables(self):
2413  """Find the variable objects used as lookup table keys.
2414 
2415  This method translates the variable names given in the configuration file into objects
2416  in the document, and then uses those objects as keys in our lut_config dictionary.
2417  The ultimate source variable for the variable specified is used, in order to avoid
2418  complications caused by intermediaries being removed (e.g. by PE).
2419 
2420  The table settings are also units-converted to match the units of the key variable.
2421  """
2422  new_config = {}
2423  for key in self.lut_config:
2424  defn_type, content = key
2425  defn = self._create_var_def(content, defn_type)
2426  var = self._find_variable(defn)
2427  if not var:
2428  # Variable doesn't exist, so we can't index on it
2429  LOG('lookup-tables', logging.WARNING, 'Variable', content, 'not found, so not using as table index.')
2430  else:
2431  var = var.get_source_variable(recurse=True)
2432  if not var in new_config:
2433  new_config[var] = {}
2434  new_config[var].update(self.lut_config[key])
2435  # Apply units conversions to the table settings if required
2436  table_units = new_config[var]['table_units']
2437  if table_units:
2438  var_units = var.get_units()
2439  if not table_units.dimensionally_equivalent(var_units):
2440  LOG('lookup-tables', logging.WARNING, 'Variable', content, 'is in units', var_units.description(),
2441  'which are incompatible with', table_units.description(), 'so not using as table index.')
2442  elif not table_units.equals(var_units):
2443  # New setting[var_units] = m[var_units/table_units]*(setting-o1[table_units]) + o2[var_units]
2444  # c.f. mathml_units_mixin._add_units_conversion
2445  print 'LT conversion:', table_units.description(), 'to', var_units.description(), 'equal?', table_units.equals(var_units)
2446  m = table_units.get_multiplicative_factor() / var_units.get_multiplicative_factor()
2447  for setting in new_config[var]:
2448  try:
2449  old_value = float(new_config[var][setting])
2450  new_value = m * (old_value - table_units.get_offset()) + var_units.get_offset()
2451  new_config[var][setting] = unicode(new_value)
2452  print 'LT conversion', setting, old_value, new_value
2453  except (ValueError, TypeError):
2454  pass
2455  self.lut_config = new_config
2456  DEBUG('config', 'Lookup tables configuration:', new_config)
2457  return
def CellMLToNektar.translators.ConfigurationStore.find_membrane_capacitance (   self)
Find and store the variable object representing the cell membrane capacitance.

Uses first metadata, if present, then the configuration file.

Definition at line 2404 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._find_var(), CellMLToNektar.translators.ConfigurationStore.Cm_definitions, CellMLToNektar.translators.ConfigurationStore.Cm_variable, and CellMLToNektar.utilities.DEBUG().

Referenced by CellMLToNektar.translators.ConfigurationStore.finalize_config().

2405  def find_membrane_capacitance(self):
2406  """Find and store the variable object representing the cell membrane capacitance.
2407 
2408  Uses first metadata, if present, then the configuration file."""
2409  self.Cm_variable = self._find_var('membrane_capacitance', self.Cm_definitions)
2410  DEBUG('config', 'Found capacitance', self.Cm_variable)
def CellMLToNektar.translators.ConfigurationStore.find_transmembrane_potential (   self)
Find and store the variable object representing V.

Tries metadata annotation first.  If that fails, uses the name given in
the command line options, if present.  If that fails, uses the config file.

Definition at line 2385 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._find_var(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.translators.CellMLTranslator.options, CellMLToNektar.translators.ConfigurationStore.options, CellMLToNektar.translators.ConfigurationStore.V_definitions, and CellMLToNektar.translators.ConfigurationStore.V_variable.

Referenced by CellMLToNektar.translators.ConfigurationStore.finalize_config().

2386  def find_transmembrane_potential(self):
2387  """Find and store the variable object representing V.
2388 
2389  Tries metadata annotation first. If that fails, uses the name given in
2390  the command line options, if present. If that fails, uses the config file.
2391  """
2392  if not self.options:
2393  raise ValueError('No command line options given')
2394  # Check command line option before config file
2395  if self.options.transmembrane_potential:
2396  self.V_definitions[0:0] = [self.options.transmembrane_potential.strip().split(',')]
2397  if len(self.V_definitions[0]) != 2:
2398  raise ConfigurationError('The name of V must contain both component and variable name')
2399  self.V_variable = self._find_var('membrane_voltage', self.V_definitions)
2400  DEBUG('config', 'Found V', self.V_variable)
2401  if not self.V_variable and not self.options.protocol:
2402  raise ConfigurationError('No transmembrane potential found; check your configuration')
2403  return self.V_variable
def CellMLToNektar.translators.ConfigurationStore.read_configuration_file (   self,
  config_file 
)
Read configuration stored in config_file.

The configuration file is expected to be XML, conforming to
the following structure.  Currently little checking is done on
the file format; incorrectly formatted files are unlikely to
give particularly helpful error messages.

The root element may contain a 'global' element, giving global
configuration options.  These include:

 * 'lookup_tables'
   Contains one or more 'lookup_table' elements, one for each
   type of lookup table available.  These contain (a selection of)
   the elements:
   * 'var' - the variable to key on.  The component name given
     should be that from which the variable is exported.  Must be
     present.
   * 'min', 'max', 'step' - table bounds parameters.  Optional.
   Default values are used for parameters that are not present.
 * 'currents'
   Defines which variables hold the ionic and stimulus currents,
   if any.  It contains 2 elements:
   * 'stimulus' - the full name of the stimulus current variable
   * 'ionic_match' - a regular expression matching full names of
     ionic current variables.  It may also match the stimulus
     current, but the stimulus will never be considered an ionic
     current.  The value is split on ','; the first part is then
     matched against component names, and the second against
     variables in matching components.
     
     This is mostly redundant now, because the equation for dV/dt
     is used first to determine the ionic currents (see documentation
     for _find_transmembrane_currents_from_voltage_ode), and only
     if this fails to find suitable currents will the ionic_match
     definition be used.
 * 'transmembrane_potential'
   Defines which variable holds the transmembrane potential.
   Defaults to 'membrane,V' if not present.
 * 'membrane_capacitance'
   Defines which variable holds the cell membrane capacitance.
   
The root element also contains 0 or more 'for_model' elements,
which contain settings for individual models.  These must have
at least one of an 'id' or 'name' attribute, which specify the
model in question.  They can also contain anything allowable as
global configuration options.  Options given here override those
specified globally.

Configuration which is identical for groups of models may be given
using the 'for_models' element.  This has an 'ids' element as its
first child, which contains 'id' elements holding either the name
or id of a model.  The remaining contents of the 'for_models'
element are as for 'for_model'.

There are 3 ways of specifying variables:
1. By name (var type='name')
   Variable names are given in full form, i.e. component_name,variable_name
2. By standardised name (var type='oxmeta')
   Use the name from the oxmeta annotations
3. By reference to a section of the config file (when defining lookup table keys)
   e.g. <var type='config-name'>transmembrane_potential</var>

Within any element that specifies a variable, a list of <var> elements can be
provided.  Each will be tried in turn to see if a match can be found in the model,
and the first match wins.

Some items are overridden if oxmeta annotations are present in the model, with
the annotated variable taking precedence over the config file specification.

Definition at line 1848 of file translators.py.

References CellMLToNektar.translators.ConfigurationStore._parse_Cm(), CellMLToNektar.translators.ConfigurationStore._parse_currents(), CellMLToNektar.translators.ConfigurationStore._parse_lookup_tables(), CellMLToNektar.translators.ConfigurationStore._parse_Vm(), CellMLToNektar.utilities.amara_parse(), CellMLToNektar.utilities.DEBUG(), CellMLToNektar.translators.get_options(), CellMLToNektar.translators.CellMLTranslator.options, CellMLToNektar.translators.ConfigurationStore.options, and CellMLToNektar.translators.ConfigurationStore.unit_definitions.

1849  def read_configuration_file(self, config_file):
1850  """Read configuration stored in config_file.
1851 
1852  The configuration file is expected to be XML, conforming to
1853  the following structure. Currently little checking is done on
1854  the file format; incorrectly formatted files are unlikely to
1855  give particularly helpful error messages.
1856 
1857  The root element may contain a 'global' element, giving global
1858  configuration options. These include:
1859 
1860  * 'lookup_tables'
1861  Contains one or more 'lookup_table' elements, one for each
1862  type of lookup table available. These contain (a selection of)
1863  the elements:
1864  * 'var' - the variable to key on. The component name given
1865  should be that from which the variable is exported. Must be
1866  present.
1867  * 'min', 'max', 'step' - table bounds parameters. Optional.
1868  Default values are used for parameters that are not present.
1869  * 'currents'
1870  Defines which variables hold the ionic and stimulus currents,
1871  if any. It contains 2 elements:
1872  * 'stimulus' - the full name of the stimulus current variable
1873  * 'ionic_match' - a regular expression matching full names of
1874  ionic current variables. It may also match the stimulus
1875  current, but the stimulus will never be considered an ionic
1876  current. The value is split on ','; the first part is then
1877  matched against component names, and the second against
1878  variables in matching components.
1879 
1880  This is mostly redundant now, because the equation for dV/dt
1881  is used first to determine the ionic currents (see documentation
1882  for _find_transmembrane_currents_from_voltage_ode), and only
1883  if this fails to find suitable currents will the ionic_match
1884  definition be used.
1885  * 'transmembrane_potential'
1886  Defines which variable holds the transmembrane potential.
1887  Defaults to 'membrane,V' if not present.
1888  * 'membrane_capacitance'
1889  Defines which variable holds the cell membrane capacitance.
1890 
1891  The root element also contains 0 or more 'for_model' elements,
1892  which contain settings for individual models. These must have
1893  at least one of an 'id' or 'name' attribute, which specify the
1894  model in question. They can also contain anything allowable as
1895  global configuration options. Options given here override those
1896  specified globally.
1897 
1898  Configuration which is identical for groups of models may be given
1899  using the 'for_models' element. This has an 'ids' element as its
1900  first child, which contains 'id' elements holding either the name
1901  or id of a model. The remaining contents of the 'for_models'
1902  element are as for 'for_model'.
1903 
1904  There are 3 ways of specifying variables:
1905  1. By name (var type='name')
1906  Variable names are given in full form, i.e. component_name,variable_name
1907  2. By standardised name (var type='oxmeta')
1908  Use the name from the oxmeta annotations
1909  3. By reference to a section of the config file (when defining lookup table keys)
1910  e.g. <var type='config-name'>transmembrane_potential</var>
1911 
1912  Within any element that specifies a variable, a list of <var> elements can be
1913  provided. Each will be tried in turn to see if a match can be found in the model,
1914  and the first match wins.
1915 
1916  Some items are overridden if oxmeta annotations are present in the model, with
1917  the annotated variable taking precedence over the config file specification.
1918  """
1919  DEBUG('config', "Reading configuration from ", config_file)
1920  binder = amara.bindery.binder()
1921  binder.set_binding_class(None, "units", cellml_units)
1922  binder.set_binding_class(None, "unit", cellml_unit)
1923  rules = [bt.ws_strip_element_rule(u'*')]
1924  config_doc = amara_parse(config_file, rules=rules, binderobj=binder)
1925  # Store extra units definitions
1926  for defn in config_doc.xml_xpath(u'/*/units'):
1927  defn.xml_parent = self.unit_definitions # Needed for looking up the units this definition is derived from
1928  self.unit_definitions.add_units(defn.name, defn)
1929  # Overrides for command-line options
1930  if self.options and hasattr(config_doc.pycml_config, 'command_line_args'):
1931  args = map(str, config_doc.pycml_config.command_line_args.arg)
1932  args.append('dummy-file')
1933  get_options(args, self.options)
1934  # Sections to use in configuration; later sections take precedence
1935  sections = []
1936  # Use global configuration?
1937  glo = config_doc.xml_xpath(u'/*/global')
1938  if glo:
1939  sections.append(glo[0])
1940  # Get the config section(s) for our model. Sections
1941  # specifically for this model come after sections covering
1942  # multiple models, so they take precedence.
1943  model_id = getattr(self.doc.model, u'id', self.doc.model.name)
1944  sections.extend(config_doc.xml_xpath(
1945  u'/*/for_models[ids/id="%s" or ids/id="%s"]'
1946  % (self.doc.model.name, model_id)))
1947  sections.extend(config_doc.xml_xpath(
1948  u'/*/for_model[@name="%s" or @id="%s"]'
1949  % (self.doc.model.name, model_id)))
1950  # Main items of configuration
1951  for section in sections:
1952  if hasattr(section, u'lookup_tables'):
1953  self._parse_lookup_tables(section.lookup_tables)
1954  if hasattr(section, u'currents'):
1955  self._parse_currents(section.currents)
1956  if hasattr(section, u'transmembrane_potential'):
1957  self._parse_Vm(section.transmembrane_potential)
1958  if hasattr(section, u'membrane_capacitance'):
1959  self._parse_Cm(section.membrane_capacitance)
def CellMLToNektar.translators.ConfigurationStore.validate_metadata (   self,
  assume_valid = False 
)
Check that the metadata annotations are 'sensible'.

Ensures that only names we know are used, and that the same name isn't used for multiple variables.

Definition at line 2459 of file translators.py.

2460  def validate_metadata(self, assume_valid=False):
2461  """Check that the metadata annotations are 'sensible'.
2462 
2463  Ensures that only names we know are used, and that the same name isn't used for multiple variables.
2464  """
2465  vars = cellml_metadata.find_variables(self.doc.model, ('bqbiol:is', NSS['bqbiol']))
2466  self.metadata_vars = filter(lambda v: v.oxmeta_name, vars)
2467  if assume_valid:
2468  return
2469  names_used = [var.oxmeta_name for var in self.metadata_vars]
2470  DEBUG('metadata', 'Names found: ', names_used)
2471  # Check all metadata is allowed
2472  unknown_names = frozenset(names_used) - cellml_metadata.METADATA_NAMES
2473  if unknown_names:
2474  msg = ['Unrecognised oxmeta variable names found (run with --assume-valid to ignore):']
2475  msg.extend(sorted(unknown_names))
2476  raise ConfigurationError('\n '.join(msg))
2477  # Check for duplicates
2478  d = {}
2479  for name in names_used:
2480  if name in d:
2481  raise ConfigurationError(name + ' metadata attribute is duplicated in the cellml file.')
2482  else:
2483  d[name] = name
2484 

Member Data Documentation

CellMLToNektar.translators.ConfigurationStore.Cm_definitions

Definition at line 1829 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_Cm(), and CellMLToNektar.translators.ConfigurationStore.find_membrane_capacitance().

CellMLToNektar.translators.ConfigurationStore.Cm_variable

Definition at line 1830 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._find_variable(), CellMLToNektar.translators.ConfigurationStore.annotate_currents_for_pe(), and CellMLToNektar.translators.ConfigurationStore.find_membrane_capacitance().

CellMLToNektar.translators.ConfigurationStore.doc

Definition at line 1820 of file translators.py.

CellMLToNektar.translators.ConfigurationStore.dt_variable

Definition at line 1843 of file translators.py.

CellMLToNektar.translators.ConfigurationStore.i_data_clamp_conductance

Definition at line 1845 of file translators.py.

CellMLToNektar.translators.ConfigurationStore.i_data_clamp_current

Definition at line 1844 of file translators.py.

CellMLToNektar.translators.ConfigurationStore.i_ionic_definitions

Definition at line 1836 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_currents(), and CellMLToNektar.translators.ConfigurationStore.find_current_vars().

CellMLToNektar.translators.ConfigurationStore.i_ionic_negated

Definition at line 1839 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._find_transmembrane_currents_from_voltage_ode().

CellMLToNektar.translators.ConfigurationStore.i_ionic_vars

Definition at line 1837 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore.annotate_currents_for_pe(), and CellMLToNektar.translators.ConfigurationStore.find_current_vars().

CellMLToNektar.translators.ConfigurationStore.i_stim_definitions

Definition at line 1834 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_currents().

CellMLToNektar.translators.ConfigurationStore.i_stim_negated

Definition at line 1841 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._find_transmembrane_currents_from_voltage_ode().

CellMLToNektar.translators.ConfigurationStore.i_stim_var

Definition at line 1835 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._find_transmembrane_currents_from_voltage_ode(), CellMLToNektar.translators.ConfigurationStore._find_variable(), CellMLToNektar.translators.ConfigurationStore.annotate_currents_for_pe(), and CellMLToNektar.translators.ConfigurationStore.find_current_vars().

CellMLToNektar.translators.ConfigurationStore.lut_config

Definition at line 1832 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_lookup_tables(), CellMLToNektar.translators.ConfigurationStore.finalize_config(), and CellMLToNektar.translators.ConfigurationStore.find_lookup_variables().

CellMLToNektar.translators.ConfigurationStore.metadata_vars

Definition at line 2465 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore.annotate_metadata_for_pe(), and CellMLToNektar.translators.ConfigurationStore.expose_variables().

CellMLToNektar.translators.ConfigurationStore.options

Definition at line 1822 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore.find_transmembrane_potential(), and CellMLToNektar.translators.ConfigurationStore.read_configuration_file().

CellMLToNektar.translators.ConfigurationStore.unit_definitions

Definition at line 1823 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore.read_configuration_file().

CellMLToNektar.translators.ConfigurationStore.V_definitions

Definition at line 1826 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._parse_Vm(), and CellMLToNektar.translators.ConfigurationStore.find_transmembrane_potential().

CellMLToNektar.translators.ConfigurationStore.V_variable

Definition at line 1827 of file translators.py.

Referenced by CellMLToNektar.translators.ConfigurationStore._find_transmembrane_currents_from_voltage_ode(), CellMLToNektar.translators.ConfigurationStore._find_variable(), and CellMLToNektar.translators.ConfigurationStore.find_transmembrane_potential().