From c96ef7c506268f84f296e15f0f8824f726377b82 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 22 Sep 2023 16:37:06 +0100
Subject: [PATCH 01/16] To v0.6.5
---
setup.cfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.cfg b/setup.cfg
index 3068171..7581086 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = PyLEMS
-version = 0.6.4
+version = 0.6.5
author = PyLEMS authors and contributors
author_email = gautham@lisphacker.org, p.gleeson@gmail.com
maintainer_email = p.gleeson@gmail.com
From 73f6f80516b9d1b6e9403f3c7810810e5f893441 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Tue, 12 Dec 2023 15:56:05 +0000
Subject: [PATCH 02/16] feat: add py312, drop EOL pys
---
setup.cfg | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/setup.cfg b/setup.cfg
index 7581086..a84acf1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -13,12 +13,11 @@ classifiers =
License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Natural Language :: English
Operating System :: OS Independent
- Programming Language :: Python :: 3.6
- Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
+ Programming Language :: Python :: 3.12
Topic :: Scientific/Engineering
license = LGPL-3.0-only
From d410251ae1c22836d30848cc9464fe0c1124a25e Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Tue, 12 Dec 2023 15:57:00 +0000
Subject: [PATCH 03/16] ci: drop EOL pys, add py312
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 524f10b..3bfdf23 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: ["3.7", "3.9", "3.10", "3.11"]
+ python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: [ubuntu-latest, windows-latest, macos-latest]
steps:
From 20c0cb36a3080dd86a6ec94d0ae74f49acf2b27c Mon Sep 17 00:00:00 2001
From: leon-k-martin
Date: Tue, 30 Jan 2024 16:37:16 +0100
Subject: [PATCH 04/16] FIX: Add symbol attribute to Constant class constructor
to fix false assigment of description to the symbol attribute.
---
lems/parser/LEMS.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lems/parser/LEMS.py b/lems/parser/LEMS.py
index 47158aa..b8b1d71 100644
--- a/lems/parser/LEMS.py
+++ b/lems/parser/LEMS.py
@@ -647,7 +647,14 @@ def parse_constant(self, node):
else:
description = None
- constant = Constant(name, value, dimension, description)
+ if "symbol" in node.lattrib:
+ symbol = node.lattrib["symbol"]
+ else:
+ symbol = None
+
+ constant = Constant(
+ name, value, dimension=dimension, description=description, symbol=symbol
+ )
if self.current_component_type:
self.current_component_type.add_constant(constant)
From fcaebe152558f946304ca1b9f1d39718b8d45b41 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 21 Feb 2024 11:10:08 +0000
Subject: [PATCH 05/16] docs: correct docstrings
---
lems/base/errors.py | 1 +
lems/base/stack.py | 1 +
lems/model/component.py | 123 +++++++++++++++++++++++++++++++++-----
lems/model/dynamics.py | 61 +++++++++++++++++--
lems/model/fundamental.py | 17 ++++++
lems/model/model.py | 38 ++++++++----
lems/model/simulation.py | 38 ++++++++++--
lems/model/structure.py | 35 ++++++++++-
lems/parser/LEMS.py | 10 +++-
lems/parser/expr.py | 12 +++-
lems/sim/build.py | 2 +
lems/sim/sim.py | 7 ++-
12 files changed, 301 insertions(+), 44 deletions(-)
diff --git a/lems/base/errors.py b/lems/base/errors.py
index 50cc9f1..d7a7411 100644
--- a/lems/base/errors.py
+++ b/lems/base/errors.py
@@ -27,6 +27,7 @@ def __init__(self, message, *params, **key_params):
self.message = None
""" Error message
+
:type: string """
if params:
diff --git a/lems/base/stack.py b/lems/base/stack.py
index 95eb600..576d8f6 100644
--- a/lems/base/stack.py
+++ b/lems/base/stack.py
@@ -21,6 +21,7 @@ def __init__(self):
self.stack = []
""" List used to store the stack contents.
+
:type: list """
def push(self, val):
diff --git a/lems/model/component.py b/lems/model/component.py
index bd5ed1a..ea4b5e0 100644
--- a/lems/model/component.py
+++ b/lems/model/component.py
@@ -30,30 +30,37 @@ def __init__(self, name, dimension, description=""):
self.name = name
""" Name of the parameter.
+
:type: str """
self.dimension = dimension
""" Physical dimension of the parameter.
+
:type: str """
self.fixed = False
""" Whether the parameter has been fixed or not.
+
:type: bool """
self.fixed_value = None
""" Value if fixed.
+
:type: str """
self.value = None
""" Value of the parameter.
+
:type: str """
self.numeric_value = None
""" Resolved numeric value.
+
:type: float """
self.description = description
""" Description of this parameter.
+
:type: str """
def toxml(self):
@@ -125,18 +132,22 @@ def __init__(self, name, dimension=None, default_value=None, description=""):
self.name = name
""" Name of the property.
+
:type: str """
self.dimension = dimension
""" Physical dimensions of the property.
+
:type: str """
self.description = description
""" Description of the property.
+
:type: str """
self.default_value = default_value
""" Default value of the property.
+
:type: float """
def toxml(self):
@@ -168,10 +179,12 @@ def __init__(self, name, description=""):
self.name = name
""" Name of the parameter.
+
:type: str """
self.description = description
""" Description of this parameter.
+
:type: str """
def toxml(self):
@@ -205,18 +218,22 @@ def __init__(self, name, value, dimension=None, description=""):
self.name = name
""" Name of the derived parameter.
+
:type: str """
self.dimension = dimension
""" Physical dimensions of the derived parameter.
+
:type: str """
self.value = value
""" Value of the derived parameter.
+
:type: str """
self.description = description
""" Description of the derived parameter.
+
:type: str """
try:
@@ -262,26 +279,32 @@ def __init__(self, name, value, dimension=None, symbol=None, description=""):
self.name = name
""" Name of the constant.
+
:type: str """
self.symbol = symbol
""" Symbol of the constant.
+
:type: str """
self.value = value
""" Value of the constant.
+
:type: str """
self.dimension = dimension
""" Physical dimensions of the constant.
+
:type: str """
self.description = description
""" Description of the constant.
+
:type: str """
self.numeric_value = None
""" Numeric value of the constant.
+
:type: float """
def toxml(self):
@@ -318,14 +341,17 @@ def __init__(self, name, dimension, description=""):
self.name = name
""" Name of the exposure.
+
:type: str """
self.dimension = dimension
""" Physical dimension of the exposure.
+
:type: str """
self.description = description
""" Description of this exposure.
+
:type: str """
def toxml(self):
@@ -358,14 +384,17 @@ def __init__(self, name, dimension, description=""):
self.name = name
""" Name of the requirement.
+
:type: str """
self.dimension = dimension
""" Physical dimension of the requirement.
+
:type: str """
self.description = description
""" Description of this requirement.
+
:type: str """
def toxml(self):
@@ -396,10 +425,12 @@ def __init__(self, name, description=""):
self.name = name
""" Name of the Component required.
+
:type: str """
self.description = description
""" Description of this ComponentRequirement.
+
:type: str """
def toxml(self):
@@ -431,14 +462,17 @@ def __init__(self, name, type, description=""):
self.name = name
""" Name of the instance requirement.
+
:type: str """
self.type = type
""" Type of the instance required.
+
:type: str """
self.description = description
""" Description of this InstanceRequirement.
+
:type: str """
def toxml(self):
@@ -471,18 +505,22 @@ def __init__(self, name, type_, description="", multiple=False):
self.name = name
""" Name of the children.
+
:type: str """
self.type = type_
""" Component type of the children.
+
:type: str """
self.description = description
""" Description of the children.
+
:type: str """
self.multiple = multiple
""" Single child / multiple children.
+
:type: bool """
def toxml(self):
@@ -512,14 +550,17 @@ def __init__(self, name, description=""):
self.name = name
""" Name of the text entry.
+
:type: str """
self.description = description
""" Description of the text entry.
+
:type: str """
self.value = None
""" Value of the text entry.
+
:type: str """
def toxml(self):
@@ -566,18 +607,22 @@ def __init__(self, name, type_, description=""):
self.name = name
""" Name of the link entry.
+
:type: str """
self.type = type_
""" Type of the link.
+
:type: str """
self.description = description
""" Description of the link.
+
:type: str """
self.value = None
""" Value of the link.
+
:type: str """
def toxml(self):
@@ -610,14 +655,17 @@ def __init__(self, name, description=""):
self.name = name
""" Name of the path entry.
+
:type: str """
self.description = description
""" Description of the path entry.
+
:type: str """
self.value = None
""" Value of the path entry.
+
:type: str """
def toxml(self):
@@ -650,6 +698,7 @@ def __init__(self, name, direction, description=""):
self.name = name
""" Name of the event port.
+
:type: str """
d = direction.lower()
@@ -660,10 +709,12 @@ def __init__(self, name, direction, description=""):
self.direction = direction
""" Direction - IN/OUT .
+
:type: str """
self.description = description
""" Description of the event port.
+
:type: str """
def toxml(self):
@@ -696,18 +747,22 @@ def __init__(self, name, type_, local=None):
self.name = name
""" Name of the component reference.
+
:type: str """
self.type = type_
""" Type of the component reference.
+
:type: str """
self.local = local
""" ???
+
:type: str """
self.referenced_component = None
""" Component being referenced.
+
:type: FatComponent """
def toxml(self):
@@ -736,14 +791,17 @@ def __init__(self, name, type_, description=""):
self.name = name
""" Name of the attachment collection.
+
:type: str """
self.type = type_
""" Type of attachment.
+
:type: str """
self.description = description
""" Description about the attachment.
+
:type: str """
def toxml(self):
@@ -776,82 +834,102 @@ def __init__(self):
self.parameters = Map()
""" Map of parameters in this component type.
- :type: Map(str -> lems.model.component.Parameter) """
+
+ :type: Map(str, lems.model.component.Parameter) """
self.properties = Map()
""" Map of properties in this component type.
- :type: Map(str -> lems.model.component.Property) """
+
+ :type: Map(str, lems.model.component.Property) """
self.derived_parameters = Map()
""" Map of derived_parameters in this component type.
- :type: Map(str -> lems.model.component.Parameter) """
+
+ :type: Map(str, lems.model.component.Parameter) """
self.index_parameters = Map()
""" Map of index_parameters in this component type.
- :type: Map(str -> lems.model.component.IndexParameter) """
+
+ :type: Map(str, lems.model.component.IndexParameter) """
self.constants = Map()
""" Map of constants in this component type.
- :type: Map(str -> lems.model.component.Constant) """
+
+ :type: Map(str, lems.model.component.Constant) """
self.exposures = Map()
""" Map of exposures in this component type.
- :type: Map(str -> lems.model.component.Exposure) """
+
+ :type: Map(str, lems.model.component.Exposure) """
self.requirements = Map()
""" Map of requirements.
- :type: Map(str -> lems.model.component.Requirement) """
+
+ :type: Map(str, lems.model.component.Requirement) """
self.component_requirements = Map()
""" Map of component requirements.
- :type: Map(str -> lems.model.component.ComponentRequirement) """
+
+ :type: Map(str, lems.model.component.ComponentRequirement) """
self.instance_requirements = Map()
""" Map of instance requirements.
- :type: Map(str -> lems.model.component.InstanceRequirement) """
+
+ :type: Map(str, lems.model.component.InstanceRequirement) """
self.children = Map()
""" Map of children.
- :type: Map(str -> lems.model.component.Children) """
+
+ :type: Map(str, lems.model.component.Children) """
self.texts = Map()
""" Map of text entries.
- :type: Map(str -> lems.model.component.Text) """
+
+ :type: Map(str, lems.model.component.Text) """
self.links = Map()
""" Map of links.
- :type: Map(str -> lems.model.component.Link) """
+
+ :type: Map(str, lems.model.component.Link) """
self.paths = Map()
""" Map of path entries.
- :type: Map(str -> lems.model.component.Path) """
+
+ :type: Map(str, lems.model.component.Path) """
self.event_ports = Map()
""" Map of event ports.
- :type: Map(str -> lems.model.component.EventPort """
+
+ :type: Map(str, lems.model.component.EventPort """
self.component_references = Map()
""" Map of component references.
- :type: Map(str -> lems.model.component.ComponentReference) """
+
+ :type: Map(str, lems.model.component.ComponentReference) """
self.attachments = Map()
""" Map of attachment type specifications.
- :type: Map(str -> lems.model.component.Attachments) """
+
+ :type: Map(str, lems.model.component.Attachments) """
self.dynamics = Dynamics()
""" Behavioural dynamics object.
+
:type: lems.model.dynamics.Dynamics """
self.structure = Structure()
""" Structural properties object.
+
:type: lems.model.structure.Structure """
self.simulation = Simulation()
""" Simulation attributes.
+
:type: lems.model.simulation.Simulation """
self.types = set()
""" Set of compatible component types.
+
:type: set(str) """
def add_parameter(self, parameter):
@@ -1073,14 +1151,17 @@ def __init__(self, name, description="", extends=None):
self.name = name
""" Name of the component type.
+
:type: str """
self.extends = extends
""" Base component type.
+
:type: str """
self.description = description
""" Description of this component type.
+
:type: str """
self.types.add(name)
@@ -1188,24 +1269,30 @@ def __init__(self, id_, type_, **params):
self.id = id_
""" ID of the component.
+
:type: str """
self.type = type_
""" Type of the component.
+
:type: str """
self.parameters = dict()
""" Dictionary of parameter values.
+
:type: str """
+
for key in params.keys():
self.parameters[key] = params[key]
self.children = list()
""" List of child components.
+
:type: list(lems.model.component.Component) """
self.parent_id = None
""" Optional id of parent
+
:type: str """
def __str__(self):
@@ -1298,18 +1385,22 @@ def __init__(self, id_, type_):
self.id = id_
""" ID of the component.
+
:type: str """
self.type = type_
""" Type of the component.
+
:type: str """
self.child_components = list()
""" List of child components.
+
:type: lems.model.component.FatComponent """
self.parent_id = None
""" Optional id of parent
+
:type: str """
def __str__(self):
diff --git a/lems/model/dynamics.py b/lems/model/dynamics.py
index 1ad1275..60b9cc2 100644
--- a/lems/model/dynamics.py
+++ b/lems/model/dynamics.py
@@ -25,14 +25,17 @@ def __init__(self, name, dimension, exposure=None):
self.name = name
""" Name of the state variable.
+
:type: str """
self.dimension = dimension
""" Dimension of the state variable.
+
:type: str """
self.exposure = exposure
""" Exposure name for the state variable.
+
:type: str """
def __str__(self):
@@ -68,34 +71,42 @@ def __init__(self, name, **params):
self.name = name
""" Name of the derived variable.
+
:type: str """
self.dimension = params["dimension"] if "dimension" in params else None
""" Dimension of the derived variable or None if computed.
+
:type: str """
self.exposure = params["exposure"] if "exposure" in params else None
""" Exposure name for the derived variable.
+
:type: str """
self.select = params["select"] if "select" in params else None
""" Selection path/expression for the derived variable.
+
:type: str """
self.value = params["value"] if "value" in params else None
""" Value of the derived variable.
+
:type: str """
self.reduce = params["reduce"] if "reduce" in params else None
""" Reduce method for the derived variable.
+
:type: str """
self.required = params["required"] if "required" in params else None
""" Requried or not.
+
:type: str """
self.expression_tree = None
""" Parse tree for the time derivative expression.
+
:type: lems.parser.expr.ExprNode """
if self.value != None:
@@ -138,18 +149,22 @@ def __init__(self, condition, value):
self.condition = condition
""" Condition for this case.
+
:type: str """
self.value = value
""" Value if the condition is true.
+
:type: str """
self.condition_expression_tree = None
""" Parse tree for the case condition expression.
+
:type: lems.parser.expr.ExprNode """
self.value_expression_tree = None
""" Parse tree for the case condition expression.
+
:type: lems.parser.expr.ExprNode """
try:
@@ -191,18 +206,22 @@ def __init__(self, name, dimension, exposure=None):
self.name = name
""" Name of the derived variable.
+
:type: str """
self.dimension = dimension
""" Dimension of the state variable.
+
:type: str """
self.exposure = exposure
""" Exposure name for the state variable.
+
:type: str """
self.cases = list()
""" List of cases related to this conditional derived variable.
+
:type: list(lems.model.dynamics.Case) """
def add_case(self, case):
@@ -265,14 +284,17 @@ def __init__(self, variable, value):
self.variable = variable
""" Name of the variable for which the time derivative is being specified.
+
:type: str """
self.value = value
""" Derivative expression.
+
:type: str """
self.expression_tree = None
""" Parse tree for the time derivative expression.
+
:type: lems.parser.expr.ExprNode """
try:
@@ -319,14 +341,17 @@ def __init__(self, variable, value):
self.variable = variable
""" Name of the variable for which the time derivative is being specified.
+
:type: str """
self.value = value
""" Derivative expression.
+
:type: str """
self.expression_tree = None
""" Parse tree for the time derivative expression.
+
:type: lems.parser.expr.ExprNode """
try:
@@ -366,6 +391,7 @@ def __init__(self, port):
self.port = port
""" Port on which the event comes in.
+
:type: str """
def toxml(self):
@@ -392,6 +418,7 @@ def __init__(self, regime):
self.regime = regime
""" Regime to transition to.
+
:type: str """
def toxml(self):
@@ -414,6 +441,7 @@ def __init__(self):
self.actions = list()
""" List of actions to be performed in response to this event.
+
:type: list(lems.model.dynamics.Action) """
def __str__(self):
@@ -498,6 +526,7 @@ def __init__(self, test):
self.test = test
""" Condition to be tested for.
+
:type: str """
try:
@@ -545,6 +574,7 @@ def __init__(self, port):
self.port = port
""" Port on which the event comes in.
+
:type: str """
def __str__(self):
@@ -627,34 +657,42 @@ def __init__(
self.name = name
""" Name of the kinetic scheme.
+
:type: str """
self.nodes = nodes
""" Nodes to be used for the kinetic scheme.
+
:type: str """
self.state_variable = state_variable
""" State variable updated by the kinetic scheme.
+
:type: str """
self.edges = edges
""" Edges to be used for the kinetic scheme.
+
:type: str """
self.edge_source = edge_source
""" Attribute that defines the source of the transition.
+
:type: str """
self.edge_target = edge_target
""" Attribute that defines the target of the transition.
+
:type: str """
self.forward_rate = forward_rate
""" Name of the forward rate exposure.
+
:type: str """
self.reverse_rate = reverse_rate
""" Name of the reverse rate exposure.
+
:type: str """
def toxml(self):
@@ -698,31 +736,38 @@ def __init__(self):
self.parent_behavioral = None
""" Parent behavioral object.
+
:type: lems.model.dynamics.Behavioral """
self.state_variables = Map()
""" Map of state variables in this behavior regime.
- :type: dict(str -> lems.model.dynamics.StateVariable """
+
+ :type: dict(str, lems.model.dynamics.StateVariable """
self.derived_variables = Map()
""" Map of derived variables in this behavior regime.
- :type: dict(str -> lems.model.dynamics.DerivedVariable """
+
+ :type: dict(str, lems.model.dynamics.DerivedVariable """
self.conditional_derived_variables = Map()
""" Map of conditional derived variables in this behavior regime.
- :type: dict(str -> lems.model.dynamics.ConditionalDerivedVariable """
+
+ :type: dict(str, lems.model.dynamics.ConditionalDerivedVariable """
self.time_derivatives = Map()
""" Map of time derivatives in this behavior regime.
- :type: dict(str -> lems.model.dynamics.TimeDerivative) """
+
+ :type: dict(str, lems.model.dynamics.TimeDerivative) """
self.event_handlers = list()
""" List of event handlers in this behavior regime.
+
:type: list(lems.model.dynamics.EventHandler) """
self.kinetic_schemes = Map()
""" Map of kinetic schemes in this behavior regime.
- :type: dict(str -> lems.model.dynamics.KineticScheme) """
+
+ :type: dict(str, lems.model.dynamics.KineticScheme) """
def has_content(self):
if (
@@ -890,14 +935,17 @@ def __init__(self, name, parent_behavioral, initial=False):
self.name = name
""" Name of this behavior regime.
+
:type: str """
self.parent_behavioral = parent_behavioral
""" Parent behavioral object.
+
:type: lems.model.dynamics.Behavioral """
self.initial = initial
""" Initial behavior regime.
+
:type: bool """
@@ -915,7 +963,8 @@ def __init__(self):
self.regimes = Map()
""" Map of behavior regimes.
- :type: Map(str -> lems.model.dynamics.Regime) """
+
+ :type: Map(str, lems.model.dynamics.Regime) """
def add_regime(self, regime):
"""
diff --git a/lems/model/fundamental.py b/lems/model/fundamental.py
index c36362d..2792405 100644
--- a/lems/model/fundamental.py
+++ b/lems/model/fundamental.py
@@ -24,6 +24,7 @@ def __init__(self, filename):
self.file = filename
""" Name of the file.
+
:type: str """
def toxml(self):
@@ -53,38 +54,47 @@ def __init__(self, name, description="", **params):
self.name = name
""" Name of the dimension.
+
:type: str """
self.m = params["m"] if "m" in params else 0
""" Power for the mass dimension.
+
:type: int """
self.l = params["l"] if "l" in params else 0
""" Power for the length dimension.
+
:type: int """
self.t = params["t"] if "t" in params else 0
""" Power for the time dimension.
+
:type: int """
self.i = params["i"] if "i" in params else 0
""" Power for the electic current dimension.
+
:type: int """
self.k = params["k"] if "k" in params else 0
""" Power for the temperature dimension.
+
:type: int """
self.n = params["n"] if "n" in params else 0
""" Power for the quantity dimension.
+
:type: int """
self.j = params["j"] if "j" in params else 0
""" Power for the luminous intensity dimension.
+
:type: int """
self.description = description
""" Description of this dimension.
+
:type: str """
def toxml(self):
@@ -121,30 +131,37 @@ def __init__(
self.name = name
""" Name of the unit.
+
:type: str """
self.symbol = symbol
""" Symbol for the unit.
+
:type: str """
self.dimension = dimension
""" Dimension for the unit.
+
:type: str """
self.power = power
""" Scaling by power of 10.
+
:type: int """
self.scale = scale
""" Scaling.
+
:type: float """
self.offset = offset
""" Offset for non-zero units.
+
:type: float """
self.description = description
""" Description of this unit.
+
:type: str """
def toxml(self):
diff --git a/lems/model/model.py b/lems/model/model.py
index 527bd91..c47f764 100644
--- a/lems/model/model.py
+++ b/lems/model/model.py
@@ -71,58 +71,72 @@ def __init__(self, include_includes=True, fail_on_missing_includes=True):
self.targets = list()
""" List of targets to be run on startup.
+
:type: list(str) """
self.includes = Map()
""" Dictionary of includes defined in the model.
- :type: dict(str -> lems.model.fundamental.Include """
+
+ :type: dict(str, lems.model.fundamental.Include """
self.dimensions = Map()
""" Dictionary of dimensions defined in the model.
- :type: dict(str -> lems.model.fundamental.Dimension """
+
+ :type: dict(str, lems.model.fundamental.Dimension """
self.units = Map()
""" Map of units defined in the model.
- :type: dict(str -> lems.model.fundamental.Unit """
+
+ :type: dict(str, lems.model.fundamental.Unit """
self.component_types = Map()
""" Map of component types defined in the model.
- :type: dict(str -> lems.model.component.ComponentType) """
+
+ :type: dict(str, lems.model.component.ComponentType) """
self.components = Map()
""" Map of root components defined in the model.
- :type: dict(str -> lems.model.component.Component) """
+
+ :type: dict(str, lems.model.component.Component) """
self.fat_components = Map()
""" Map of root fattened components defined in the model.
- :type: dict(str -> lems.model.component.FatComponent) """
+
+ :type: dict(str, lems.model.component.FatComponent) """
self.constants = Map()
""" Map of constants in this component type.
- :type: dict(str -> lems.model.component.Constant) """
+
+ :type: dict(str, lems.model.component.Constant) """
self.include_directories = []
""" List of include directories to search for included LEMS files.
+
:type: list(str) """
self.included_files = []
""" List of files already included.
+
:type: list(str) """
self.description = None
""" Short description of contents of LEMS file
+
:type: str """
self.include_includes = include_includes
""" Whether to include LEMS definitions in elements
+
:type: boolean """
self.fail_on_missing_includes = fail_on_missing_includes
""" Whether to raise an Exception when a file in an element is not found
+
:type: boolean """
self.resolved_model = None
""" A resolved version of the model, generated by self.resolve()
+
:type: None or Model"""
self.comp_ref_map = None
@@ -1114,9 +1128,13 @@ def list_exposures(self, substring: str = "") -> dict[FatComponent, Map]:
:returns: dictionary of components and their exposures
The returned dictionary is of the form:
- {
- "component": ["exp1", "exp2"]
- }
+
+
+ .. code-block:: python
+
+ {
+ "component": ["exp1", "exp2"]
+ }
"""
exposures = {}
diff --git a/lems/model/simulation.py b/lems/model/simulation.py
index eece19f..78bbc6e 100644
--- a/lems/model/simulation.py
+++ b/lems/model/simulation.py
@@ -26,19 +26,23 @@ def __init__(self, component, variable, increment, total):
self.component = component
""" Name of the target component to be run according to the
specification given for an independent state variable.
+
:type: str """
self.variable = variable
""" The name of an independent state variable according to which the
target component will be run.
+
:type: str """
self.increment = increment
""" Increment of the state variable on each step.
+
:type: str """
self.total = total
""" Final value of the state variable.
+
:type: str """
def toxml(self):
@@ -67,22 +71,27 @@ def __init__(self, quantity, scale=None, color=None, id=None):
self.id = ""
""" Id of the quantity
+
:type: str """
self.quantity = quantity
""" Path to the quantity to be recorded.
+
:type: str """
self.scale = scale
""" Text parameter to be used for scaling the quantity before display.
+
:type: str """
self.color = color
""" Text parameter to be used to specify the color for display.
+
:type: str """
self.id = id
""" Text parameter to be used to specify an id for the record
+
:type: str """
def toxml(self):
@@ -109,14 +118,17 @@ def __init__(self, quantity, eventPort):
self.id = ""
""" Id of the quantity
+
:type: str """
self.quantity = quantity
""" Path to the quantity to be recorded.
+
:type: str """
self.eventPort = eventPort
""" eventPort to be used for the event record
+
:type: str """
def toxml(self):
@@ -158,14 +170,17 @@ def __init__(self, title, data_region):
self.title = title
""" Title for the display.
+
:type: string """
self.data_region = data_region
""" Display position
+
:type: string """
self.time_scale = 1
""" Time scale
+
:type: Number """
def toxml(self):
@@ -194,10 +209,12 @@ def __init__(self, path, file_name):
self.path = path
""" Path to the quantity to be saved to file.
+
:type: string """
self.file_name = file_name
""" Text parameter to be used for the file name
+
:type: string """
def toxml(self):
@@ -229,14 +246,17 @@ def __init__(self, path, file_name, format):
self.path = path
""" Path to the quantity to be saved to file.
+
:type: string """
self.file_name = file_name
""" Text parameter to be used for the file name
+
:type: string """
self.format = format
""" Text parameter to be used for the format
+
:type: string """
def toxml(self):
@@ -266,27 +286,33 @@ def __init__(self):
self.runs = Map()
""" Map of runs in this dynamics regime.
- :type: Map(string -> lems.model.simulation.Run) """
+
+ :type: Map(string, lems.model.simulation.Run) """
self.records = Map()
""" Map of recorded variables in this dynamics regime.
- :type: Map(string -> lems.model.simulation.Record """
+
+ :type: Map(string, lems.model.simulation.Record """
self.event_records = Map()
""" Map of recorded events in this dynamics regime.
- :type: Map(string -> lems.model.simulation.EventRecord """
+
+ :type: Map(string, lems.model.simulation.EventRecord """
self.data_displays = Map()
""" Map of data displays mapping titles to regions.
- :type: Map(string -> string) """
+
+ :type: Map(string, string) """
self.data_writers = Map()
""" Map of recorded variables to data writers.
- :type: Map(string -> lems.model.simulation.DataWriter """
+
+ :type: Map(string, lems.model.simulation.DataWriter """
self.event_writers = Map()
""" Map of recorded variables to event writers.
- :type: Map(string -> lems.model.simulation.EventWriter """
+
+ :type: Map(string, lems.model.simulation.EventWriter """
def add_run(self, run):
"""
diff --git a/lems/model/structure.py b/lems/model/structure.py
index 0d3a51a..c3e5295 100644
--- a/lems/model/structure.py
+++ b/lems/model/structure.py
@@ -23,18 +23,22 @@ def __init__(self, instance, as_, list=None, index=None):
self.instance = instance
""" Instance to be referenced.
+
:type: str """
self.as_ = as_
""" Alternative name.
+
:type: str """
self.list = list
""" list of components, e.g. population
+
:type: str """
self.index = index
""" index in list to be referenced.
+
:type: str """
def toxml(self):
@@ -64,22 +68,27 @@ def __init__(self, name, end_a, end_b, component_a, component_b):
self.name = name
""" name of Tunnel.
+
:type: str """
self.end_a = end_a
""" 'A' end of Tunnel.
+
:type: str """
self.end_b = end_b
""" 'B' end of Tunnel.
+
:type: str """
self.component_a = component_a
""" Component to create at A.
+
:type: str """
self.component_b = component_b
""" Component to create at B.
+
:type: str """
def toxml(self):
@@ -113,26 +122,32 @@ def __init__(
self.from_ = from_
""" Name of the source component for event.
+
:type: str """
self.to = to
""" Name of the target component for the event.
+
:type: str """
self.source_port = source_port
""" Source port name.
+
:type: str """
self.target_port = target_port
""" Target port name.
+
:type: str """
self.receiver = receiver
""" Proxy receiver component attached to the target component that actually receiving the event.
+
:type: Component """
self.receiver_container = receiver_container
""" Name of the child component grouping to add the receiver to.
+
:type: str """
def __eq__(self, o):
@@ -178,10 +193,12 @@ def __init__(self, component, referenced_component=None):
self.component = component
""" Name of the component reference to be used for instantiation.
+
:type: str """
self.referenced_component = referenced_component
""" Target component being referenced after resolution.
+
:type: lems.model.component.FatComponent """
def __eq__(self, o):
@@ -209,10 +226,12 @@ def __init__(self, property, value):
self.property_ = property
""" Name of the property reference to be used for instantiation.
+
:type: str """
self.value = value
""" Value of the property.
+
:type: str"""
def __eq__(self, o):
@@ -245,19 +264,23 @@ def __init__(self, component=None, number=None, component_type=None):
self.component = component
""" Name of the component reference to be used for instantiation.
+
:type: str """
self.component_type = component_type
""" Name of the component type reference to be used for instantiation.
+
:type: str """
self.number = number
""" Name of the paramter specifying the number of times the component
reference is to be instantiated.
+
:type: str"""
self.assignments = []
""" List of assignments included in MultiInstantiate.
+
:type: list(Assign) """
def __eq__(self, o):
@@ -322,10 +345,12 @@ def __init__(self, instances, as_):
self.event_connections = list()
""" List of event connections.
+
:type: list(lems.model.structure.EventConnection) """
self.for_eachs = list()
""" List of for each specs.
+
:type: list(lems.model.structure.ForEach) """
def add_for_each(self, fe):
@@ -377,26 +402,32 @@ def __init__(self):
self.withs = Map()
""" Map of With statements.
- :type: Map(str -> lems.model.structure.With) """
+
+ :type: Map(str, lems.model.structure.With) """
self.tunnels = Map()
""" Map of tunnel statements.
- :type: Map(str -> lems.model.structure.Tunnel) """
+
+ :type: Map(str, lems.model.structure.Tunnel) """
self.event_connections = list()
""" List of event connections.
+
:type: list(lems.model.structure.EventConnection) """
self.child_instances = list()
""" List of child instantations.
+
:type: list(lems.model.structure.ChildInstance) """
self.multi_instantiates = list()
""" List of child multi-instantiations.
+
:type: list(lems.model.structure.MultiInstantiate) """
self.for_eachs = list()
""" List of for each specs.
+
:type: list(lems.model.structure.ForEach) """
def has_content(self):
diff --git a/lems/parser/LEMS.py b/lems/parser/LEMS.py
index b8b1d71..2cdb725 100644
--- a/lems/parser/LEMS.py
+++ b/lems/parser/LEMS.py
@@ -72,26 +72,32 @@ def __init__(self, model, include_dirs=[], include_includes=True):
self.model = model
""" Model instance to be populated from the parsed file.
+
:type: lems.model.model.Model """
self.include_dirs = include_dirs
""" List of directories to search for included files.
+
:type: list(str) """
self.tag_parse_table = None
""" Dictionary of xml tags to parse methods
- :type: dict(string -> function) """
+
+ :type: dict(string, function) """
self.valid_children = None
""" Dictionary mapping each tag to it's list of valid child tags.
- :type: dict(string -> string) """
+
+ :type: dict(string, string) """
self.id_counter = None
""" Counter generator for generating unique ids.
+
:type: generator(int) """
self.include_includes = include_includes
""" Whether to include LEMS definitions in elements
+
:type: boolean """
self.init_parser()
diff --git a/lems/parser/expr.py b/lems/parser/expr.py
index ee9cebf..2442377 100644
--- a/lems/parser/expr.py
+++ b/lems/parser/expr.py
@@ -45,6 +45,7 @@ def __init__(self, type):
self.type = type
""" Node type.
+
:type: enum(ExprNode.OP, ExprNode.VALUE) """
@@ -64,6 +65,7 @@ def __init__(self, value):
ExprNode.__init__(self, ExprNode.VALUE)
self.value = value
""" Value to be stored in this node.
+
:type: string """
def clean_up(self):
@@ -112,14 +114,17 @@ def __init__(self, op, left, right):
self.op = op
""" Operation stored in this node.
+
:type: string """
self.left = left
""" Left operand.
+
:type: lems.parser.expr.ExprNode """
self.right = right
""" Right operand.
+
:type: lems.parser.expr.ExprNode """
def __str__(self):
@@ -159,10 +164,12 @@ def __init__(self, func, param):
self.func = func
""" Funcion stored in this node.
+
:type: string """
self.param = param
""" Parameter.
+
:type: lems.parser.expr.ExprNode """
def __str__(self):
@@ -211,7 +218,8 @@ class ExprParser(LEMSBase):
depth = 0
""" Dictionary mapping operators to their priorities.
- :type: dict(string -> Integer) """
+
+ :type: dict(string, Integer) """
def __init__(self, parse_string):
"""
@@ -223,10 +231,12 @@ def __init__(self, parse_string):
self.parse_string = parse_string
""" Expression to be parsed.
+
:type: string """
self.token_list = None
""" List of tokens from the expression to be parsed.
+
:type: list(string) """
def is_op(self, str):
diff --git a/lems/sim/build.py b/lems/sim/build.py
index 04ab3c6..d6d2304 100644
--- a/lems/sim/build.py
+++ b/lems/sim/build.py
@@ -33,10 +33,12 @@ def __init__(self, model):
self.model = model
""" Model to be used for constructing the simulation.
+
:type: lems.model.model.Model """
self.sim = None
""" Simulation built from the model.
+
:type: lems.sim.sim.Simulation """
self.current_record_target = None
diff --git a/lems/sim/sim.py b/lems/sim/sim.py
index ac50f23..e3e3a22 100644
--- a/lems/sim/sim.py
+++ b/lems/sim/sim.py
@@ -25,14 +25,17 @@ def __init__(self):
self.runnables = {}
""" Dictionary of runnable components in this simulation.
- :type: dict(string -> lems.sim.runnable.Runnable) """
+
+ :type: dict(string, lems.sim.runnable.Runnable) """
self.run_queue = []
""" Priority of pairs of (time-to-next run, runnable).
+
:type: list((Integer, lems.sim.runnable.Runnable)) """
self.event_queue = []
""" List of posted events.
+
:type: list(lems.sim.sim.Event) """
def add_runnable(self, runnable):
@@ -159,8 +162,10 @@ class Event:
def __init__(self, from_id, to_id):
self.from_id = from_id
""" ID of the source runnable for this event.
+
:type: Integer """
self.to_id = to_id
""" ID of the destination runnable for this event.
+
:type: Integer """
From ed03a2bd8db7c8581e6f12f1dc58aa5bc8201577 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 21 Feb 2024 11:27:15 +0000
Subject: [PATCH 06/16] docs: install package before generating docs
Getting the version using `importlib` requires the package to be
installed.
---
.readthedocs.yaml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
index ae78afd..87d3b7f 100644
--- a/.readthedocs.yaml
+++ b/.readthedocs.yaml
@@ -9,7 +9,10 @@ build:
sphinx:
configuration: doc/conf.py
-
python:
install:
- - requirements: doc/requirements.txt
+ - method: pip
+ path: .
+ extra_requirements:
+ - doc
+
From c21fd06c9241bd7f13244d0f3f2d5e7547ee9c16 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 21 Feb 2024 11:40:07 +0000
Subject: [PATCH 07/16] To v0.6.7; improve file closure
---
lems/model/model.py | 14 +++++++++-----
setup.cfg | 2 +-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/lems/model/model.py b/lems/model/model.py
index 527bd91..83e022f 100644
--- a/lems/model/model.py
+++ b/lems/model/model.py
@@ -272,7 +272,8 @@ def include_file(self, path, include_dirs=[]):
parser = LEMSFileParser(self, inc_dirs, self.include_includes)
if os.access(path, os.F_OK):
if not path in self.included_files:
- parser.parse(open(path).read())
+ with open(path) as f:
+ parser.parse(f.read())
self.included_files.append(path)
return
else:
@@ -284,7 +285,8 @@ def include_file(self, path, include_dirs=[]):
new_path = inc_dir + "/" + path
if os.access(new_path, os.F_OK):
if not new_path in self.included_files:
- parser.parse(open(new_path).read())
+ with open(new_path) as f:
+ parser.parse(f.read())
self.included_files.append(new_path)
return
else:
@@ -374,9 +376,11 @@ def export_to_file(self, filepath, level_prefix=" "):
"\n",
)
- f = open(filepath, "w")
- f.write(xmlstr)
- f.close()
+ with open(filepath, "w") as f:
+ f.write(xmlstr)
+ f.flush()
+ os.fsync(f.fileno())
+
def resolve(self) -> lems.model.Model:
"""
diff --git a/setup.cfg b/setup.cfg
index a84acf1..f480844 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
[metadata]
name = PyLEMS
-version = 0.6.5
+version = 0.6.7
author = PyLEMS authors and contributors
author_email = gautham@lisphacker.org, p.gleeson@gmail.com
maintainer_email = p.gleeson@gmail.com
From f59d83e6c7b4d1f67362b65dedf136763add2b36 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 21 Feb 2024 11:45:52 +0000
Subject: [PATCH 08/16] docs: fix rtd build
Move requirements to setup.cfg
---
doc/requirements.txt | 1 -
setup.cfg | 4 ++++
2 files changed, 4 insertions(+), 1 deletion(-)
delete mode 100644 doc/requirements.txt
diff --git a/doc/requirements.txt b/doc/requirements.txt
deleted file mode 100644
index ef36add..0000000
--- a/doc/requirements.txt
+++ /dev/null
@@ -1 +0,0 @@
-sphinxcontrib-bibtex
diff --git a/setup.cfg b/setup.cfg
index a84acf1..8cb44ed 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -37,6 +37,10 @@ console_scripts =
pylems = lems.run:main
+[options.extras_require]
+doc =
+ sphinxcontrib-bibtex
+
[flake8]
# ignore:
# spacing around operators, comment blocks, in argument lists
From 006d7605869a27bc254a36b500fede3c86ee5c74 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Thu, 11 Apr 2024 16:08:15 +0100
Subject: [PATCH 09/16] Test on macos14
---
.github/workflows/ci.yml | 6 +++---
.github/workflows/examples.yml | 4 ++--
.github/workflows/python-publish.yml | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3bfdf23..ca8996a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,13 +14,13 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
- runs-on: [ubuntu-latest, windows-latest, macos-latest]
+ runs-on: [ubuntu-latest, windows-latest, macos-latest, macos-14]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml
index 8c21bb6..f97c3e4 100644
--- a/.github/workflows/examples.yml
+++ b/.github/workflows/examples.yml
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- uses: nelonoel/branch-name@v1.0.1
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
@@ -21,7 +21,7 @@ jobs:
id: extract_branch
- name: Checkout jlems
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
repository: LEMS/jLEMS
ref: ${{ steps.extract_branch.outputs.branch }}
diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
index 7d29880..734546a 100644
--- a/.github/workflows/python-publish.yml
+++ b/.github/workflows/python-publish.yml
@@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
From 1206cff34f0280ee892532261045ba445b7f4b86 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Thu, 11 Apr 2024 16:23:41 +0100
Subject: [PATCH 10/16] Exclude 3.9 on mac14
---
.github/workflows/ci.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ca8996a..a1c0fa3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,6 +15,9 @@ jobs:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: [ubuntu-latest, windows-latest, macos-latest, macos-14]
+ exclude:
+ - os: macos-14
+ python-version: "3.9"
steps:
- uses: actions/checkout@v4
From ff3a73a7e27ec8f71c32c2e080f6f1403f8981cf Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Thu, 11 Apr 2024 16:24:22 +0100
Subject: [PATCH 11/16] Update ci.yml
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a1c0fa3..8ea3cee 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,7 +16,7 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: [ubuntu-latest, windows-latest, macos-latest, macos-14]
exclude:
- - os: macos-14
+ - runs-on: macos-14
python-version: "3.9"
steps:
From e23ddbe97b06236946cfb0737b2f4e0ea9b6a263 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Thu, 11 Apr 2024 16:31:01 +0100
Subject: [PATCH 12/16] Final gha version update
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a1c0fa3..5b01381 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,7 +33,7 @@ jobs:
python -m pip install pytest pytest-cov
- name: Checkout NeuroML2
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
repository: NeuroML/NeuroML2
ref: development
From 57da8922394446149b5cd89ebd53bc0e0c0413a3 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Mon, 29 Apr 2024 12:57:40 +0100
Subject: [PATCH 13/16] Remove macos-14
---
.github/workflows/ci.yml | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6ed3a0c..95e8568 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,10 +14,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
- runs-on: [ubuntu-latest, windows-latest, macos-latest, macos-14]
- exclude:
- - runs-on: macos-14
- python-version: "3.9"
+ runs-on: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
From 07004d19d2d4cedefd48d380005e6854c2caffe0 Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 7 Aug 2024 14:15:44 +0100
Subject: [PATCH 14/16] Minor black formatting change
---
lems/model/model.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/lems/model/model.py b/lems/model/model.py
index b080413..f9087b8 100644
--- a/lems/model/model.py
+++ b/lems/model/model.py
@@ -395,7 +395,6 @@ def export_to_file(self, filepath, level_prefix=" "):
f.flush()
os.fsync(f.fileno())
-
def resolve(self) -> lems.model.Model:
"""
Resolves references in this model and returns resolved model.
From 62a44ce29048dbf46b536ae8f0153dfda938b8ee Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Mon, 19 Aug 2024 16:52:56 +0100
Subject: [PATCH 15/16] Update pylems examples to formatted version from lems
repo
---
examples/SimpleNetwork.xml | 9 +-
examples/SingleSimulation.xml | 25 +--
examples/elecdims.xml | 3 +-
examples/ex2dims.xml | 10 +-
examples/example1.xml | 295 ++++++++++++++--------------------
examples/example2.xml | 35 ++--
examples/example3.xml | 56 ++-----
examples/example4.xml | 63 ++------
examples/example5.xml | 69 ++------
examples/example6.xml | 33 +---
examples/example7.xml | 29 +---
examples/example8.xml | 74 +++------
examples/hhaltgate.xml | 14 +-
examples/hhcell.xml | 14 +-
examples/hhchannel.xml | 20 +--
examples/hhmodels.xml | 8 +-
examples/misciaf.xml | 12 +-
examples/spikegenerators.xml | 7 +-
18 files changed, 233 insertions(+), 543 deletions(-)
diff --git a/examples/SimpleNetwork.xml b/examples/SimpleNetwork.xml
index 507842a..9a55a87 100644
--- a/examples/SimpleNetwork.xml
+++ b/examples/SimpleNetwork.xml
@@ -4,7 +4,6 @@
-
@@ -13,8 +12,6 @@
-
-
@@ -23,17 +20,13 @@
-
-
-
+
-
-
diff --git a/examples/SingleSimulation.xml b/examples/SingleSimulation.xml
index 1a2319d..e6a7d55 100644
--- a/examples/SingleSimulation.xml
+++ b/examples/SingleSimulation.xml
@@ -1,22 +1,17 @@
-
-
-
+
-
-
-
@@ -27,20 +22,15 @@
-
-
-
-
-
@@ -48,28 +38,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/examples/elecdims.xml b/examples/elecdims.xml
index c81221a..612f2cf 100644
--- a/examples/elecdims.xml
+++ b/examples/elecdims.xml
@@ -4,5 +4,4 @@
-
-
\ No newline at end of file
+
diff --git a/examples/ex2dims.xml b/examples/ex2dims.xml
index aeb1e22..702c319 100644
--- a/examples/ex2dims.xml
+++ b/examples/ex2dims.xml
@@ -1,5 +1,4 @@
-
-
+
@@ -8,8 +7,8 @@
-
-
+
+
@@ -19,5 +18,4 @@
-
-
\ No newline at end of file
+
diff --git a/examples/example1.xml b/examples/example1.xml
index d84c23b..393f3f8 100644
--- a/examples/example1.xml
+++ b/examples/example1.xml
@@ -1,275 +1,220 @@
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
-
+
-
-
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
+
-
-
+
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
+
+
+
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
+
-
-
-
-
+
+
+
+
-
-
\ No newline at end of file
+
diff --git a/examples/example2.xml b/examples/example2.xml
index bdfe1b4..26e3953 100644
--- a/examples/example2.xml
+++ b/examples/example2.xml
@@ -1,51 +1,40 @@
-
-
+
-
-
+
-
-
+
-
-
+
-
-
-
+
-
-
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
\ No newline at end of file
+
diff --git a/examples/example3.xml b/examples/example3.xml
index 7e78b8b..bbee903 100644
--- a/examples/example3.xml
+++ b/examples/example3.xml
@@ -1,21 +1,13 @@
-
-
-
+
-
-
-
-
-
+
-
@@ -23,98 +15,75 @@
-
-
-
-
-
+
+
-
-
-
-
-
+
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
+
-
-
-
-
-
-
+
+
@@ -123,7 +92,4 @@
-
-
-
-
\ No newline at end of file
+
diff --git a/examples/example4.xml b/examples/example4.xml
index d905399..74660f4 100644
--- a/examples/example4.xml
+++ b/examples/example4.xml
@@ -1,46 +1,35 @@
-
-
-
+
-
-
-
-
-
-
+
-
-
@@ -51,12 +40,10 @@
-
-
@@ -64,7 +51,6 @@
-
@@ -72,8 +58,7 @@
-
-
+
@@ -82,53 +67,42 @@
-
-
-
-
-
+
+
+
-
-
+
-
-
-
-
-
-
-
-
+
+
+
-
-
-
@@ -139,24 +113,19 @@
-
-
+
-
-
-
-
-
-
+
+
@@ -165,15 +134,11 @@
-
-
-
-
-
\ No newline at end of file
+
diff --git a/examples/example5.xml b/examples/example5.xml
index c574a42..38aa956 100644
--- a/examples/example5.xml
+++ b/examples/example5.xml
@@ -1,5 +1,4 @@
-
@@ -9,12 +8,10 @@
-
-
@@ -24,50 +21,39 @@
-
-
+
-
-
-
-
-
-
-
-
+
+
-
-
@@ -78,21 +64,17 @@
-
-
-
-
@@ -100,8 +82,7 @@
-
-
+
@@ -110,35 +91,26 @@
-
-
-
-
-
-
-
-
+
+
+
-
-
+
-
-
-
@@ -146,21 +118,15 @@
-
-
-
-
-
-
+
+
+
-
-
-
@@ -172,27 +138,22 @@
-
-
+
-
-
-
-
-
+
+
-
-
\ No newline at end of file
+
diff --git a/examples/example6.xml b/examples/example6.xml
index 8dd4025..12e3f6d 100644
--- a/examples/example6.xml
+++ b/examples/example6.xml
@@ -1,44 +1,35 @@
-
-
-
+
+
-
-
+
-
-
-
+
-
-
+
-
+
-
-
-
@@ -49,25 +40,19 @@
-
-
-
-
-
-
-
+
@@ -75,6 +60,4 @@
-->
-
-
-
\ No newline at end of file
+
diff --git a/examples/example7.xml b/examples/example7.xml
index 4e46e4c..89c6311 100644
--- a/examples/example7.xml
+++ b/examples/example7.xml
@@ -1,76 +1,59 @@
-
-
-
-
+
+
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
\ No newline at end of file
+
diff --git a/examples/example8.xml b/examples/example8.xml
index 43d0b54..b7dbc6f 100644
--- a/examples/example8.xml
+++ b/examples/example8.xml
@@ -1,119 +1,95 @@
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
-
-
+
-
-
-
-
+
-
-
-
-
+
@@ -121,6 +97,4 @@
-
-
-
\ No newline at end of file
+
diff --git a/examples/hhaltgate.xml b/examples/hhaltgate.xml
index 39906ee..64c3f8d 100644
--- a/examples/hhaltgate.xml
+++ b/examples/hhaltgate.xml
@@ -1,24 +1,18 @@
-
-
+
-
-
-
-
+
-
-
+
-
-
\ No newline at end of file
+
diff --git a/examples/hhcell.xml b/examples/hhcell.xml
index 90575e1..782f299 100644
--- a/examples/hhcell.xml
+++ b/examples/hhcell.xml
@@ -1,12 +1,9 @@
-
-
-
@@ -14,36 +11,29 @@
-
-
-
-
-
-
-
+
-
-
\ No newline at end of file
+
diff --git a/examples/hhchannel.xml b/examples/hhchannel.xml
index 7e7c6b4..debc1cb 100644
--- a/examples/hhchannel.xml
+++ b/examples/hhchannel.xml
@@ -1,5 +1,4 @@
-
@@ -7,7 +6,6 @@
-
@@ -16,49 +14,42 @@
-
-
+
-
-
-
-
+
-
-
+
-
+
-
-
@@ -68,7 +59,4 @@
-
-
-
diff --git a/examples/hhmodels.xml b/examples/hhmodels.xml
index 60c3685..770bbe9 100644
--- a/examples/hhmodels.xml
+++ b/examples/hhmodels.xml
@@ -1,29 +1,25 @@
-
+
-
-
-
-
-
\ No newline at end of file
+
diff --git a/examples/misciaf.xml b/examples/misciaf.xml
index 6899cae..10ea7f2 100644
--- a/examples/misciaf.xml
+++ b/examples/misciaf.xml
@@ -1,7 +1,5 @@
-
-
@@ -9,24 +7,18 @@
-
-
-
-
+
-
-
-
-
\ No newline at end of file
+
diff --git a/examples/spikegenerators.xml b/examples/spikegenerators.xml
index dd8db3f..6c0d8da 100644
--- a/examples/spikegenerators.xml
+++ b/examples/spikegenerators.xml
@@ -1,7 +1,5 @@
-
-
@@ -17,7 +15,6 @@
-
@@ -28,6 +25,4 @@
-
-
-
\ No newline at end of file
+
From 538c7a6f1b7a67e95228f7e05f8f67f141ac1b1d Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 20 Aug 2024 14:59:09 +0100
Subject: [PATCH 16/16] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 09cff66..8e0467d 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
[![Documentation Status](https://readthedocs.org/projects/pylems/badge/?version=latest)](https://pylems.readthedocs.io/en/latest/?badge=latest)
[![PyPI](https://img.shields.io/pypi/v/pylems)](https://pypi.org/project/pylems/)
-A LEMS (http://lems.github.io/LEMS) simulator written in Python which can be used to run NeuroML2 models (see [here](https://docs.neuroml.org/Userdocs/Software/pyLEMS.html)).
+A [LEMS](http://lems.github.io/LEMS) simulator written in Python which can be used to run NeuroML2 models (see [here](https://docs.neuroml.org/Userdocs/Software/pyLEMS.html)).
For more about PyLEMS see: