diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c2b4af..5edd90b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,14 +16,19 @@ jobs: strategy: fail-fast: false matrix: - java: [ '8', '11', '16', '17', '19'] - runs-on: [ubuntu-latest, macos-latest, windows-2019] + java: [ '8', '11', '16', '17', '19', '21' ] + runs-on: [ubuntu-latest, macos-12, windows-2019] # Note macos-12, not latest/14, due to hdf5 install issue + exclude: + - runs-on: macos-latest + java: "8" + - runs-on: macos-latest + java: "16" name: Test on Java ${{ matrix.Java }} on ${{ matrix.runs-on }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.Java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.Java }} distribution: 'temurin' @@ -117,3 +122,14 @@ jobs: pwd mvn install mvn dependency:tree + + + - name: Run SBML test suite + if: ${{ matrix.runs-on == 'ubuntu-latest' }} + run: | + git clone https://github.com/sbmlteam/sbml-test-suite.git + + mvn assembly:assembly -DdescriptorId=jar-with-dependencies + + java -Xmx400M -classpath target/*jar-with-dependencies.jar org.neuroml.importer.sbml.SBMLImporter -runSBMLTestSuite + diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 92767ba..eaa977b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,17 +13,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: nelonoel/branch-name@v1.0.1 - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 java-package: jdk + distribution: 'temurin' - name: Set up Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 @@ -33,14 +34,14 @@ jobs: pip install ghp-import - name: Checkout NeuroML2 - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: NeuroML/NeuroML2 ref: development path: NeuroML2 - name: Checkout org.lemsml - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: LEMS/jLEMS ref: development @@ -54,14 +55,14 @@ jobs: path: org.neuroml.model.injectingplugin - name: Checkout org.neuroml.model - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: NeuroML/org.neuroml.model ref: development path: org.neuroml.model - name: Checkout org.neuroml.export - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: NeuroML/org.neuroml.export ref: development diff --git a/.gitignore b/.gitignore index 02e8b1a..0d28bfc 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ src/test/resources/tmp biomodels Errors.txt +/sbml-test-suite/ diff --git a/pom.xml b/pom.xml index 1ec1952..c548b4a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.neuroml.import org.neuroml.import jar - 1.9.1 + 1.10.1 org.neuroml.import http://maven.apache.org @@ -29,7 +29,7 @@ org.neuroml.export org.neuroml.export - 1.9.1 + 1.10.1 @@ -71,15 +71,15 @@ <br /> <br /> - Copyright NeuroML Contributors 2023 + Copyright NeuroML Contributors 2024 maven-compiler-plugin 3.0 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/runSBMLTestSuite.sh b/runSBMLTestSuite.sh index 50bcc1f..6ce41ee 100755 --- a/runSBMLTestSuite.sh +++ b/runSBMLTestSuite.sh @@ -1,13 +1,12 @@ #!/bin/bash -if [ ! -d "sbmlTestSuite" ]; then +if [ ! -d "sbml-test-suite" ]; then echo "" - echo "A copy of the SBML Test Suite needs to be checked out from Sourceforge. Try:" + echo "A copy of the SBML Test Suite needs to be checked out from GitHub. Try:" echo "" - echo " mkdir sbmlTestSuite" - echo " svn checkout https://svn.code.sf.net/p/sbml/code/trunk/test-suite/cases sbmlTestSuite/cases" + echo " git clone https://github.com/sbmlteam/sbml-test-suite.git" echo "" exit 1 diff --git a/src/main/java/org/neuroml/importer/Main.java b/src/main/java/org/neuroml/importer/Main.java index f2b3baa..a465b67 100644 --- a/src/main/java/org/neuroml/importer/Main.java +++ b/src/main/java/org/neuroml/importer/Main.java @@ -4,5 +4,5 @@ public class Main { - public static String ORG_NEUROML_IMPORT_VERSION = "1.9.1"; + public static String ORG_NEUROML_IMPORT_VERSION = "1.10.1"; } diff --git a/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java b/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java index 60c21c1..59f96b5 100644 --- a/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java +++ b/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java @@ -314,6 +314,11 @@ public static Lems convertSBMLToLEMS(File sbmlFile, float simDuration, float sim newDim.setN(newDim.getN() + exponent * 1); } else if (kind.equals("second")) { newDim.setT(newDim.getT() + exponent * 1); + } else if (kind.equals("volt")) { + newDim.setM(newDim.getM() + exponent * 1); + newDim.setL(newDim.getL() + exponent * 2); + newDim.setT(newDim.getT() + exponent * -3); + newDim.setI(newDim.getI() + exponent * -1); } else { //TODO: Add all unit kinds from section 4.4.2 in SBML specs: http://sbml.org/Documents/Specifications System.err.print("Add more unit definitions! Missing: "+kind); @@ -831,7 +836,7 @@ else if (r.isAssignment()) { E.info(">>>> StateVariable "+sv); dyn.stateVariables.add(sv); - TimeDerivative td = new TimeDerivative(sv.getName(), "1"); + TimeDerivative td = new TimeDerivative(sv.getName(), timeScale.getName() + "* 1"); dyn.timeDerivatives.add(td); } @@ -1209,7 +1214,7 @@ public static void main(String[] args) throws Exception - File sbmlTestSuiteDir = new File("sbmlTestSuite/cases/semantic/"); + File sbmlTestSuiteDir = new File("sbml-test-suite/cases/semantic/"); boolean useSbmlTestSuite = sbmlTestSuiteDir.exists() && forceSBMLTestSuite; @@ -1292,7 +1297,7 @@ public static void main(String[] args) throws Exception while(testCase.length()<5) testCase ="0"+testCase; - sbmlFile = new File("sbmlTestSuite/cases/semantic/"+testCase+"/"+testCase+"-sbml-"+version+".xml"); + sbmlFile = new File("sbml-test-suite/cases/semantic/"+testCase+"/"+testCase+"-sbml-"+version+".xml"); if (!sbmlFile.exists()){ E.info(" ---- File not found: "+sbmlFile.getAbsolutePath()+"!! ---- \n\n"); notFound++;