Skip to content

Commit

Permalink
Merge pull request #68 from LEMS/development
Browse files Browse the repository at this point in the history
For NML2.3 release
  • Loading branch information
pgleeson authored Sep 20, 2023
2 parents d720ab2 + 5ddd926 commit 373a259
Show file tree
Hide file tree
Showing 31 changed files with 159 additions and 246 deletions.
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

24 changes: 14 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ name: Build

on:
push:
branches: [ master, development, test* ]
branches: [ master, development, experimental, test* ]
pull_request:
branches: [ master, development, test* ]
branches: [ master, development, experimental, test* ]

jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ["3.7", "3.9", "3.10", "3.11"]
runs-on: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install pytest pytest-cov
- name: Checkout NeuroML2
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: NeuroML/NeuroML2
ref: development
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Test with pytest
run: |
pytest
pytest --cov=lems
- name: Test examples
run: |
Expand All @@ -52,6 +52,10 @@ jobs:
run: |
./ci/run-apitest.sh
- name: Final version info
run: |
pip list
- name: Lint with flake8
run: |
# Install flake
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: nelonoel/[email protected]

# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
Expand All @@ -21,7 +21,7 @@ jobs:
id: extract_branch

- name: Checkout jlems
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: LEMS/jLEMS
ref: ${{ steps.extract_branch.outputs.branch }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ doc/_build
comp_*
/lems/test/hhcell_resaved3.xml
/lems/__init__$py.class
/PyLEMS.egg-info
*PyLEMS.egg-info
/dist
*ken.sh
*.whl
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include README.md
include examples/*.xml
include examples/*.py
include LICENSE.lesser
recursive-include man *.1
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,46 @@ clean:
rm -rf doc/epydoc/*

example1:
./pylems examples/example1.xml
pylems examples/example1.xml

example2:
./pylems examples/example2.xml
pylems examples/example2.xml

example3:
./pylems examples/example3.xml
pylems examples/example3.xml

example4:
./pylems examples/example4.xml
pylems examples/example4.xml

example5:
./pylems examples/example5.xml
pylems examples/example5.xml

example6:
./pylems examples/example6.xml
pylems examples/example6.xml

example7:
./pylems examples/example7.xml
pylems examples/example7.xml

example8:
./pylems examples/example8.xml
pylems examples/example8.xml

example9:
./pylems examples/example9.xml
pylems examples/example9.xml

ex0:
./pylems examples/LEMS_NML2_Ex0.xml
pylems examples/LEMS_NML2_Ex0.xml

nmlex0:
./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex0_IaF.xml
pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex0_IaF.xml

nmlex1:
./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex1_HH.xml
pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex1_HH.xml

nmlex2:
./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex2_Izh.xml
pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex2_Izh.xml

nmlex3:
./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex3_Net.xml
pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex3_Net.xml

run: example1

Expand Down
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +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 (http://neuroml.org/neuroml2.php) models.
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:

Expand All @@ -22,36 +21,35 @@ Robert C. Cannon, Padraig Gleeson, Sharon Crook, Gautham Ganapathy, Boris Marin,
**LEMS: A language for expressing complex biological models in concise and hierarchical form and its use in underpinning NeuroML 2**,
[Frontiers in Neuroinformatics 2014](http://journal.frontiersin.org/Journal/10.3389/fninf.2014.00079/abstract), doi: 10.3389/fninf.2014.00079


### Installation

A stable version of PyLEMS is [available on PyPI](https://pypi.python.org/pypi/PyLEMS) using [pip](https://pip.pypa.io/en/latest/installing.html):

pip install pylems

To install as root:

sudo pip install pylems
```
pip install pylems
```

Alternatively, you can obtain the latest version with

git clone https://github.com/LEMS/pylems.git
cd pylems
git checkout development # optional
sudo python setup.py install
```
git clone https://github.com/LEMS/pylems.git
cd pylems
git checkout development # optional
pip install .
```

### Usage as a LEMS model simulator

pylems [options] LEMS_file
```
pylems [options] LEMS_file
```

**Options**

- -I/-include path - Adds a directory to the model file include search path


### Examples


**NeuroML examples (from https://github.com/NeuroML/NeuroML2/tree/development/NeuroML2CoreTypes)**

- Example 0 -- Working
Expand All @@ -74,7 +72,6 @@ Alternatively, you can obtain the latest version with
- Example 17 -- Working
- Example 18 -- Working


**LEMS examples (in directory examples)**

- example1.xml -- Working
Expand All @@ -83,9 +80,8 @@ Alternatively, you can obtain the latest version with
- example4.xml -- Not working (Unsupported in PyLEMS: KSChannel)
- example5.xml -- Not working (Unsupported in PyLEMS: KSChannel)
- example6.xml -- Working
-- TODO: Rest of examples require an update to the `<Simulation>` element,
i.e. use `<Simulation...>` not `<SimulationSet...>`, to work in PyLEMS

TODO: Rest of examples require an update to the `<Simulation>` element, i.e. use `<Simulation...>` not `<SimulationSet...>`, to work in PyLEMS

**LEMS elements that do not work**

Expand Down
10 changes: 7 additions & 3 deletions ci/run-apitest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2021 LEMS contributors
# Copyright 2023 LEMS contributors
# Author: Ankur Sinha <sanjay DOT ankur AT gmail DOT com>
# File : run-apitest.sh
#
Expand All @@ -12,6 +12,10 @@ python examples/loadtest.py

# Update NeuroML2 path for CI
if [ "$CI" = "true" ]; then
sed -i 's|../NeuroML2|./NeuroML2|g' lems/dlems/exportdlems.py
if [ "$RUNNER_OS" = "macOS" ]; then
sed -i '' 's|../NeuroML2|./NeuroML2|g' lems/dlems/exportdlems.py;
else
sed -i 's|../NeuroML2|./NeuroML2|g' lems/dlems/exportdlems.py;
fi
fi
python lems/dlems/exportdlems.py
python lems/dlems/exportdlems.py
48 changes: 24 additions & 24 deletions ci/run-examples-ghactions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2021 LEMS contributors
# Copyright 2023 LEMS contributors
# Author: Ankur Sinha <sanjay DOT ankur AT gmail DOT com>
# File : run-examples-ghactions.sh
#
Expand All @@ -10,33 +10,33 @@ mkdir results

### Try running "standard" LEMS examples
echo "Running standard LEMS examples"
./pylems examples/example1.xml -nogui
./pylems examples/example2.xml -nogui
./pylems examples/example3.xml -nogui
#./pylems examples/example4.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel)
#./pylems examples/example5.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel)
./pylems examples/example6.xml -nogui
./pylems examples/bounce-conditional.xml -nogui
pylems examples/example1.xml -nogui
pylems examples/example2.xml -nogui
pylems examples/example3.xml -nogui
#pylems examples/example4.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel)
#pylems examples/example5.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel)
pylems examples/example6.xml -nogui
pylems examples/bounce-conditional.xml -nogui
# Rest of examples require an update to the <Simulation> element, i.e. use <Simulation...> not <SimulationSet...>, to work in PyLEMS

### Try running NeuroML 2 examples
echo "Running NeuroML2 examples"
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex0_IaF.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex1_HH.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex3_Net.xml -nogui
#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex4_KS.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel)
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex5_DetCell.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex6_NMDA.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex7_STP.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex8_AdEx.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex9_FN.xml -nogui
#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex10_Q10.xml -nogui
./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex11_STDP.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex0_IaF.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex1_HH.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex3_Net.xml -nogui
#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex4_KS.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel)
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex5_DetCell.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex6_NMDA.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex7_STP.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex8_AdEx.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex9_FN.xml -nogui
#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex10_Q10.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex11_STDP.xml -nogui

./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex13_Instances.xml -nogui
pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex13_Instances.xml -nogui

#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex15_CaDynamics.xml -nogui
#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex15_CaDynamics.xml -nogui

#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex17_Tissue.xml -nogui
#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex18_GHK.xml -nogui # Mismatch...
#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex17_Tissue.xml -nogui
#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex18_GHK.xml -nogui # Mismatch...
Loading

0 comments on commit 373a259

Please sign in to comment.