From b603808a48e20377bc029efa98bd91187d4ae984 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Thu, 5 Dec 2019 18:52:41 +0000
Subject: [PATCH 01/24] Test other jdks
---
.travis.yml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 6af332a..49c18a4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,10 +4,11 @@ sudo: false
language: java
jdk:
- - openjdk7
+ - oraclejdk11
+
- openjdk8
- - oraclejdk8
- # - oraclejdk9
+ - openjdk10
+ - openjdk11
install:
- export main_repo_branch=$TRAVIS_BRANCH
From 3ab3db5575b686b1c9935d3c8ed021a1d1d0782a Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Thu, 5 Dec 2019 19:14:16 +0000
Subject: [PATCH 02/24] Ensure runs on xenial
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 49c18a4..784621e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-dist: trusty
+dist: xenial
sudo: false
language: java
From e01586c9b895f171815bff9a5bb04acbc79c6a98 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 28 Apr 2020 16:01:59 +0100
Subject: [PATCH 03/24] To v0.10.0 for NMLv2.1
---
jnml | 2 +-
jnml.bat | 2 +-
pom.xml | 6 +++---
src/main/java/org/neuroml/JNeuroML.java | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/jnml b/jnml
index fed6b95..62b680c 100755
--- a/jnml
+++ b/jnml
@@ -5,7 +5,7 @@
# Type java -X for more info
export JNML_MAX_MEMORY=400M
-export JNML_VERSION=0.9.1
+export JNML_VERSION=0.10.0
export CLASSPATH=.:./target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar:$JNML_HOME/target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar
diff --git a/jnml.bat b/jnml.bat
index 60b00c4..f41e0d9 100644
--- a/jnml.bat
+++ b/jnml.bat
@@ -1,6 +1,6 @@
@echo off
-set JNML_VERSION=0.9.1
+set JNML_VERSION=0.10.0
set CLASSPATH=target\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar;%JNML_HOME%\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar
diff --git a/pom.xml b/pom.xml
index bba0fc8..deb9d6b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.neuroml
jNeuroML
- 0.9.1
+ 0.10.0
jar
jNeuroML
@@ -24,12 +24,12 @@
org.neuroml1.model
org.neuroml1.model
- 1.6.1
+ 1.7.0
org.neuroml.import
org.neuroml.import
- 1.6.1
+ 1.7.0
diff --git a/src/main/java/org/neuroml/JNeuroML.java b/src/main/java/org/neuroml/JNeuroML.java
index c934a37..fdbeb92 100644
--- a/src/main/java/org/neuroml/JNeuroML.java
+++ b/src/main/java/org/neuroml/JNeuroML.java
@@ -59,7 +59,7 @@ public class JNeuroML
public static final String JNML_SCRIPT = "jnml";
- public static final String JNML_VERSION = "0.9.1";
+ public static final String JNML_VERSION = "0.10.0";
public static final String HELP_FLAG = "-help";
public static final String HELP_FLAG_SHORT = "-h";
From 0393fa0e8948b1cc05fe2257bc3f8e5e09b0ff91 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 28 Apr 2020 19:13:07 +0100
Subject: [PATCH 04/24] Remove openjdk10
---
.travis.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 784621e..aea7c16 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,4 @@
dist: xenial
-sudo: false
language: java
@@ -7,7 +6,7 @@ jdk:
- oraclejdk11
- openjdk8
- - openjdk10
+ #- openjdk10 # Some non deterministic recurring error with jdk10...
- openjdk11
install:
From 4081185185a24440d84998ecaf8eaabd8de354b4 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Sat, 20 Jun 2020 20:10:56 +0100
Subject: [PATCH 05/24] Whitespace fixes
---
getNeuroML.py | 53 ++++++++++++++++++++++-----------------------------
1 file changed, 23 insertions(+), 30 deletions(-)
diff --git a/getNeuroML.py b/getNeuroML.py
index d55ba1a..de331c7 100644
--- a/getNeuroML.py
+++ b/getNeuroML.py
@@ -5,6 +5,7 @@
import os.path as op
import subprocess
+
def main():
"""Main"""
mode = "update"
@@ -50,9 +51,7 @@ def main():
# Which repos use a development branch?
dev_branch_repos = neuroml2_spec_repo + neuroml_repos + jlems_repo
-
- all_repos = lems_repos + neuroml_repos
-
+ all_repos = lems_repos + neuroml_repos
# Set the preferred method for cloning from GitHub
github_pref = "HTTP"
@@ -69,22 +68,21 @@ def main():
local_dir = ".." + os.sep + repo.split("/")[1]
if mode is "clean":
- print("------ Cleaning: %s -------"%repo)
+ print("------ Cleaning: %s -------" % repo)
if repo in java_repos:
command = "mvn clean"
print("It's a Java repository, so cleaning using Maven...")
info = execute_command_in_dir(command, local_dir)
if mode is "update":
-
- print("------ Updating: %s -------" %repo)
+ print("------ Updating: %s -------" % repo)
runMvnInstall = False
if not op.isdir(local_dir):
command = "git clone %s%s" % (pre_gh[github_pref], repo)
- print ("Creating a new directory: %s by cloning from GitHub" % \
- (local_dir))
+ print("Creating a new directory: %s by cloning from GitHub" %
+ (local_dir))
execute_command_in_dir(command, "..")
runMvnInstall = True
@@ -92,7 +90,7 @@ def main():
if switch_to_branch:
if (repo in dev_branch_repos):
command = "git checkout %s" % (switch_to_branch)
- print ("Switching to branch: %s" % (switch_to_branch))
+ print("Switching to branch: %s" % (switch_to_branch))
exit_on_fail = switch_to_branch is not "experimental"
execute_command_in_dir(command, local_dir, exit_on_fail)
runMvnInstall = True
@@ -112,36 +110,31 @@ def main():
print("It's a Java repository, so installing using Maven...")
info = execute_command_in_dir(command, local_dir)
- #The code below needs a non trivial rewrite due to python3 differences.
-
- #
+ # The code below needs a non trivial rewrite due to python3 differences.
if str("BUILD SUCCESS") in str(info):
- print("Successful installation using : %s!" %command)
+ print("Successful installation using : %s!" % command)
else:
- print("Problem installing using : %s!" %command)
+ print("Problem installing using : %s!" % command)
print(info)
exit(1)
if mode is "update":
print("All repositories successfully updated & Java modules built!")
- print("You should be able to run some examples straight " \
- "away using jnml: ")
+ print("You should be able to run some examples straight away using jnml: ")
if os.name is not 'nt':
- print(" ./jnml "\
- "-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
- print(" ./jnml " \
- "../NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml")
+ print(" ./jnml " +
+ "-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
+ print(" ./jnml " +
+ "../NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml")
else:
- print(" jnml -validate " \
- "..\\NeuroML2\\examples\\NML2_FullNeuroML.nml")
- print(" jnml " \
- "..\\NeuroML2\\LEMSexamples\\LEMS_NML2_Ex2_Izh.xml")
+ print(" jnml -validate " +
+ "..\\NeuroML2\\examples\\NML2_FullNeuroML.nml")
+ print(" jnml " +
+ "..\\NeuroML2\\LEMSexamples\\LEMS_NML2_Ex2_Izh.xml")
if mode is "clean":
print("All repositories successfully cleaned!")
-
-
def execute_command_in_dir(command, directory, exit_on_fail=True):
"""Execute a command in specific working directory"""
if os.name == 'nt':
@@ -152,10 +145,10 @@ def execute_command_in_dir(command, directory, exit_on_fail=True):
p = subprocess.Popen(command, cwd=directory, shell=True, stdout=subprocess.PIPE)
return_str = p.communicate()
- if p.returncode != 0:
- print("Error: %s" % p.returncode)
+ if p.returncode != 0:
+ print("Error: %s" % p.returncode)
print(return_str[0])
- if exit_on_fail:
+ if exit_on_fail:
exit(p.returncode)
if (sys.version_info > (3, 0)):
return return_str[0].decode("utf-8")
@@ -167,7 +160,7 @@ def help_info():
print("\nUsage:\n\n python getNeuroML.py\n " \
"Pull (or clone) the latest version of all NeuroML 2 repos & " \
"compile/install with Maven if applicable\n\n" \
- " python getNeuroML.py clean\n "
+ " python getNeuroML.py clean\n "
"Run 'mvn clean' on all Java repos\n\n" \
" python getNeuroML.py master\n " \
"Switch all repos to master branch\n\n" \
From d1346e4f3cc694cee97d0727a81a707546276784 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Sat, 20 Jun 2020 20:12:29 +0100
Subject: [PATCH 06/24] Use equality operators for comparison instead of 'is/is
not'
---
getNeuroML.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/getNeuroML.py b/getNeuroML.py
index de331c7..bdb0a01 100644
--- a/getNeuroML.py
+++ b/getNeuroML.py
@@ -67,14 +67,14 @@ def main():
local_dir = ".." + os.sep + repo.split("/")[1]
- if mode is "clean":
+ if mode == "clean":
print("------ Cleaning: %s -------" % repo)
if repo in java_repos:
command = "mvn clean"
print("It's a Java repository, so cleaning using Maven...")
info = execute_command_in_dir(command, local_dir)
- if mode is "update":
+ if mode == "update":
print("------ Updating: %s -------" % repo)
runMvnInstall = False
@@ -91,7 +91,7 @@ def main():
if (repo in dev_branch_repos):
command = "git checkout %s" % (switch_to_branch)
print("Switching to branch: %s" % (switch_to_branch))
- exit_on_fail = switch_to_branch is not "experimental"
+ exit_on_fail = switch_to_branch != "experimental"
execute_command_in_dir(command, local_dir, exit_on_fail)
runMvnInstall = True
@@ -118,10 +118,10 @@ def main():
print(info)
exit(1)
- if mode is "update":
+ if mode == "update":
print("All repositories successfully updated & Java modules built!")
print("You should be able to run some examples straight away using jnml: ")
- if os.name is not 'nt':
+ if os.name != 'nt':
print(" ./jnml " +
"-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
print(" ./jnml " +
@@ -131,7 +131,7 @@ def main():
"..\\NeuroML2\\examples\\NML2_FullNeuroML.nml")
print(" jnml " +
"..\\NeuroML2\\LEMSexamples\\LEMS_NML2_Ex2_Izh.xml")
- if mode is "clean":
+ if mode == "clean":
print("All repositories successfully cleaned!")
From bab1932a491844963e5294fbd4962548aefbba21 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Sat, 20 Jun 2020 20:21:33 +0100
Subject: [PATCH 07/24] Improve help text
---
getNeuroML.py | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/getNeuroML.py b/getNeuroML.py
index bdb0a01..e5db192 100644
--- a/getNeuroML.py
+++ b/getNeuroML.py
@@ -4,6 +4,7 @@
import sys
import os.path as op
import subprocess
+from textwrap import dedent
def main():
@@ -157,15 +158,26 @@ def execute_command_in_dir(command, directory, exit_on_fail=True):
def help_info():
- print("\nUsage:\n\n python getNeuroML.py\n " \
- "Pull (or clone) the latest version of all NeuroML 2 repos & " \
- "compile/install with Maven if applicable\n\n" \
- " python getNeuroML.py clean\n "
- "Run 'mvn clean' on all Java repos\n\n" \
- " python getNeuroML.py master\n " \
- "Switch all repos to master branch\n\n" \
- " python getNeuroML.py development\n " \
- "Switch relevant repos to development branch\n\n")
+ usage = (
+ """\
+ Usage: python getNeuroML.py [OPTION]
+ Script to install NeuroML libraries.
+ Note: requires internet connectivity.
+
+ python getNeuroML.py
+ Pull (or clone) the latest version of all NeuroML 2 repos &
+ compile/install with Maven if applicable
+
+ python getNeuroML.py clean
+ Run 'mvn clean' on all Java repos
+
+ python getNeuroML.py master
+ Switch all repos to master branch
+
+ python getNeuroML.py development
+ Switch relevant repos to development branch
+ """)
+ print(dedent(usage))
if __name__ == "__main__":
From 70961607faaca7e2d47a56f670a6ba9643db0185 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Sat, 20 Jun 2020 20:24:03 +0100
Subject: [PATCH 08/24] Fix whitespace warnings
---
getNeuroML.py | 43 ++++++++++++++++++++++++-------------------
1 file changed, 24 insertions(+), 19 deletions(-)
diff --git a/getNeuroML.py b/getNeuroML.py
index e5db192..bcadd73 100644
--- a/getNeuroML.py
+++ b/getNeuroML.py
@@ -106,12 +106,14 @@ def main():
or not op.isdir(local_dir + os.sep + "target") \
or ("jNeuroML" in repo)
- if (repo in java_repos or repo in neuroml2_spec_repo) and runMvnInstall:
+ if (repo in java_repos or repo in neuroml2_spec_repo) \
+ and runMvnInstall:
command = "mvn install"
print("It's a Java repository, so installing using Maven...")
info = execute_command_in_dir(command, local_dir)
- # The code below needs a non trivial rewrite due to python3 differences.
+ # The code below needs a non trivial rewrite due to python3
+ # differences.
if str("BUILD SUCCESS") in str(info):
print("Successful installation using : %s!" % command)
else:
@@ -121,7 +123,7 @@ def main():
if mode == "update":
print("All repositories successfully updated & Java modules built!")
- print("You should be able to run some examples straight away using jnml: ")
+ print("You should be able to run examples straight away using jnml: ")
if os.name != 'nt':
print(" ./jnml " +
"-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
@@ -141,9 +143,11 @@ def execute_command_in_dir(command, directory, exit_on_fail=True):
if os.name == 'nt':
directory = os.path.normpath(directory)
- print(">>> Executing: (%s) in dir: %s (%s)" % (command, directory, os.path.abspath(directory)))
+ print(">>> Executing: (%s) in dir: %s (%s)" %
+ (command, directory, os.path.abspath(directory)))
- p = subprocess.Popen(command, cwd=directory, shell=True, stdout=subprocess.PIPE)
+ p = subprocess.Popen(command, cwd=directory, shell=True,
+ stdout=subprocess.PIPE)
return_str = p.communicate()
if p.returncode != 0:
@@ -159,24 +163,25 @@ def execute_command_in_dir(command, directory, exit_on_fail=True):
def help_info():
usage = (
- """\
- Usage: python getNeuroML.py [OPTION]
- Script to install NeuroML libraries.
- Note: requires internet connectivity.
+ """\
+ Usage: python getNeuroML.py [OPTION]
+ Script to install NeuroML libraries.
+ Note: requires internet connectivity.
- python getNeuroML.py
- Pull (or clone) the latest version of all NeuroML 2 repos &
- compile/install with Maven if applicable
+ python getNeuroML.py
+ Pull (or clone) the latest version of all NeuroML 2 repos &
+ compile/install with Maven if applicable
- python getNeuroML.py clean
- Run 'mvn clean' on all Java repos
+ python getNeuroML.py clean
+ Run 'mvn clean' on all Java repos
- python getNeuroML.py master
- Switch all repos to master branch
+ python getNeuroML.py master
+ Switch all repos to master branch
- python getNeuroML.py development
- Switch relevant repos to development branch
- """)
+ python getNeuroML.py development
+ Switch relevant repos to development branch
+ """
+ )
print(dedent(usage))
From 163b3076a10c5b9dbe8af9753b9b2b68d690cefb Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 10 Aug 2020 12:29:20 +0100
Subject: [PATCH 09/24] To v0.10.1
---
.travis.yml | 1 +
jnml | 2 +-
jnml.bat | 2 +-
pom.xml | 6 +++---
src/main/java/org/neuroml/JNeuroML.java | 2 +-
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index aea7c16..7cbd054 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,7 @@ install:
- ls -alt
- git branch
- python getNeuroML.py $main_repo_branch # will call mvn install on this & other repos
+ - mvn dependency:tree
- pwd
script:
diff --git a/jnml b/jnml
index 62b680c..3aa315a 100755
--- a/jnml
+++ b/jnml
@@ -5,7 +5,7 @@
# Type java -X for more info
export JNML_MAX_MEMORY=400M
-export JNML_VERSION=0.10.0
+export JNML_VERSION=0.10.1
export CLASSPATH=.:./target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar:$JNML_HOME/target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar
diff --git a/jnml.bat b/jnml.bat
index f41e0d9..1c2f588 100644
--- a/jnml.bat
+++ b/jnml.bat
@@ -1,6 +1,6 @@
@echo off
-set JNML_VERSION=0.10.0
+set JNML_VERSION=0.10.1
set CLASSPATH=target\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar;%JNML_HOME%\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar
diff --git a/pom.xml b/pom.xml
index deb9d6b..6b3ce79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.neuroml
jNeuroML
- 0.10.0
+ 0.10.1
jar
jNeuroML
@@ -24,12 +24,12 @@
org.neuroml1.model
org.neuroml1.model
- 1.7.0
+ 1.7.1
org.neuroml.import
org.neuroml.import
- 1.7.0
+ 1.7.1
diff --git a/src/main/java/org/neuroml/JNeuroML.java b/src/main/java/org/neuroml/JNeuroML.java
index fdbeb92..07efe56 100644
--- a/src/main/java/org/neuroml/JNeuroML.java
+++ b/src/main/java/org/neuroml/JNeuroML.java
@@ -59,7 +59,7 @@ public class JNeuroML
public static final String JNML_SCRIPT = "jnml";
- public static final String JNML_VERSION = "0.10.0";
+ public static final String JNML_VERSION = "0.10.1";
public static final String HELP_FLAG = "-help";
public static final String HELP_FLAG_SHORT = "-h";
From f3798132545d4aec629422f2b801b94ff3ff4584 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Wed, 28 Oct 2020 10:28:46 +0000
Subject: [PATCH 10/24] Limit jdks for branch used for geppetto
---
.travis.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 7cbd054..f6de52b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,11 +3,11 @@ dist: xenial
language: java
jdk:
- - oraclejdk11
+ #- oraclejdk11
- openjdk8
#- openjdk10 # Some non deterministic recurring error with jdk10...
- - openjdk11
+ #- openjdk11
install:
- export main_repo_branch=$TRAVIS_BRANCH
From 82e4fd80b33af2316aaf978a69ebd0f4a398950a Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Wed, 28 Oct 2020 10:30:46 +0000
Subject: [PATCH 11/24] Test on all jdks
---
.travis.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index f6de52b..7cbd054 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,11 +3,11 @@ dist: xenial
language: java
jdk:
- #- oraclejdk11
+ - oraclejdk11
- openjdk8
#- openjdk10 # Some non deterministic recurring error with jdk10...
- #- openjdk11
+ - openjdk11
install:
- export main_repo_branch=$TRAVIS_BRANCH
From afea57ec51c59a6a1a32b99b744542e2734acea2 Mon Sep 17 00:00:00 2001
From: Padr <>
Date: Wed, 27 Jan 2021 12:06:48 +0000
Subject: [PATCH 12/24] Using java 1.7 to compile
---
pom.xml | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/pom.xml b/pom.xml
index 965f4cb..d4a93e6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,7 @@
-
maven-assembly-plugin
2.4
@@ -43,7 +43,7 @@
jar-with-dependencies
-
+
true
@@ -67,15 +67,12 @@
maven-compiler-plugin
3.0
- 1.6
- 1.6
+ 1.7
+ 1.7
-
+
-
-
-
From 5d0ce18d812315be3ece9eba45bc3eb2def0cecc Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 3 Feb 2021 12:32:15 +0000
Subject: [PATCH 13/24] Check termination status of graphviz command
We now check the error code returned by the command before printing
"successfully ran..". If there's an error in the command, because of a
malformed dot file for example, we will print the stderr messages for
the user and clearly state that the command failed.
---
src/main/java/org/neuroml/JNeuroML.java | 29 +++++++++++++++++++------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/neuroml/JNeuroML.java b/src/main/java/org/neuroml/JNeuroML.java
index 07efe56..444be66 100644
--- a/src/main/java/org/neuroml/JNeuroML.java
+++ b/src/main/java/org/neuroml/JNeuroML.java
@@ -896,15 +896,30 @@ else if(args[1].equals(GRAPH_FLAG))
{
pr.waitFor();
- BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
- String line;
- while((line = buf.readLine()) != null)
+ /* Successful termination of command */
+ if (pr.exitValue() == 0)
{
- System.out.println("----" + line);
+ BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getInputStream()));
+ String line;
+ while((line = buf.readLine()) != null)
+ {
+ System.out.println("----" + line);
+ }
+ System.out.println("Have successfully run command: " + cmd);
+ System.exit(0);
+ }
+ /* Unsuccessful termination of command */
+ else
+ {
+ BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
+ String line;
+ while((line = buf.readLine()) != null)
+ {
+ System.out.println("----" + line);
+ }
+ System.out.println("Error running command: " + cmd);
+ System.exit(1);
}
-
- System.out.println("Have successfully run command: " + cmd);
-
}
catch(InterruptedException e)
{
From c4a68ccf3b12348c102a53183720d9575a2ffc45 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 10 Feb 2021 10:54:33 +0000
Subject: [PATCH 14/24] feat(jnml): adds -lems-graph flag to jnml
This is primarily added for clarity, to stress that this produces a
summary graph for the simulation from its LEMS description, rather than
one of the model description from the nml file (which is not implemented
here but resides in pynml).
The usage message has also been updated to note that `-graph` is an
alias of `-lems-graph`.
Fixes https://github.com/NeuroML/jNeuroML/issues/73
---
src/main/java/org/neuroml/JNeuroML.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/neuroml/JNeuroML.java b/src/main/java/org/neuroml/JNeuroML.java
index 07efe56..73e6922 100644
--- a/src/main/java/org/neuroml/JNeuroML.java
+++ b/src/main/java/org/neuroml/JNeuroML.java
@@ -133,6 +133,7 @@ public class JNeuroML
public static final String SBML_SEDML_EXPORT_FLAG = "-sbml-sedml";
public static final String GRAPH_FLAG = "-graph";
+ public static final String LEMS_GRAPH_FLAG = "-lems-graph";
public static final String SVG_FLAG = "-svg";
@@ -150,9 +151,13 @@ public class JNeuroML
+ " " + JNML_SCRIPT + " " + SEARCH_PATH_FLAG + " directory1:directory2:directoryN LEMSFile.xml\n"
+ " Execute the LEMS file, inclusing the : separated list of directories on the search path for includes\n\n"
- + " " + JNML_SCRIPT + " LEMSFile.xml " + GRAPH_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to GraphViz format\n\n"
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + LEMS_GRAPH_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to GraphViz format\n\n"
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + GRAPH_FLAG + "\n"
+ + " Alias for -lems-graph"
+ + " Load LEMSFile.xml using jLEMS, and convert it to GraphViz format\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + NEURON_EXPORT_FLAG + " [" + NO_GUI_FLAG + "] [" + RUN_FLAG+ "] ["+OUTPUT_DIR_FLAG+" dir]\n"
+ " Load LEMSFile.xml using jLEMS, and convert it to NEURON format, OR load ModelFile.nml and generate hoc and mod files for cells, channels, synapses \n"
+ " " + NO_GUI_FLAG+ " Do not generate graphical elements in NEURON, just run, save data and quit (if input file is LEMS file)\n"
@@ -876,7 +881,7 @@ else if(args[1].equals(BRIAN_EXPORT_FLAG) || args[1].equals(BRIAN2_EXPORT_FLAG))
System.out.println("Writing to: " + genFile.getAbsolutePath());
}
}
- else if(args[1].equals(GRAPH_FLAG))
+ else if(args[1].equals(GRAPH_FLAG) || args[1].equals(LEMS_GRAPH_FLAG))
{
File lemsFile = new File(args[0]);
Lems lems = loadLemsFile(lemsFile);
From b23d81928d0465271a95f0c9b9a94d28e0b2ddb0 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Mon, 15 Feb 2021 15:45:31 +0000
Subject: [PATCH 15/24] More explicit that the -lems-graph option is the one to
use now
---
src/main/java/org/neuroml/JNeuroML.java | 248 ++++++++++++------------
1 file changed, 122 insertions(+), 126 deletions(-)
diff --git a/src/main/java/org/neuroml/JNeuroML.java b/src/main/java/org/neuroml/JNeuroML.java
index 73e6922..6832774 100644
--- a/src/main/java/org/neuroml/JNeuroML.java
+++ b/src/main/java/org/neuroml/JNeuroML.java
@@ -67,7 +67,7 @@ public class JNeuroML
public static final String VERSION_FLAG = "-v";
public static final String VERSION_FLAG_LONG = "-version";
-
+
public static final String SEARCH_PATH_FLAG = "-I";
public static final String SEARCH_PATH_JLEMSLIKE_FLAG = "-cp";
@@ -76,7 +76,7 @@ public class JNeuroML
public static final String RUN_FLAG = "-run";
public static final String NO_RUN_FLAG = "-norun";
-
+
public static final String OUTPUT_DIR_FLAG = "-outputdir";
public static final String VALIDATE_FLAG = "-validate";
@@ -111,11 +111,11 @@ public class JNeuroML
public static final String PYNN_EXPORT_FLAG = "-pynn";
public static final String RUN_PYNN_NEURON_FLAG = "-run-neuron";
-
+
public static final String NETPYNE_EXPORT_FLAG = "-netpyne";
-
+
public static final String NUMBER_PROCESSORS_FLAG = "-np";
-
+
public static final String VERTEX_EXPORT_FLAG = "-vertex";
public static final String NINEML_EXPORT_FLAG = "-nineml";
@@ -124,7 +124,7 @@ public class JNeuroML
public static final String NEST_EXPORT_FLAG = "-nest";
public static final String MOOSE_EXPORT_FLAG = "-moose";
-
+
//public static final String GEPPETTO_EXPORT_FLAG = "-geppetto";
public static final String SBML_IMPORT_FLAG = "-sbml-import";
@@ -132,7 +132,7 @@ public class JNeuroML
public static final String SBML_EXPORT_FLAG = "-sbml";
public static final String SBML_SEDML_EXPORT_FLAG = "-sbml-sedml";
- public static final String GRAPH_FLAG = "-graph";
+ public static final String OLD_GRAPH_FLAG = "-graph";
public static final String LEMS_GRAPH_FLAG = "-lems-graph";
public static final String SVG_FLAG = "-svg";
@@ -140,105 +140,101 @@ public class JNeuroML
public static final String PNG_FLAG = "-png";
static String usage = "Usage: \n\n" + " " + JNML_SCRIPT + " LEMSFile.xml\n"
- + " Load LEMSFile.xml using jLEMS, parse it and validate it as LEMS, and execute the model it contains\n\n"
-
+ + " Load LEMSFile.xml using jLEMS, parse it and validate it as LEMS, and execute the model it contains\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + NO_GUI_FLAG + "\n"
- + " As above, parse and execute the model and save results, but don't show GUI\n\n"
-
+ + " As above, parse and execute the model and save results, but don't show GUI\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + NO_RUN_FLAG + "\n"
- + " Parse the LEMS file, but don't run the simulation\n\n"
-
+ + " Parse the LEMS file, but don't run the simulation\n\n"
+
+ " " + JNML_SCRIPT + " " + SEARCH_PATH_FLAG + " directory1:directory2:directoryN LEMSFile.xml\n"
- + " Execute the LEMS file, inclusing the : separated list of directories on the search path for includes\n\n"
-
+ + " Execute the LEMS file, inclusing the : separated list of directories on the search path for includes\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + LEMS_GRAPH_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to GraphViz format\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + GRAPH_FLAG + "\n"
- + " Alias for -lems-graph"
- + " Load LEMSFile.xml using jLEMS, and convert it to GraphViz format\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + NEURON_EXPORT_FLAG + " [" + NO_GUI_FLAG + "] [" + RUN_FLAG+ "] ["+OUTPUT_DIR_FLAG+" dir]\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to NEURON format, OR load ModelFile.nml and generate hoc and mod files for cells, channels, synapses \n"
- + " " + NO_GUI_FLAG+ " Do not generate graphical elements in NEURON, just run, save data and quit (if input file is LEMS file)\n"
- + " " + RUN_FLAG + " Compile NMODL files and run the main NEURON Python file (only with LEMS file)\n"
- + " " + NEURON_COMPILE_FLAG + " Compile NMODL files, but don't run (Linux only currently)\n"
- + " " + OUTPUT_DIR_FLAG + " Generate NEURON files in another directory, dir\n\n"
-
+ + " Load LEMSFile.xml using jLEMS, and convert it to GraphViz format (note, previously this option was: "+OLD_GRAPH_FLAG+")\n\n"
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + NEURON_EXPORT_FLAG + " [" + NO_GUI_FLAG + "] [" + RUN_FLAG+ "] ["+OUTPUT_DIR_FLAG+" dir]\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to NEURON format, OR load ModelFile.nml and generate hoc and mod files for cells, channels, synapses \n"
+ + " " + NO_GUI_FLAG+ " Do not generate graphical elements in NEURON, just run, save data and quit (if input file is LEMS file)\n"
+ + " " + RUN_FLAG + " Compile NMODL files and run the main NEURON Python file (only with LEMS file)\n"
+ + " " + NEURON_COMPILE_FLAG + " Compile NMODL files, but don't run (Linux only currently)\n"
+ + " " + OUTPUT_DIR_FLAG + " Generate NEURON files in another directory, dir\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + NETPYNE_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to NetPyNE format\n"
- + " " + RUN_FLAG + " Compile NMODL files and run the main NEURON Python file\n\n"
-
+ + " Load LEMSFile.xml using jLEMS, and convert it to NetPyNE format\n"
+ + " " + RUN_FLAG + " Compile NMODL files and run the main NEURON Python file\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + BRIAN_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to Brian v1 format (*EXPERIMENTAL - single components only*)\n\n"
-
+ + " Load LEMSFile.xml using jLEMS, and convert it to Brian v1 format (*EXPERIMENTAL - single components only*)\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + BRIAN2_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to Brian v2 format (*EXPERIMENTAL - single components only*)\n\n"
-
+ + " Load LEMSFile.xml using jLEMS, and convert it to Brian v2 format (*EXPERIMENTAL - single components only*)\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + MOOSE_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to MOOSE format (**EXPERIMENTAL**)\n\n"
-
- + " " + JNML_SCRIPT + " NMLFile.nml " + SVG_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to MOOSE format (**EXPERIMENTAL**)\n\n"
+
+ + " " + JNML_SCRIPT + " NMLFile.nml " + SVG_FLAG + "\n"
+ " Load NMLFile.nml and convert cells & networks to SVG image format \n\n"
-
- + " " + JNML_SCRIPT + " NMLFile.nml " + PNG_FLAG + "\n"
+
+ + " " + JNML_SCRIPT + " NMLFile.nml " + PNG_FLAG + "\n"
+ " Load NMLFile.nml and convert cells & networks to PNG image format \n\n"
-
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + DLEMS_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to dLEMS, a distilled form of LEMS in JSON (**EXPERIMENTAL - single components only**)\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + VERTEX_EXPORT_FLAG+ "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to VERTEX format (*EXPERIMENTAL*)\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + XPP_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to XPPAUT format (*EXPERIMENTAL - single components only*)\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + DNSIM_EXPORT_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to dLEMS, a distilled form of LEMS in JSON (**EXPERIMENTAL - single components only**)\n\n"
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + VERTEX_EXPORT_FLAG+ "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to VERTEX format (*EXPERIMENTAL*)\n\n"
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + XPP_EXPORT_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to XPPAUT format (*EXPERIMENTAL - single components only*)\n\n"
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + DNSIM_EXPORT_FLAG + "\n"
+ " Load LEMSFile.xml using jLEMS, and convert it to DNsim format (*EXPERIMENTAL - single components only*)\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + SBML_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to SBML format (**EXPERIMENTAL - single components only**)\n\n"
-
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + SBML_EXPORT_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to SBML format (**EXPERIMENTAL - single components only**)\n\n"
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + SEDML_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it (just the simulation run/display/save information) to SED-ML format\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + SBML_SEDML_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to SBML format with a SED-ML file describing the experiment to run (*EXPERIMENTAL - single components only*)\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml "+ MATLAB_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to MATLAB format (**EXPERIMENTAL - single components only**)\n\n"
-
- + " " + JNML_SCRIPT+ " LEMSFile.xml " + CVODE_EXPORT_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it (just the simulation run/display/save information) to SED-ML format\n\n"
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + SBML_SEDML_EXPORT_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to SBML format with a SED-ML file describing the experiment to run (*EXPERIMENTAL - single components only*)\n\n"
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml "+ MATLAB_EXPORT_FLAG + "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to MATLAB format (**EXPERIMENTAL - single components only**)\n\n"
+
+ + " " + JNML_SCRIPT+ " LEMSFile.xml " + CVODE_EXPORT_FLAG + "\n"
+ " Load LEMSFile.xml using jLEMS, and convert it to C format using CVODE package (**EXPERIMENTAL - single components only**)\n\n"
-
+
+ " " + JNML_SCRIPT + " LEMSFile.xml " + NINEML_EXPORT_FLAG + "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to NineML format (*EXPERIMENTAL - single components only*)\n\n"
-
- + " " + JNML_SCRIPT + " LEMSFile.xml " + SPINEML_EXPORT_FLAG+ "\n"
- + " Load LEMSFile.xml using jLEMS, and convert it to SpineML format (*EXPERIMENTAL - single components only*)\n\n"
-
- + " " + JNML_SCRIPT + " " + SBML_IMPORT_FLAG+ " SBMLFile.sbml duration dt\n"
- + " Load SBMLFile.sbml using jSBML, and convert it to LEMS format using values for duration & dt in ms (ignoring SBML units)\n\n"
-
+ + " Load LEMSFile.xml using jLEMS, and convert it to NineML format (*EXPERIMENTAL - single components only*)\n\n"
+
+ + " " + JNML_SCRIPT + " LEMSFile.xml " + SPINEML_EXPORT_FLAG+ "\n"
+ + " Load LEMSFile.xml using jLEMS, and convert it to SpineML format (*EXPERIMENTAL - single components only*)\n\n"
+
+ + " " + JNML_SCRIPT + " " + SBML_IMPORT_FLAG+ " SBMLFile.sbml duration dt\n"
+ + " Load SBMLFile.sbml using jSBML, and convert it to LEMS format using values for duration & dt in ms (ignoring SBML units)\n\n"
+
+ " " + JNML_SCRIPT + " " + SBML_IMPORT_UNITS_FLAG + " SBMLFile.sbml duration dt\n"
+ " Load SBMLFile.sbml using jSBML, and convert it to LEMS format using values for duration & dt in ms (attempt to extract SBML units; ensure units are valid in the SBML!)\n\n"
-
+
+ " " + JNML_SCRIPT+" LEMSFile.xml " + VHDL_EXPORT_FLAG + " neuronid \n" +
- " Load LEMSFile.xml using jLEMS, and convert it to VHDL format (**EXPERIMENTAL - point models only - single neurons only**)\n\n"
-
- + " " + JNML_SCRIPT + " " + VALIDATE_FLAG + " NMLFile.nml\n"
- + " Validate NMLFile.nml against latest v2 Schema & perform a number of other tests\n\n"
-
- + " " + JNML_SCRIPT + " " + VALIDATE_V1_FLAG + " NMLFile.nml\n" + " Validate NMLFile.nml against NeuroML v1.8.1 Schema \n\n"
-
- + " " + JNML_SCRIPT + " " + VERSION_FLAG + "\n"
-
- + " " + JNML_SCRIPT + " " + VERSION_FLAG_LONG + "\n" + " Print information on versions of packages used\n\n"
-
- + " " + JNML_SCRIPT + " " + HELP_FLAG + "\n"
-
- + " " + JNML_SCRIPT + " " + HELP_FLAG_SHORT + "\n"
-
+ " Load LEMSFile.xml using jLEMS, and convert it to VHDL format (**EXPERIMENTAL - point models only - single neurons only**)\n\n"
+
+ + " " + JNML_SCRIPT + " " + VALIDATE_FLAG + " NMLFile.nml\n"
+ + " Validate NMLFile.nml against latest v2 Schema & perform a number of other tests\n\n"
+
+ + " " + JNML_SCRIPT + " " + VALIDATE_V1_FLAG + " NMLFile.nml\n" + " Validate NMLFile.nml against NeuroML v1.8.1 Schema \n\n"
+
+ + " " + JNML_SCRIPT + " " + VERSION_FLAG + "\n"
+
+ + " " + JNML_SCRIPT + " " + VERSION_FLAG_LONG + "\n" + " Print information on versions of packages used\n\n"
+
+ + " " + JNML_SCRIPT + " " + HELP_FLAG + "\n"
+
+ + " " + JNML_SCRIPT + " " + HELP_FLAG_SHORT + "\n"
+
+ " " + JNML_SCRIPT + " " + HELP_FLAG_SHORT_Q + "\n" + " Print this help information\n\n";
public static void showUsage()
@@ -261,7 +257,7 @@ private static Lems loadLemsFile(File lemsFile, boolean includeConnectionsFromHD
}
return Utils.readLemsNeuroMLFile(lemsFile,includeConnectionsFromHDF5).getLems();
}
-
+
private static Lems loadNmlFileAsLems(File nmlFile) throws LEMSException, NeuroMLException, IOException
{
if(!nmlFile.exists())
@@ -272,27 +268,27 @@ private static Lems loadNmlFileAsLems(File nmlFile) throws LEMSException, NeuroM
}
return Utils.readNeuroMLFile(nmlFile).getLems();
}
-
+
private static String generateFormatFilename(File lemsFile, Format format, String extra)
{
String filename = lemsFile.getName();
return generateFormatFilename(filename, format, extra);
}
-
+
private static String generateFormatFilename(String lemsFilename, Format format, String extra)
{
String newSuffix = (extra!=null ? extra : "") + "." + format.getExtension();
-
+
String filename = lemsFilename;
-
+
String oldSuffix = "."+Format.LEMS.getExtension();
-
+
if (filename.endsWith(oldSuffix)) {
filename = filename.substring(0, filename.length() - oldSuffix.length());
}
-
+
filename = filename + newSuffix;
-
+
return filename;
}
@@ -323,13 +319,13 @@ public static void main(String[] args) throws SBMLException, org.sbml.jsbml.text
argsToUse.add(args[i]);
}
}
-
+
args = new String[argsToUse.size()];
args = argsToUse.toArray(args);
-
+
//System.out.println("args: "+args.length );
//System.out.println("args: "+args[0] );
-
+
if(args.length == 0)
{
System.err.println("Error, no arguments to " + JNML_SCRIPT);
@@ -466,7 +462,7 @@ else if(args[1].equals(NEURON_EXPORT_FLAG))
File lemsNmlFile = (new File(args[0])).getCanonicalFile();
Lems lems = null;
-
+
if (lemsNmlFile.getName().endsWith("nml"))
{
lems = loadNmlFileAsLems(lemsNmlFile);
@@ -481,7 +477,7 @@ else if(args[1].equals(NEURON_EXPORT_FLAG))
File outputDir = lemsNmlFile.getParentFile();
int i = 2;
- while (i 0) {
System.out.println("\nTry running this file locally with Geppetto using:\n\n "
+ "http://localhost:8080/org.geppetto.frontend/?sim=file://" + genFile + "\n");
@@ -773,8 +769,8 @@ else if(args[1].equals(CELLML_EXPORT_FLAG))
File lemsFile = new File(args[0]);
Lems lems = loadLemsFile(lemsFile);
- CellMLWriter cellmlw = new CellMLWriter(lems,
- lemsFile.getParentFile(),
+ CellMLWriter cellmlw = new CellMLWriter(lems,
+ lemsFile.getParentFile(),
generateFormatFilename(lemsFile, Format.CELLML, null));
for(File genFile : cellmlw.convert())
{
@@ -880,8 +876,8 @@ else if(args[1].equals(BRIAN_EXPORT_FLAG) || args[1].equals(BRIAN2_EXPORT_FLAG))
{
System.out.println("Writing to: " + genFile.getAbsolutePath());
}
- }
- else if(args[1].equals(GRAPH_FLAG) || args[1].equals(LEMS_GRAPH_FLAG))
+ }
+ else if(args[1].equals(OLD_GRAPH_FLAG) || args[1].equals(LEMS_GRAPH_FLAG))
{
File lemsFile = new File(args[0]);
Lems lems = loadLemsFile(lemsFile);
@@ -940,10 +936,10 @@ else if(args[1].equals(PNG_FLAG))
String pngFileName = nmlFile.getName().replaceAll("." + Format.NEUROML2.getExtension(), "." + Format.PNG.getExtension());
File pngFile = new File(nmlFile.getParentFile(), pngFileName);
SVGWriter svgw = new SVGWriter(nmlDocument, nmlFile.getParentFile(), pngFileName);
-
+
svgw.convertToPng(pngFile);
System.out.println("Writing to: " + pngFile.getAbsolutePath());
-
+
}
else
{
@@ -959,13 +955,13 @@ else if(args.length == 3)
File lemsFile = new File(args[0]);
Lems lems = loadLemsFile(lemsFile);
-
+
VHDLWriter vw = new VHDLWriter(lems);
-
+
Map componentScripts = vw.getNeuronModelScripts(args[2],false);
//String testbenchScript = vw.getSimulationScript(ScriptType.TESTBENCH, args[2], false);
String prjScript = vw.getPrjFile(componentScripts.keySet());
-
+
for (Map.Entry entry : componentScripts.entrySet()) {
String key = entry.getKey();
String val = entry.getValue();
@@ -973,14 +969,14 @@ else if(args.length == 3)
FileUtil.writeStringToFile(val, vwFile);
System.out.println("Writing to: "+vwFile.getAbsolutePath());
}
-
+
/*File vwFile = new File(lemsFile.getParentFile(), "/testbench.vhdl");
FileUtil.writeStringToFile(testbenchScript, vwFile);
System.out.println("Writing to: "+vwFile.getAbsolutePath());*/
File vwFile = new File(lemsFile.getParentFile(), "/testbench.prj");
FileUtil.writeStringToFile(prjScript, vwFile);
System.out.println("Writing to: "+vwFile.getAbsolutePath());
-
+
}
}
else if(args.length == 4)
From bbb00634eda9b8e1ebee63911b58a55b654e5b1f Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Sat, 27 Feb 2021 13:52:01 +0000
Subject: [PATCH 16/24] enh(docs): add badges
---
README.md | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/README.md b/README.md
index fe54ad0..a0f49f3 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,13 @@
jNeuroML
========
+[](https://github.com/NeuroML/jNeuroML/blob/master/LICENSE.lesser)
+[](https://github.com/NeuroML/jNeuroML/pulls)
+[](https://github.com/NeuroML/jNeuroML/issues)
+[](https://github.com/NeuroML)
+[](https://twitter.com/NeuroML)
+
+
There are a number of repositories in active development under GitHub for handling [NeuroML](https://github.com/NeuroML)
and [LEMS](https://github.com/LEMS) with Java. To make it easier to access all of this functionality, we've created a single package, jNeuroML, which allows access to most of this functionality through a simple command line interface and requires minimal installation.
From 4efe8da387e2841442dfcdaa9d4507ebf026e7f7 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Sat, 27 Feb 2021 13:52:25 +0000
Subject: [PATCH 17/24] enh(docs): add Fedora/NeuroFedora usage instructions
---
README.md | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index a0f49f3..1eaab42 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,18 @@ You can also check out the most recent verson of the jar file using:
svn checkout svn://svn.code.sf.net/p/neuroml/code/jNeuroMLJar
cd jNeuroMLJar
+
+### Fedora
+
+The [NeuroFedora](https://neuro.fedoraproject.org) community initiative provides jNeuroML for use on the [Fedora Linux Distribution](https://getfedora.org).
+Fedora users can install jNeuroML using the following commands:
+
+ sudo dnf copr enable @neurofedora/neurofedora-extra
+ sudo dnf install jneuroml
+
+Please see the [project documentation](https://docs.fedoraproject.org/en-US/neurofedora/copr/) for more information.
+
+
Usage
-----
@@ -83,10 +95,3 @@ If you prefer using/installing/coding in Python, try out [pyNeuroML](https://git
[](https://travis-ci.org/NeuroML/jNeuroML)
This code is distributed under the terms of the GNU Lesser General Public License.
-
-
-
-
-
-
-
From 735fcf37edc2e09b7565b67ab2f4b6b74666e94e Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Tue, 2 Mar 2021 17:08:04 +0000
Subject: [PATCH 18/24] Incrementing version jnml
---
jnml | 2 +-
jnml.bat | 2 +-
pom.xml | 2 +-
src/main/java/org/neuroml/JNeuroML.java | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/jnml b/jnml
index 3aa315a..bec764a 100755
--- a/jnml
+++ b/jnml
@@ -5,7 +5,7 @@
# Type java -X for more info
export JNML_MAX_MEMORY=400M
-export JNML_VERSION=0.10.1
+export JNML_VERSION=0.10.2
export CLASSPATH=.:./target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar:$JNML_HOME/target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar
diff --git a/jnml.bat b/jnml.bat
index 1c2f588..14413eb 100644
--- a/jnml.bat
+++ b/jnml.bat
@@ -1,6 +1,6 @@
@echo off
-set JNML_VERSION=0.10.1
+set JNML_VERSION=0.10.2
set CLASSPATH=target\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar;%JNML_HOME%\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar
diff --git a/pom.xml b/pom.xml
index d4a93e6..38cf7bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.neuroml
jNeuroML
- 0.10.1
+ 0.10.2
jar
jNeuroML
diff --git a/src/main/java/org/neuroml/JNeuroML.java b/src/main/java/org/neuroml/JNeuroML.java
index 18bdb68..9500d70 100644
--- a/src/main/java/org/neuroml/JNeuroML.java
+++ b/src/main/java/org/neuroml/JNeuroML.java
@@ -59,7 +59,7 @@ public class JNeuroML
public static final String JNML_SCRIPT = "jnml";
- public static final String JNML_VERSION = "0.10.1";
+ public static final String JNML_VERSION = "0.10.2";
public static final String HELP_FLAG = "-help";
public static final String HELP_FLAG_SHORT = "-h";
From 38975c2978b2f2499cbcee1b39d3fa531319ad28 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 3 Mar 2021 12:14:55 +0000
Subject: [PATCH 19/24] enh: add script to "install" jNeuroML on Linux machines
---
installers/linux-install.sh | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100755 installers/linux-install.sh
diff --git a/installers/linux-install.sh b/installers/linux-install.sh
new file mode 100755
index 0000000..d29f5bc
--- /dev/null
+++ b/installers/linux-install.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# Copyright 2021 Ankur Sinha
+# Author: Ankur Sinha
+# File : linux-install.sh
+#
+# Install jNeuroML on Linux machines
+jNeuroMLJarDir="$(pwd)"
+
+if [ -e "jnml" ] && [ -f jNeuroML*jar-with-dependencies.jar ];
+then
+ echo "Found jar and jnml in current directory: $jNeuroMLJarDir"
+ echo "Updating ~/.bashrc to make it available in \$PATH."
+else
+ echo "ERROR: jnml or jneuroML pre-compiled JAR file not found."
+ echo "ERROR: Please run this script from the jNeuroMLJar directory that contains both jnml and the jar file."
+ exit -1
+fi
+
+# Remove previous JNML additions
+sed -i '/JNML_HOME/ d' ~/.bashrc
+
+# Export JNML_HOME so that jnml can find the JAR
+cat >> ~/.bashrc << EOF
+# JNML_HOME etc for jNeuroML
+export JNML_HOME="$jNeuroMLJarDir"
+export PATH="\$PATH:\$JNML_HOME"
+EOF
+
+echo "Done: Please log out and back in and try to run jnml in a terminal."
+exit 0
From e46b6e69a2e45bcd15b387073a3967655376272b Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 3 Mar 2021 19:21:45 +0000
Subject: [PATCH 20/24] Add new bug report issue template
---
.github/ISSUE_TEMPLATE/bug_report.md | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..11a491e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,28 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: bug
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior, for example the command you used.
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Observed behavior**
+
+**System information:**
+ - OS: [e.g. iOS]
+ - Java version (`java -version`)
+ - Version of tools in use (from `jnml -h`)
+
+
+**Additional context**
+Add any other context about the problem here.
From a3b58a69cb667d80e247e0f9ff12aa2b7115cbc8 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 3 Mar 2021 19:25:01 +0000
Subject: [PATCH 21/24] Add feature request template
---
.github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..11fc491
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: enhancement
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
From 8aead37eee75bbc4c921325c060ac8e77a3c5105 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 10 Mar 2021 15:59:46 +0000
Subject: [PATCH 22/24] enh: add workflow to publish javadocs
---
.github/workflows/docs.yml | 116 +++++++++++++++++++++++++++++++++++++
pom.xml | 14 +++++
2 files changed, 130 insertions(+)
create mode 100644 .github/workflows/docs.yml
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000..fdf1f45
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,116 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Publish Javadocs
+
+on:
+ push:
+ branches: [ development ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: nelonoel/branch-name@v1.0.1
+
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 11
+ java-package: jdk
+
+ - name: Set up Python 3.9
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.9
+
+ - name: Install GH import
+ run: |
+ python -m pip install --upgrade pip
+ pip install ghp-import
+
+ - name: Checkout NeuroML2
+ uses: actions/checkout@v2
+ with:
+ repository: NeuroML/NeuroML2
+ ref: development
+ path: NeuroML2
+
+ - name: Checkout org.lemsml
+ uses: actions/checkout@v2
+ with:
+ repository: LEMS/jLEMS
+ ref: development
+ path: jLEMS
+
+ - name: Checkout org.neuroml.model.injectingplugin
+ uses: actions/checkout@v2
+ with:
+ repository: NeuroML/org.neuroml.model.injectingplugin
+ ref: development
+ path: org.neuroml.model.injectingplugin
+
+ - name: Checkout org.neuroml1.model
+ uses: actions/checkout@v2
+ with:
+ repository: NeuroML/org.neuroml1.model
+ ref: development
+ path: org.neuroml1.model
+
+ - name: Checkout org.neuroml.model
+ uses: actions/checkout@v2
+ with:
+ repository: NeuroML/org.neuroml.model
+ ref: development
+ path: org.neuroml.model
+
+ - name: Checkout org.neuroml.export
+ uses: actions/checkout@v2
+ with:
+ repository: NeuroML/org.neuroml.export
+ ref: development
+ path: org.neuroml.export
+
+ - name: Checkout org.neuroml.import
+ uses: actions/checkout@v2
+ with:
+ repository: NeuroML/org.neuroml.import
+ ref: development
+ path: org.neuroml.import
+
+
+ - name: Install NeuroML deps
+ run: |
+ pushd jLEMS
+ mvn install
+ popd
+ pushd NeuroML2
+ mvn install
+ popd
+ pushd org.neuroml.model.injectingplugin
+ mvn install
+ popd
+ pushd org.neuroml1.model
+ mvn install
+ popd
+ pushd org.neuroml.model
+ mvn install
+ popd
+ pushd org.neuroml.export
+ mvn install
+ popd
+ pushd org.neuroml.import
+ mvn install
+ popd
+
+ - name: Build docs
+ run: |
+ mvn javadoc:javadoc
+
+ - name: Publish documentation on GH pages
+ run: |
+ ghp-import -f -m "Regenerate documentation" -b gh-pages -n -p target/site/apidocs
+
diff --git a/pom.xml b/pom.xml
index 38cf7bf..6cf64ec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,6 +34,20 @@
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ 8
+
+ <br /> Learn more about NeuroML at <a href="http://neuroml.org" target="_blank">NeuroML.org</a>
+ <br />
+ <br />
+
+ Copyright NeuroML Contributors 2021
+
+
From 1bf77fd11b502cc04916e254103cc266bcf2598a Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)"
Date: Wed, 10 Mar 2021 16:24:15 +0000
Subject: [PATCH 23/24] enh: check for java in the installer script
---
installers/linux-install.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/installers/linux-install.sh b/installers/linux-install.sh
index d29f5bc..5f388c3 100755
--- a/installers/linux-install.sh
+++ b/installers/linux-install.sh
@@ -7,6 +7,16 @@
# Install jNeuroML on Linux machines
jNeuroMLJarDir="$(pwd)"
+if command -v java &> /dev/null
+then
+ echo "Found java installation:"
+ java -version
+else
+ echo "Could not find 'java' command."
+ echo "Please ensure that a Java Runtime Environment is installed on your system and that the 'java' command is usable in the terminal"
+ exit -1
+fi
+
if [ -e "jnml" ] && [ -f jNeuroML*jar-with-dependencies.jar ];
then
echo "Found jar and jnml in current directory: $jNeuroMLJarDir"
From 5174bf800ba6b9e846fc3351abb24d99c5eecc96 Mon Sep 17 00:00:00 2001
From: Padraig Gleeson
Date: Fri, 19 Mar 2021 12:39:22 +0000
Subject: [PATCH 24/24] To v0.10.3
---
jnml | 2 +-
jnml.bat | 2 +-
pom.xml | 6 +++---
src/main/java/org/neuroml/JNeuroML.java | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/jnml b/jnml
index bec764a..5e4eabe 100755
--- a/jnml
+++ b/jnml
@@ -5,7 +5,7 @@
# Type java -X for more info
export JNML_MAX_MEMORY=400M
-export JNML_VERSION=0.10.2
+export JNML_VERSION=0.10.3
export CLASSPATH=.:./target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar:$JNML_HOME/target/jNeuroML-$JNML_VERSION-jar-with-dependencies.jar
diff --git a/jnml.bat b/jnml.bat
index 14413eb..72bb14b 100644
--- a/jnml.bat
+++ b/jnml.bat
@@ -1,6 +1,6 @@
@echo off
-set JNML_VERSION=0.10.2
+set JNML_VERSION=0.10.3
set CLASSPATH=target\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar;%JNML_HOME%\jNeuroML-%JNML_VERSION%-jar-with-dependencies.jar
diff --git a/pom.xml b/pom.xml
index 6cf64ec..b82a773 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.neuroml
jNeuroML
- 0.10.2
+ 0.10.3
jar
jNeuroML
@@ -24,12 +24,12 @@
org.neuroml1.model
org.neuroml1.model
- 1.7.1
+ 1.7.2
org.neuroml.import
org.neuroml.import
- 1.7.1
+ 1.7.2
diff --git a/src/main/java/org/neuroml/JNeuroML.java b/src/main/java/org/neuroml/JNeuroML.java
index 9500d70..af6b3af 100644
--- a/src/main/java/org/neuroml/JNeuroML.java
+++ b/src/main/java/org/neuroml/JNeuroML.java
@@ -59,7 +59,7 @@ public class JNeuroML
public static final String JNML_SCRIPT = "jnml";
- public static final String JNML_VERSION = "0.10.2";
+ public static final String JNML_VERSION = "0.10.3";
public static final String HELP_FLAG = "-help";
public static final String HELP_FLAG_SHORT = "-h";