Skip to content

Commit 09b25eb

Browse files
authored
Merge pull request #124 from LEMS/development
Changes for NeuroML v2.3.1 release
2 parents f6c98c2 + 069a8d1 commit 09b25eb

31 files changed

+274
-595
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,23 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
java: [ '8', '11', '16', '17', '19' ]
19+
java: [ '8', '11', '16', '17', '19', '21' ]
2020
runs-on: [ubuntu-latest, macos-latest, windows-latest]
21+
exclude:
22+
- runs-on: macos-latest
23+
java: "8"
24+
- runs-on: macos-latest
25+
java: "16"
26+
2127

2228
name: Test on Java ${{ matrix.Java }} on ${{ matrix.runs-on }}
2329
steps:
24-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
2531
- name: Set up JDK ${{ matrix.Java }}
26-
uses: actions/setup-java@v2
32+
uses: actions/setup-java@v4
2733
with:
2834
java-version: ${{ matrix.Java }}
29-
distribution: 'adopt'
35+
distribution: 'temurin'
3036
- name: Test with Maven
3137
run: mvn install
3238
- name: Further tests, non Win

.github/workflows/examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
- uses: nelonoel/[email protected]
1515

1616
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
@@ -20,7 +20,7 @@ jobs:
2020
id: extract_branch
2121

2222
- name: Checkout lems
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2424
with:
2525
repository: LEMS/LEMS
2626
ref: ${{ steps.extract_branch.outputs.branch }}

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<javac srcdir="src"
4343
destdir="build"
4444
debug="true"
45-
source="1.6"
46-
target="1.6"
45+
source="1.8"
46+
target="1.8"
4747
includeantruntime="false"
4848
classpathref="junit.classpath">
4949
<include name="**/*.java"/>

lems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
export LEMS_VERSION=0.10.8
3+
export LEMS_VERSION=0.11.1
44

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

lems.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22

3-
set LEMS_VERSION=0.10.8
3+
set LEMS_VERSION=0.11.1
44

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

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.lemsml</groupId>
55
<artifactId>jlems</artifactId>
6-
<version>0.10.8</version>
6+
<version>0.11.1</version>
77
<packaging>bundle</packaging>
88
<properties>
99
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -29,8 +29,8 @@
2929
<artifactId>maven-compiler-plugin</artifactId>
3030
<version>3.0</version>
3131
<configuration>
32-
<source>1.7</source>
33-
<target>1.7</target>
32+
<source>1.8</source>
33+
<target>1.8</target>
3434
</configuration>
3535
</plugin>
3636
<plugin>

src/main/java/org/lemsml/jlems/core/run/StateInstance.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ public void advance(StateRunnable parent, double t, double dt) throws RuntimeErr
300300

301301

302302
public void transitionTo(String rnm) throws RuntimeError {
303+
if (regimeHM == null) {
304+
throw new IllegalStateException("No Regimes.");
305+
}
303306
activeRegime = regimeHM.get(rnm);
304307
activeRegime.enter();
305308
}
@@ -314,6 +317,9 @@ public void doneInit() {
314317

315318
public void initRegime() throws RuntimeError {
316319
if (activeRegime == null) {
320+
if (regimeHM == null || regimeHM.isEmpty()) {
321+
throw new IllegalStateException("No Regimes.");
322+
}
317323
activeRegime = regimeHM.get(regimeHM.keySet().iterator().next());
318324
// TODO just picks random regime
319325
}

src/main/java/org/lemsml/jlems/core/type/dynamics/AbstractStateChange.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ public void checkDimensions(HashMap<String, Dimensional> dimHM) throws ContentEr
9090
if (dres.isDimensionless()) {
9191
// OK
9292
} else {
93-
E.oneLineError("Dimension mismatch in equation: " + variable + " = " + value + ". Residual dimension: " + dres);
94-
E.info("Dimension of " + variable + ": " + dsv + ", multiplier=" + dlf + ", left=" + dl + ", rhs=" + drhs);
95-
E.info("All:" + dimHM);
93+
94+
String errmsg = ("Dimension mismatch in the equation: " + variable + " = " + value + ". Residual dimension: " + dres +
95+
"\nDimension of " + variable + ": " + dsv + ", multiplier=" + dlf + ", left=" + dl + ", rhs=" + drhs +
96+
"\nAll:" + dimHM);
97+
E.info(errmsg);
98+
throw new ContentError(errmsg);
9699
}
97100
}
98101

src/main/java/org/lemsml/jlems/core/type/dynamics/Dynamics.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ public Valued getValued(String select) throws ContentError {
525525

526526

527527

528-
public void checkEquations(HashMap<String, Dimensional> cdimHM) throws ContentError {
528+
public void checkEquations(HashMap<String, Dimensional> cdimHM) throws ContentError{
529529

530530
HashMap<String, Dimensional> dimHM = new HashMap<String, Dimensional>();
531531

@@ -559,15 +559,18 @@ public void checkEquations(HashMap<String, Dimensional> cdimHM) throws ContentEr
559559
try {
560560
dimHM.put(dv.getName(), dv.getDimensionality(dimHM));
561561
} catch (ContentError ce) {
562-
E.error("Checking " + dv + " in " + r_type + " " + ce.getMessage());
562+
String errmsg = ("Checking derived variable: " + dv + " in " + r_type + "\nError here: " + ce.getMessage());
563+
E.error(errmsg+"\n**************\n* Note: this may not be a serious error, in the case that the derived variables are all present, just have been specified out of order, e.g. b = f(a) is defined in the xML file before a is defined. ");
564+
563565
}
564566
}
565567

566568
for (ConditionalDerivedVariable cdv : conditionalDerivedVariables) {
567569
try {
568570
dimHM.put(cdv.getName(), cdv.getDimensionality(dimHM));
569571
} catch (ContentError ce) {
570-
E.error("Checking " + cdv + " in " + r_type + " " + ce.getMessage());
572+
String errmsg = "Checking " + cdv + " in " + r_type + " " + ce.getMessage();
573+
throw new ContentError(errmsg);
571574
}
572575
}
573576

0 commit comments

Comments
 (0)