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

Version 0.5.4 #51

Merged
merged 35 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0998725
Update .travis.yml
pgleeson May 19, 2020
e93190d
Merge branch 'master' into development
sanjayankur31 Apr 2, 2021
198413f
chore: ignore some flake8 notes
sanjayankur31 Apr 2, 2021
b376e88
enh(parser): extract descriptions for Paramenter and Requirement comp…
sanjayankur31 Apr 2, 2021
268159f
fix: parse description for DerivedParameters
sanjayankur31 Apr 2, 2021
f566ade
Merge branch 'master' into development
pgleeson Apr 6, 2021
2f3ee9d
Merge pull request #46 from sanjayankur31/fix/get-descriptions-for-pa…
pgleeson Apr 6, 2021
f30f399
Bump to v0.5.3
pgleeson Apr 8, 2021
c5315f0
feat: parse description from Child and Children also
sanjayankur31 Jun 1, 2021
f645480
fix: set multiple for Children elements
sanjayankur31 Jun 1, 2021
63614d2
feat: include description in Child and Children XML export
sanjayankur31 Jun 1, 2021
84fcbcd
fix: explicitly set multiple to False for Child elements
sanjayankur31 Jun 1, 2021
7205da5
fix: update schema version used in validation
sanjayankur31 Jun 8, 2021
1861dfd
feat: use pytest instead of deprecated nose for CI
sanjayankur31 Jun 8, 2021
6e2c0b9
feat: add py3.9 to set of supported python versions
sanjayankur31 Jun 8, 2021
399c9bf
chore: remove trailing whitespaces
sanjayankur31 Jun 8, 2021
13c8b4a
Merge pull request #47 from sanjayankur31/feat/parse-child-children-d…
pgleeson Jun 9, 2021
643bb01
feat: enable parsing of model description
sanjayankur31 Jun 17, 2021
dd2767a
feat: set up sphinx autodoc
sanjayankur31 Jun 24, 2021
d1a3b3a
feat: migrate from epydoc format to sphinx doc strings
sanjayankur31 Jun 24, 2021
9a61805
feat: add docs badge to readme
sanjayankur31 Jun 24, 2021
bb099dc
feat(ci): add GH actions workflow
sanjayankur31 Jun 24, 2021
90b95a5
fix(ci): correct GH actions file
sanjayankur31 Jun 24, 2021
fc6dc11
fix(docs): add requirements file for docs
sanjayankur31 Jun 24, 2021
db59b79
fix(ci): create results directory needed for examples
sanjayankur31 Jun 24, 2021
adf0e14
feat(ci): make flake8 ignore NeuroML2 folder
sanjayankur31 Jun 24, 2021
9128d23
feat(ci): add API tests to CI run
sanjayankur31 Jun 24, 2021
ef5ec91
fix(ci): update file path for API test
sanjayankur31 Jun 24, 2021
b91bac2
Merge pull request #49 from LEMS/feat/rtd
sanjayankur31 Jun 24, 2021
f9b8617
Merge pull request #48 from sanjayankur31/feat/enable-parsing-model-d…
pgleeson Jun 25, 2021
90cb299
feat: add functions to get exposures from a LEMS model
sanjayankur31 Jun 25, 2021
612023d
refactor: remove spaces, format
sanjayankur31 Jun 25, 2021
0ecde8f
feat: add test to check if correct exposures are obtained
sanjayankur31 Jun 25, 2021
ebe6466
Merge pull request #50 from LEMS/feat/get-exposures
pgleeson Jun 28, 2021
7735e68
Increment version to v0.5.4
pgleeson Jun 28, 2021
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
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
exclude = NeuroML2
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build

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

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Checkout NeuroML2
uses: actions/checkout@v2
with:
repository: NeuroML/NeuroML2
ref: development
path: NeuroML2

- name: Build package
run: |
pip install .

- name: Test with pytest
run: |
pytest

- name: Test examples
run: |
./ci/run-examples-ghactions.sh

- name: Test API tests
run: |
./ci/run-apitest.sh

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ results
test*.sh
build
*~
doc
doc/_build
*.pyc
*.pyo
.project
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python:
# command to install dependencies
install:
- "pip install ."
- "pip install pytest"
- git clone https://github.com/NeuroML/NeuroML2
- cd NeuroML2
# Use the development branch of NeuroML2
Expand All @@ -20,7 +21,7 @@ install:
script:
### Run main python unit tests (not many yet...)

- nosetests -vs
- pytest -v

### Try running "standard" LEMS examples
- ./pylems examples/example1.xml -nogui
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## PyLEMS

[![Documentation Status](https://readthedocs.org/projects/pylems/badge/?version=latest)](https://pylems.readthedocs.io/en/latest/?badge=latest)


A LEMS (http://lems.github.io/LEMS) simulator written in Python which can be used to run NeuroML2 (http://neuroml.org/neuroml2.php) models.

For more about PyLEMS see:
Expand Down
17 changes: 17 additions & 0 deletions ci/run-apitest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Copyright 2021 LEMS contributors
# Author: Ankur Sinha <sanjay DOT ankur AT gmail DOT com>
# File : run-apitest.sh
#
# Run api tests on GitHub actions

python examples/apitest.py
python examples/apitest2.py
python examples/loadtest.py

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

# Copyright 2021 LEMS contributors
# Author: Ankur Sinha <sanjay DOT ankur AT gmail DOT com>
# File : run-examples-ghactions.sh
#
# Run tests on GitHub actions

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
# 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_Ex13_Instances.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...
153 changes: 153 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
-rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PyLEMS.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PyLEMS.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/PyLEMS"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PyLEMS"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
Loading