Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for NML v2.3 #112

Merged
merged 56 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7655f49
Merge pull request #96 from sanjayankur31/fix/pyneuroml-100
pgleeson Jun 25, 2021
86b8296
Merge branch 'development' into experimental
pgleeson Sep 7, 2021
9b01dcd
Temporarily reverting to v0.10.3 in experimental
pgleeson Sep 7, 2021
744fd15
Merge pull request #98 from LEMS/development
pgleeson Nov 10, 2021
a24c337
Update examples.yml
pgleeson Nov 10, 2021
dfffebe
Merge branch 'master' into experimental
pgleeson May 12, 2022
03c4366
To v0.10.7
pgleeson May 12, 2022
6a1ca7b
Merge branch 'master' into development
pgleeson Jun 9, 2022
a071c6a
Merge branch 'development' into experimental
pgleeson Jun 9, 2022
b0a1486
Merge branch 'master' into development
pgleeson Aug 1, 2022
12a8e8e
Merge branch 'development' into experimental
pgleeson Aug 5, 2022
13c3e2f
feat(ioutil): add method to generate complete report file name
sanjayankur31 Nov 17, 2022
c6f4c6b
feat(ioutil): update method to use complete report file name
sanjayankur31 Nov 17, 2022
c4fd8c8
feat(ioutil): add argument to permit setting timestamp format
sanjayankur31 Nov 17, 2022
eae4093
Merge pull request #105 from LEMS/feat/report-file-tweaks
pgleeson Nov 22, 2022
1107bbc
Test on java 19
Feb 22, 2023
45165e4
Merge pull request #106 from LEMS/experimental
pgleeson Feb 22, 2023
50baecc
Remove warning
pgleeson Apr 4, 2023
146f06e
Tweak to test lems doc generation
pgleeson Apr 28, 2023
2d9cb63
Remove some warnings
pgleeson May 2, 2023
089b003
docs(parameter): update
sanjayankur31 May 2, 2023
3ab71c7
docs(ExpressionValued): document `value`
sanjayankur31 May 2, 2023
9fa7abe
docs(DerivedParameter): update
sanjayankur31 May 2, 2023
9ab482f
docs(Text): update
sanjayankur31 May 2, 2023
b0f9f72
docs(Exposure): update
sanjayankur31 May 2, 2023
c6c24c9
docs(Requirement): update
sanjayankur31 May 2, 2023
af520b1
docs(Children): update
sanjayankur31 May 2, 2023
7464d3b
docs(Child): update
sanjayankur31 May 2, 2023
97a2115
docs(ComponentReference): update
sanjayankur31 May 2, 2023
a0ec298
docs(Attachments): update
sanjayankur31 May 2, 2023
513b817
docs(EventPort): update
sanjayankur31 May 2, 2023
43a8862
docs(StateVariable): update
sanjayankur31 May 2, 2023
2009bb9
docs(DerivedVariable): update
sanjayankur31 May 2, 2023
eadbc88
docs(TimeDerivative): update
sanjayankur31 May 2, 2023
2ee2219
docs(Regime): add
sanjayankur31 May 2, 2023
30e145a
docs(KineticScheme): update
sanjayankur31 May 2, 2023
fe9106d
feat!: add `BuildElement` to structure LEMS classes
sanjayankur31 May 2, 2023
ee591fe
docs(BuildElement): add
sanjayankur31 May 2, 2023
e75e63e
docs(Structure): add
sanjayankur31 May 2, 2023
12943bd
docs(Dynamics): update
sanjayankur31 May 2, 2023
2ed3791
Merge pull request #110 from LEMS/feat/ankur-doc-updates
pgleeson May 2, 2023
3a9f871
chore(LemsClasses): remove `Component` from `unitsdimensions`
sanjayankur31 May 3, 2023
afb18cc
Merge pull request #111 from LEMS/feat/remove-component-from-units-di…
pgleeson May 3, 2023
a7a7b86
Merge branch 'master' into development
pgleeson May 3, 2023
901790c
feat: annotate `Meta`
sanjayankur31 Aug 22, 2023
a40a8a8
chore: remove extra white space
sanjayankur31 Aug 22, 2023
aa7fb2a
Merge pull request #113 from LEMS/feat/annotate-meta
pgleeson Aug 23, 2023
4d3216a
feat(factory-generator): add additional import
sanjayankur31 Aug 23, 2023
b60302b
feat(lems-factory): regenerated
sanjayankur31 Aug 23, 2023
de661bc
feat(simulation): add meta as children element
sanjayankur31 Aug 23, 2023
8079267
feat(lems-classes): remove abstract class
sanjayankur31 Aug 23, 2023
e232990
feat(lems-classes): add `Component` to list
sanjayankur31 Aug 23, 2023
ef30e87
Merge pull request #114 from LEMS/feat/annotate-meta
pgleeson Sep 8, 2023
2ca3860
Merge pull request #115 from LEMS/experimental
pgleeson Sep 11, 2023
2bf5da3
To v0.10.8
pgleeson Sep 20, 2023
f7f95ee
Merge pull request #116 from LEMS/experimental
pgleeson Sep 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ '8', '11', '16', '17' ]
runs-on: [ubuntu-latest, macos-11, windows-latest]
java: [ '8', '11', '16', '17', '19' ]
runs-on: [ubuntu-latest, macos-latest, windows-latest]

name: Test on Java ${{ matrix.Java }} on ${{ matrix.runs-on }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check LEMS examples

on:
push:
branches: [ master, development, experimental ]
branches: [ master, development ]

jobs:
verify:
Expand Down
2 changes: 1 addition & 1 deletion lems
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

export LEMS_VERSION=0.10.6
export LEMS_VERSION=0.10.8

export CLASSPATH=.:./target/jlems-$LEMS_VERSION.jar:$LEMS_HOME/target/jlems-$LEMS_VERSION.jar

Expand Down
2 changes: 1 addition & 1 deletion lems.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off

set LEMS_VERSION=0.10.6
set LEMS_VERSION=0.10.8

set CLASSPATH=target\jlems-%LEMS_VERSION%.jar;%LEMS_HOME%\target\jlems-%LEMS_VERSION%.jar

Expand Down
11 changes: 5 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.lemsml</groupId>
<artifactId>jlems</artifactId>
<version>0.10.6</version>
<packaging>bundle</packaging>
<version>0.10.8</version>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -34,10 +37,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/org/lemsml/jlems/core/reader/LemsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.lemsml.jlems.core.type.dynamics.*;
import org.lemsml.jlems.core.type.structure.*;
import org.lemsml.jlems.core.type.simulation.Record;

import org.lemsml.jlems.core.type.simulation.*;

import org.lemsml.jlems.core.type.procedure.*;
Expand Down Expand Up @@ -764,10 +765,10 @@ private Child buildChild(XMLElement xel) {
ret.name = parseString(xv);
} else if (xn.equals("type")) {
ret.type = parseString(xv);
} else if (xn.equals("description")) {
ret.description = parseString(xv);
} else if (xn.equals("substitute")) {
ret.substitute = parseString(xv);
} else if (xn.equals("description")) {
ret.description = parseString(xv);
} else {
E.warning("Unrecognized attribute " + xa + " " + xv);
}
Expand Down Expand Up @@ -810,6 +811,8 @@ private Link buildLink(XMLElement xel) {
ret.name = parseString(xv);
} else if (xn.equals("type")) {
ret.type = parseString(xv);
} else if (xn.equals("description")) {
ret.description = parseString(xv);
} else if (xn.equals("root")) {
ret.root = parseString(xv);
} else if (xn.equals("isAny")) {
Expand Down Expand Up @@ -2423,6 +2426,8 @@ private Simulation buildSimulation(XMLElement xel) {
ret.dataWriters.add((DataWriter)obj);
} else if (obj instanceof EventWriter) {
ret.eventWriters.add((EventWriter)obj);
} else if (obj instanceof Meta) {
ret.metas.add((Meta)obj);
} else {
E.warning("Unrecognized element ("+xn+"): " + cel);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/lemsml/jlems/core/type/Attachments.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"and access purposes they are like child components. The cannonical use of attachments is in " +
"adding synapses to a cell when a network connection is made.")
public class Attachments implements Named {
@ModelProperty(info="")
@ModelProperty(info="A name for the Attachments")
public String name;
@ModelProperty(info="")
@ModelProperty(info="The type of the Attachments")
public String type;
public ComponentType r_type;

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/lemsml/jlems/core/type/Child.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"children of the same type but with different roles, such as the forward and reverse transition rates in a channel.")
public class Child implements Named {

@ModelProperty(info="")
@ModelProperty(info="Name of the child")
public String name;

@ModelProperty(info="Reference to a component class, the value should be the name of the target class.")
Expand All @@ -20,6 +20,7 @@ public class Child implements Named {

public String substitute;

@ModelProperty(info="An optional description of the child")
public String description;


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/lemsml/jlems/core/type/Children.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"child components")
public class Children implements Named {

@ModelProperty(info="")
@ModelProperty(info="Name of the children")
public String name;

@ModelProperty(info="The class of component allowed as children.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"same way as a child component, but can be defined independently")
public class ComponentReference implements Named {

@ModelProperty(info="")
@ModelProperty(info="A name for the ComponentReference")
public String name;

@ModelProperty(info="Target type")
@ModelProperty(info="The type of the target Component")
public String type;
@ModelProperty(info="An optional description of the ComponentReference")
public String description;
public ComponentType r_type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.lemsml.jlems.core.type.structure.Structure;
import org.lemsml.jlems.core.xml.XMLElement;

@ModelElement(info="Root element for defining component types.")
@ModelElement(info="Root element for defining LEMS Component Types.")

@SuppressWarnings("StringConcatenationInsideStringBufferAppend")
public class ComponentType extends Base implements Named, Summaried, Inheritor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.lemsml.jlems.core.sim.ContentError;
import org.lemsml.jlems.core.type.dynamics.ExpressionValued;

@ModelElement(info="A parameter that comes from other parameter values in the model rather than being set explicitly. Its value " +
@ModelElement(info="A parameter that is a function of the Component's Parameters, which does not change with time. Its value " +
"can be supplied either with the 'value' attribute that evaluates within the scope of the definition, or with the " +
"'select' attribute which gives a path to 'primary' version of the parameter. For example, " +
" setting select='//MembranePotential[species=channel/species]/reversal' within the appropriate context allows " +
Expand All @@ -15,8 +15,13 @@

public class DerivedParameter extends ExpressionValued implements Named {

@ModelProperty(info="The name of the derived parameter")
public String name;

@ModelProperty(info="The dimension, or 'none'. This should be the name of an already defined dimension element")
public String dimension;

@ModelProperty(info="An optional description of the derived parameter")
public String description;
public Dimension r_dimension;

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/lemsml/jlems/core/type/EventPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import org.lemsml.jlems.core.logging.E;
import org.lemsml.jlems.core.sim.ContentError;

@ModelElement(info = "A port on a component that can send or receive events, depending on the direction speicfied.")
@ModelElement(info = "A port on a component that can send or receive events, depending on the direction specified")

public class EventPort implements Named {

@ModelProperty(info = "")
@ModelProperty(info = "Name of the EventPort")
public String name;
@ModelProperty(info = "'IN' or 'OUT'")
public String direction;
@ModelProperty(info="An optional description of the EventPort")
public String description;

public Dimension r_dimension;
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/lemsml/jlems/core/type/Exposure.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
import org.lemsml.jlems.core.logging.E;
import org.lemsml.jlems.core.sim.ContentError;

@ModelElement(info = "A quantity that is made available to other component in the simulation. All variables in a Dynamics "
+ "definition are private. If other components need access to them then the definition has to explicitly link them "
@ModelElement(info = "A quantity that is made available to other components in the simulation. Note that all variables in a Dynamics "
+ "definition are private. If other components need access to them, then the definition should explicitly link them "
+ "to an exposure defined in the component class")
public class Exposure implements Named {

@ModelProperty(info = "name")
@ModelProperty(info = "Name of the exposure element")
public String name;
@ModelProperty(info = "Reference to a dimension")
@ModelProperty(info="The dimension, or 'none'. This should be the name of an already defined dimension element")
public String dimension;
@ModelProperty(info="An optional description of the element")
public String description;
public Dimension r_dimension;

Expand Down
26 changes: 14 additions & 12 deletions src/main/java/org/lemsml/jlems/core/type/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,36 @@
import java.util.ArrayList;
import java.util.HashMap;

import org.lemsml.jlems.core.annotation.ModelElement;
import org.lemsml.jlems.core.sim.ContentError;
import org.lemsml.jlems.core.xml.XMLAttribute;
import org.lemsml.jlems.core.xml.XMLElement;


// RawValued indicates that XML found inside Meta elements should be treated

// RawValued indicates that XML found inside Meta elements should be treated
// processed into an element tree, but not interpreted as lems elements.
// other tools can do their own thing with the content
@ModelElement(info="Meta element to provide arbitrary metadata to LEMS simulations. Note that this is not processed by the LEMS interpreter.")
public class Meta {

public String context;

public XMLElement valueWrapper = new XMLElement("wrapper");

private XMLElement p_sourceXML;

public ArrayList<MetaItem> items = new ArrayList<MetaItem>();



public Meta() {

}

public void setSource(XMLElement xe) {
p_sourceXML = xe;
}

public void addXMLElement(XMLElement xe) {
valueWrapper.add(xe);
// E.info("Set VW " + xe.toXMLString(""));
Expand All @@ -45,15 +47,15 @@ public HashMap<String, String> getAttributes() {
}
return ret;
}


public void add(Object obj) throws ContentError {
if (obj instanceof MetaItem) {
items.add((MetaItem)obj);
} else {
throw new ContentError("cant add " + obj);
}
}
}

public MetaItem newItem(String nm) {
MetaItem ret = new MetaItem(nm);
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/lemsml/jlems/core/type/Parameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
import org.lemsml.jlems.core.logging.E;
import org.lemsml.jlems.core.sim.ContentError;

@ModelElement(info = "Sets the name an dimensionality of a parameter that must be supplied when a component is defined "
+ "curresponding to the enclosing ComponentType")
@ModelElement(info = "A quantity, defined by name and dimension, that must be supplied when a Component of the "
+ "enclosing ComponentType is defined")
public class Parameter implements Named {

@ModelProperty(info="The name of the parameter. This is the attibute name when the parameter is supplied in a component definition")
@ModelProperty(info="The name of the parameter. This is the name of the attribute to be used when the parameter is supplied in a component definition")
public String name;

@ModelProperty(info="The dimension, or 'none'. This should be the ID of a dimension element defined elsewhere")
@ModelProperty(info="The dimension, or 'none'. This should be the name of an already defined dimension element")
public String dimension;

public Dimension r_dimension;

@ModelProperty(info="An optional description of the parameter")
public String description;

public String exposure;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/lemsml/jlems/core/type/Requirement.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ public class Requirement implements Named {
@ModelProperty(info = "name")
public String name;

@ModelProperty(info = "reference to a dimension")
@ModelProperty(info="The dimension, or 'none'. This should be the name of an already defined dimension element")
public String dimension;
public Dimension r_dimension;

@ModelProperty(info="An optional description of the requirement")
public String description;


Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/lemsml/jlems/core/type/Text.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
@ModelElement(info="Holds textual information that does not change the model but is needed for other purposes such as " +
"labelling graphs.")
public class Text implements Named {
@ModelProperty(info="")
@ModelProperty(info="The textual content")
public String name;

@ModelProperty(info="An optional description of the element")
public String description;

public Text() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
import org.lemsml.jlems.core.sim.ContentError;
import org.lemsml.jlems.core.type.Dimension;
import org.lemsml.jlems.core.type.LemsCollection;
import org.lemsml.jlems.core.annotation.ModelProperty;

public abstract class AbstractStateChange extends ExpressionValued {

@ModelProperty(info="The name of the variable")
public String variable;

private StateVariable r_variable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@
import org.lemsml.jlems.core.type.LemsCollection;

@ModelElement(info="A quantity that depends algebraically on other quantities in the model. The 'value' field can be " +
"set to a mathematical expression, or the select field to a path expression. If the path expression " +
"set to a mathematical expression, or the 'select' field to a path expression. If the path expression " +
"produces multiple matches, then the 'reduce' field says how these are reduced to a single value by " +
"taking the sum or product. ")
public class DerivedVariable extends ExpressionValued implements Valued {

@ModelProperty(info="")
@ModelProperty(info="Name of the derived variable")
public String name;

@ModelProperty(info="")
@ModelProperty(info="A path to the variable that supplies the value. Note that to select a variable from another component, the variable must be marked as an Exposure. Exactly one of 'select' and 'value' is required")
public String select;

@ModelProperty(info="")
@ModelProperty(info="The dimension, or 'none'. This should be the name of an already defined dimension element")
public String dimension;
public Dimension r_dimension;

@ModelProperty(info="An optional description of the derived variable")
public String description;

@ModelProperty(info="Either 'add' or 'multiply'. This applies if ther are multiple " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
import org.lemsml.jlems.core.type.Requirement;


@ModelElement(info="Specifies the dynamical behavior of components build from this ComponentType. ")
@ModelElement(info="Specifies the dynamical behavior of components build from this ComponentType. "
+ "Note that all variables in a Dynamics "
+ "definition are private. If other components need access to them, then the definition should explicitly link them "
+ "to an Exposure defined in the component class"
)
public class Dynamics {

public String name;
Expand Down
Loading
Loading