From 91929482043903de541a6110037b298008c3dab7 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 4 Jan 2022 14:54:48 +0000 Subject: [PATCH 01/30] feat!: drop py2 support --- .github/workflows/ci.yml | 2 +- lems/model/model.py | 33 ++++++++++++++------------------- setup.py | 1 - 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f541de2..8b64659 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [2.7, 3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 diff --git a/lems/model/model.py b/lems/model/model.py index eb5f6ee..aaceaf2 100644 --- a/lems/model/model.py +++ b/lems/model/model.py @@ -5,16 +5,18 @@ :organization: LEMS (https://github.com/organizations/LEMS) """ +from __future__ import annotations import os from os.path import dirname # For python versions where typing isn't available at all try: - from typing import List, Dict, Union, Tuple + import typing except ImportError: pass import copy +import lems from lems import __schema_location__, __schema_version__ from lems.base.base import LEMSBase from lems.base.util import merge_maps, merge_lists @@ -376,8 +378,7 @@ def export_to_file(self, filepath, level_prefix=" "): f.write(xmlstr) f.close() - def resolve(self): - # type: () -> Model + def resolve(self) -> lems.model.Model: """ Resolves references in this model and returns resolved model. @@ -1036,8 +1037,7 @@ def get_numeric_value(self, value_str, dimension=None): # print("Have converted %s to value: %s, dimension %s"%(value_str, numeric_value, dimension)) return numeric_value - def get_component_list(self, substring=""): - # type: (str) -> Dict[str, Component] + def get_component_list(self, substring: str = "") -> dict[str, Component]: """Get all components whose id matches the given substring. Note that in PyLEMS, if a component does not have an id attribute, @@ -1071,8 +1071,7 @@ def get_component_list(self, substring=""): return ret_list - def get_fattened_component_list(self, substring=""): - # type: (str) -> Map + def get_fattened_component_list(self, substring: str = "") -> Map: """Get a list of fattened components whose ids include the substring. A "fattened component" is one where all elements of the components have @@ -1092,8 +1091,7 @@ def get_fattened_component_list(self, substring=""): return fattened_comp_list - def get_nested_components(self, comp): - # type: (Component) -> Dict[str, Component] + def get_nested_components(self, comp: Component) -> dict[str, Component]: """Get all nested (child/children) components in the comp component :param comp: component to get all nested (child/children) components for @@ -1109,8 +1107,7 @@ def get_nested_components(self, comp): return comp_list - def list_exposures(self, substring=""): - # type: (str) -> Dict[FatComponent, Map] + def list_exposures(self, substring: str = "") -> dict[FatComponent, Map]: """Get exposures from model belonging to components which contain the given substring. @@ -1150,8 +1147,8 @@ def list_exposures(self, substring=""): return exposures - def get_full_comp_paths_with_comp_refs(self, comp, comptext=None): - # type: (FatComponent, Union[None, str]) -> None + def get_full_comp_paths_with_comp_refs(self, comp: FatComponent, comptext: + typing.Optional[str] = None): """Get list of component paths with all component references also resolved for the given component `comp`. @@ -1281,8 +1278,7 @@ def get_full_comp_paths_with_comp_refs(self, comp, comptext=None): self.temp_vec.pop() self.path_vec.pop() - def construct_path(self, pathlist, skip=None): - # type: (List[str], str) -> str + def construct_path(self, pathlist: list[str], skip: typing.Optional[str] = None) -> str: """Construct path from a list. :param vec: list of text strings to generate path from @@ -1298,8 +1294,8 @@ def construct_path(self, pathlist, skip=None): pathlist.remove(skip) return "/".join(pathlist) - def list_recording_paths_for_exposures(self, substring="", target=""): - # (str, str) -> List[str] + def list_recording_paths_for_exposures(self, substring: str = "", target: + str = "") -> list[str]: """List recording paths for exposures in the model for components matching the given substring, and for the given simulation target. @@ -1369,8 +1365,7 @@ def list_recording_paths_for_exposures(self, substring="", target=""): print("\n".join(exp_paths)) return exp_paths - def get_comp_ref_map(self): - # type () -> Map[str, List[FatComponent]] + def get_comp_ref_map(self) -> Map: """Get a Map of ComponentReferences in the model. :returns: Map with target -> [source] entries diff --git a/setup.py b/setup.py index 0d5794e..0d310c6 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,6 @@ "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Natural Language :: English", "Operating System :: OS Independent", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", From 4ac4dff4f6ada96f3076d755ec79b02daa9faaf8 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 4 Jan 2022 14:55:21 +0000 Subject: [PATCH 02/30] ci: generate coverage metrics from pytest --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b64659..5873a9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest + python -m pip install pytest pytest-cov if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Checkout NeuroML2 @@ -41,7 +41,7 @@ jobs: - name: Test with pytest run: | - pytest + pytest --cov=lems - name: Test examples run: | From df0c467e5ab6d4d10a30bcd797fb7f0c1d7af43a Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 4 Jan 2022 14:56:52 +0000 Subject: [PATCH 03/30] chore: format with black --- lems/model/model.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lems/model/model.py b/lems/model/model.py index aaceaf2..281a34e 100644 --- a/lems/model/model.py +++ b/lems/model/model.py @@ -1147,8 +1147,9 @@ def list_exposures(self, substring: str = "") -> dict[FatComponent, Map]: return exposures - def get_full_comp_paths_with_comp_refs(self, comp: FatComponent, comptext: - typing.Optional[str] = None): + def get_full_comp_paths_with_comp_refs( + self, comp: FatComponent, comptext: typing.Optional[str] = None + ): """Get list of component paths with all component references also resolved for the given component `comp`. @@ -1278,7 +1279,9 @@ def get_full_comp_paths_with_comp_refs(self, comp: FatComponent, comptext: self.temp_vec.pop() self.path_vec.pop() - def construct_path(self, pathlist: list[str], skip: typing.Optional[str] = None) -> str: + def construct_path( + self, pathlist: list[str], skip: typing.Optional[str] = None + ) -> str: """Construct path from a list. :param vec: list of text strings to generate path from @@ -1294,8 +1297,9 @@ def construct_path(self, pathlist: list[str], skip: typing.Optional[str] = None) pathlist.remove(skip) return "/".join(pathlist) - def list_recording_paths_for_exposures(self, substring: str = "", target: - str = "") -> list[str]: + def list_recording_paths_for_exposures( + self, substring: str = "", target: str = "" + ) -> list[str]: """List recording paths for exposures in the model for components matching the given substring, and for the given simulation target. From 89ea83e446473e7bef8917c9c13589370f13c7c7 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 4 Jan 2022 14:58:43 +0000 Subject: [PATCH 04/30] feat: enable py310 support (and enable CI) --- .github/workflows/ci.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5873a9c..d4b7b3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, 3.10] steps: - uses: actions/checkout@v2 diff --git a/setup.py b/setup.py index 0d310c6..680d0a3 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,7 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering", ], ) From ea5650e98220b2e193aba850466fe1c3700a2776 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 4 Jan 2022 14:59:47 +0000 Subject: [PATCH 05/30] fix: quote python version in CI Otherwise 3.10 is read as 3.1 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4b7b3d..794f3cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 From 6c8115d6356371c62dd1afe80b8319f97d4e4836 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Mon, 21 Feb 2022 16:30:13 +0000 Subject: [PATCH 06/30] Increment version to 0.6.0 --- lems/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lems/__init__.py b/lems/__init__.py index ef41913..d1ffd26 100644 --- a/lems/__init__.py +++ b/lems/__init__.py @@ -7,7 +7,7 @@ logger = logging.getLogger("LEMS") -__version__ = "0.5.9" +__version__ = "0.6.0" __schema_version__ = "0.7.6" __schema_branch__ = "development" From 7c97c3c6f12670ee84680cde9239498524f6702e Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Mon, 25 Apr 2022 12:17:02 +0100 Subject: [PATCH 07/30] Ignoring files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 00f8a01..4e6d7db 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ comp_* /lems/__init__$py.class /PyLEMS.egg-info /dist +*ken.sh From d758c48be4f7bfcd53ebc373343c8d97110dca75 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Mon, 5 Sep 2022 12:46:30 +0100 Subject: [PATCH 08/30] Test on windows --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 794f3cd..0f975f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,17 +2,17 @@ name: Build on: push: - branches: [ master, development ] + branches: [ master, development, experimental ] pull_request: - branches: [ master, development ] + branches: [ master, development, experimental ] jobs: build: - runs-on: ubuntu-latest + runs-on: [ ubuntu-latest, windows-latest ] strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.9", "3.10"] steps: - uses: actions/checkout@v2 From 7296f6add18c6540bd582d10aaa09f1a2a39957f Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Mon, 5 Sep 2022 13:00:32 +0100 Subject: [PATCH 09/30] Restructure matrix --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f975f9..efe3afc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,12 @@ on: jobs: build: - runs-on: [ ubuntu-latest, windows-latest ] + runs-on: ${{ matrix.runs-on }} strategy: + fail-fast: false matrix: python-version: ["3.7", "3.9", "3.10"] + runs-on: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 From 62fe60b951fcbc1dd5f153d5c1c148426049cd60 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Mon, 5 Sep 2022 15:09:32 +0100 Subject: [PATCH 10/30] Remove line about requirements.txt No such file present and this causes fails on Windows on GHA --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efe3afc..0af1d69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest pytest-cov - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Checkout NeuroML2 uses: actions/checkout@v2 From 2af44e0604df9cda380b7f2aaf9d1bbac522ff1f Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Wed, 11 Jan 2023 15:53:18 +0000 Subject: [PATCH 11/30] Add badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c837b5..a5905a4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ ## PyLEMS -[![Build](https://github.com/LEMS/pylems/actions/workflows/ci.yml/badge.svg)](https://github.com/LEMS/pylems/actions/workflows/ci.yml) [![Documentation Status](https://readthedocs.org/projects/pylems/badge/?version=latest)](https://pylems.readthedocs.io/en/latest/?badge=latest) +[![Build](https://github.com/LEMS/pylems/actions/workflows/ci.yml/badge.svg)](https://github.com/LEMS/pylems/actions/workflows/ci.yml) +[![Check LEMS examples](https://github.com/LEMS/pylems/actions/workflows/examples.yml/badge.svg)](https://github.com/LEMS/pylems/actions/workflows/examples.yml) +[![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. From d349743d68a736afe17b2a3ace14743cff60dc31 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Thu, 19 Jan 2023 10:14:25 +0000 Subject: [PATCH 12/30] Tweaks --- .github/workflows/ci.yml | 4 ++++ README.md | 2 +- testpy2.sh | 8 -------- 3 files changed, 5 insertions(+), 9 deletions(-) delete mode 100755 testpy2.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0af1d69..1e94c4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,10 @@ jobs: run: | ./ci/run-apitest.sh + - name: Final version info + run: | + pip list + - name: Lint with flake8 run: | # Install flake diff --git a/README.md b/README.md index a5905a4..c69f816 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![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. +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: diff --git a/testpy2.sh b/testpy2.sh deleted file mode 100755 index cdee6bf..0000000 --- a/testpy2.sh +++ /dev/null @@ -1,8 +0,0 @@ -set -e -python setup.py clean -python setup.py install -python examples/apitest.py -python examples/apitest2.py -python examples/loadtest.py -python lems/dlems/exportdlems.py -python pylems -I ../NeuroML2/NeuroML2CoreTypes ../NeuroML2/LEMSexamples/LEMS_NML2_Ex5_DetCell.xml From 2f5903f4c2561598b0f66462a19c03b2b1dc1984 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Thu, 19 Jan 2023 10:19:37 +0000 Subject: [PATCH 13/30] Update actions versions --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e94c4b..654453e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,10 @@ jobs: runs-on: [ubuntu-latest, windows-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@v3 with: python-version: ${{ matrix.python-version }} @@ -30,7 +30,7 @@ jobs: python -m pip install pytest pytest-cov - name: Checkout NeuroML2 - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: NeuroML/NeuroML2 ref: development From d678696117fcfe7c9d6a882ad9568ab433511ce1 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Thu, 19 Jan 2023 10:28:25 +0000 Subject: [PATCH 14/30] Update actions versions --- .github/workflows/examples.yml | 4 ++-- .github/workflows/python-publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 7f23ed5..8c21bb6 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: nelonoel/branch-name@v1.0.1 # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions @@ -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 }} diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3bfabfc..f55528c 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -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@v3 with: python-version: '3.x' - name: Install dependencies From 39b50d4fa541db4e7b06bfeeab3fa1b86bbec6ed Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 25 Jan 2023 12:08:45 +0000 Subject: [PATCH 15/30] chore: update copyright year --- ci/run-apitest.sh | 2 +- ci/run-examples-ghactions.sh | 2 +- doc/conf.py | 2 +- lems/test/reg_test_20.py | 2 +- lems/test/test_misc.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/run-apitest.sh b/ci/run-apitest.sh index d0fe75f..7dfa607 100755 --- a/ci/run-apitest.sh +++ b/ci/run-apitest.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 LEMS contributors +# Copyright 2023 LEMS contributors # Author: Ankur Sinha # File : run-apitest.sh # diff --git a/ci/run-examples-ghactions.sh b/ci/run-examples-ghactions.sh index 0379765..f46124b 100755 --- a/ci/run-examples-ghactions.sh +++ b/ci/run-examples-ghactions.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2021 LEMS contributors +# Copyright 2023 LEMS contributors # Author: Ankur Sinha # File : run-examples-ghactions.sh # diff --git a/doc/conf.py b/doc/conf.py index 9a1c735..abacb1c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -55,7 +55,7 @@ # General information about the project. project = u"PyLEMS" -copyright = u"2021, LEMS authors and contributors" +copyright = u"2023, LEMS authors and contributors" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/lems/test/reg_test_20.py b/lems/test/reg_test_20.py index da8adf4..2c2745d 100644 --- a/lems/test/reg_test_20.py +++ b/lems/test/reg_test_20.py @@ -4,7 +4,7 @@ File: reg_test_20.py -Copyright 2021 LEMS contributors +Copyright 2023 LEMS contributors Author: Ankur Sinha """ diff --git a/lems/test/test_misc.py b/lems/test/test_misc.py index 11d76ad..e806cd6 100644 --- a/lems/test/test_misc.py +++ b/lems/test/test_misc.py @@ -3,7 +3,7 @@ File: test_misc.py -Copyright 2021 LEMS contributors +Copyright 2023 LEMS contributors Author: Ankur Sinha """ From 5b2ee95a25ebacd72a89cf456dd1e77dfeaf5b55 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 31 Jan 2023 15:53:30 +0000 Subject: [PATCH 16/30] ci(py311): add py311 to matrix and setup.py --- .github/workflows/ci.yml | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0af1d69..e08822f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.9", "3.10"] + python-version: ["3.7", "3.9", "3.10", "3.11"] runs-on: [ubuntu-latest, windows-latest] steps: diff --git a/setup.py b/setup.py index 680d0a3..0e4595f 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,7 @@ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Scientific/Engineering", ], ) From 5ea5eeb2caeb8b0a999324ba568a7ac71fef6f0f Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Fri, 3 Feb 2023 15:50:47 +0000 Subject: [PATCH 17/30] Remove old travis ci file --- .travis.yml | 54 ----------------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f45a0da..0000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -language: python - -python: - - "2.7" - - "3.7" - - "3.8" - - "3.9" - -# 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 - - git checkout development - - cd .. - - mkdir results - - -script: - ### Run main python unit tests (not many yet...) - - - pytest -v - - ### Try 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 element, i.e. use not , to work in PyLEMS - - ### Try running NeuroML 2 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... From 6e713df12e8be53737b333f3181ad31c3b1d9f79 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Tue, 21 Mar 2023 10:43:43 +0000 Subject: [PATCH 18/30] Apply black formatting --- doc/conf.py | 4 ++-- lems/base/util.py | 1 - lems/dlems/exportdlems.py | 7 ------- lems/model/component.py | 2 +- lems/model/model.py | 4 +--- lems/model/structure.py | 1 - lems/parser/LEMS.py | 1 - lems/run.py | 8 ++------ lems/sim/build.py | 1 - lems/sim/runnable.py | 3 --- lems/test/test_parser.py | 1 - lems/test/test_units.py | 1 - setup.py | 2 +- 13 files changed, 7 insertions(+), 29 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index abacb1c..9aa1931 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -54,8 +54,8 @@ master_doc = "index" # General information about the project. -project = u"PyLEMS" -copyright = u"2023, LEMS authors and contributors" +project = "PyLEMS" +copyright = "2023, LEMS authors and contributors" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/lems/base/util.py b/lems/base/util.py index cbafa72..e7ee492 100644 --- a/lems/base/util.py +++ b/lems/base/util.py @@ -50,7 +50,6 @@ def merge_lists(l, base): def validate_lems(file_name): - from lxml import etree try: diff --git a/lems/dlems/exportdlems.py b/lems/dlems/exportdlems.py index bae1a3a..40ed398 100644 --- a/lems/dlems/exportdlems.py +++ b/lems/dlems/exportdlems.py @@ -47,7 +47,6 @@ def any_svs_plotted(disp, svs): def inequality_to_condition(ineq): - r = re.compile("(.+)(?:\.([glneqt]+)\.)(.+)") s = r.search(ineq) expr = "".join([s.group(1).strip(), " - (", s.group(3).strip() + ")"]) @@ -56,7 +55,6 @@ def inequality_to_condition(ineq): def export_component(model, comp, sim_comp, parent_pop="", file_name=None): - comp_type = model.component_types[comp.type] dlems = OrderedDict() @@ -133,13 +131,11 @@ def export_component(model, comp, sim_comp, parent_pop="", file_name=None): disps = [] for d in sim_comp.children: - if ( d.type == "Display" and has_display(d, parent_pop) and any_svs_plotted(d, svs.keys()) ): - di = OrderedDict() abax = OrderedDict() abax["min"] = d.parameters["xmin"] @@ -224,11 +220,8 @@ def export_component(model, comp, sim_comp, parent_pop="", file_name=None): target_comp = model.components[target_net] if target_comp.type == "network": - for child in target_comp.children: - if child.type == "population": - comp = model.components[child.parameters["component"]] export_component(model, comp, sim_comp, child.id) diff --git a/lems/model/component.py b/lems/model/component.py index 1b5b34f..bd5ed1a 100644 --- a/lems/model/component.py +++ b/lems/model/component.py @@ -1268,7 +1268,7 @@ def toxml(self): xmlstr = ' 0 or len(fc.paths) > 0: - source_port = ( fc.texts[ev.source_port].value if ev.source_port @@ -1028,7 +1026,7 @@ def get_numeric_value(self, value_str, dimension=None): else: dimension = unit.dimension - numeric_value = (number * (10 ** unit.power) * unit.scale) + unit.offset + numeric_value = (number * (10**unit.power) * unit.scale) + unit.offset else: raise SimBuildError( "Unknown unit symbol '{0}'. Known: {1}", sym, self.units diff --git a/lems/model/structure.py b/lems/model/structure.py index de75a35..0d3a51a 100644 --- a/lems/model/structure.py +++ b/lems/model/structure.py @@ -316,7 +316,6 @@ class ForEach(LEMSBase): """ def __init__(self, instances, as_): - self.instances = instances self.as_ = as_ diff --git a/lems/parser/LEMS.py b/lems/parser/LEMS.py index a48eee9..47158aa 100644 --- a/lems/parser/LEMS.py +++ b/lems/parser/LEMS.py @@ -1063,7 +1063,6 @@ def parse_include(self, node): if self.model.debug: print("Ignoring included LEMS file: %s" % node.lattrib["file"]) else: - # TODO: remove this hard coding for reading NeuroML includes... if "file" not in node.lattrib: if "href" in node.lattrib: diff --git a/lems/run.py b/lems/run.py index c899aa3..941ae43 100644 --- a/lems/run.py +++ b/lems/run.py @@ -101,11 +101,8 @@ def main(args=None): dlems_file_name = args.lems_file + ".json" if target_comp.type == "network": - for child in target_comp.children: - if child.type == "population": - comp = model.components[child.parameters["component"]] export_component( @@ -174,7 +171,7 @@ def process_simulation_output(sim, model, options): data_output = recording.data_output times = [] vals = [] - for (x, y) in recording.values: + for x, y in recording.values: times.append(x) vals.append(y) file_times[data_output.file_name] = times @@ -234,7 +231,6 @@ def __init__(self, fig): def plot_recording(recording): - import matplotlib.pyplot as pylab import numpy @@ -246,7 +242,7 @@ def plot_recording(recording): x = numpy.empty(len(recording.values)) y = numpy.empty(len(recording.values)) i = 0 - for (xv, yv) in recording.values: + for xv, yv in recording.values: x[i] = xv / data_output.timeScale y[i] = yv / recorder.scale i = i + 1 diff --git a/lems/sim/build.py b/lems/sim/build.py index 09f3e1a..04ab3c6 100644 --- a/lems/sim/build.py +++ b/lems/sim/build.py @@ -616,7 +616,6 @@ def add_dynamics_2(self, component, runnable, regime, dynamics): # Process kinetic schemes ks_code = [] for ks in regime.kinetic_schemes: - raise NotImplementedError( "KineticScheme element is not stable in PyLEMS yet, see https://github.com/LEMS/pylems/issues/15" ) diff --git a/lems/sim/runnable.py b/lems/sim/runnable.py index daafe82..0db32ef 100644 --- a/lems/sim/runnable.py +++ b/lems/sim/runnable.py @@ -29,7 +29,6 @@ class Reflective(LEMSBase): - debug = False def __init__(self): @@ -346,7 +345,6 @@ def add_variable_recorder(self, data_output, recorder): ) def add_variable_recorder2(self, data_output, recorder, path, full_path): - if path[0] == "/": self.parent.add_variable_recorder2(data_output, recorder, path, full_path) elif path.find("../") == 0: @@ -587,7 +585,6 @@ def single_step2(self, dt): return dt def do_startup(self): - if self.debug and False: print(" Doing startup: " + self.id) for iv in self.instance_variables: diff --git a/lems/test/test_parser.py b/lems/test/test_parser.py index 4beb888..4fe5786 100644 --- a/lems/test/test_parser.py +++ b/lems/test/test_parser.py @@ -10,7 +10,6 @@ class TestParser(unittest.TestCase): def test_parser(self): - x = 0.5 exprs = {} diff --git a/lems/test/test_units.py b/lems/test/test_units.py index cb324a8..3732d3a 100644 --- a/lems/test/test_units.py +++ b/lems/test/test_units.py @@ -12,7 +12,6 @@ class TestUnitParsing(unittest.TestCase): def get_model(self): - model = Model() model.add(Dimension("voltage", m=1, l=3, t=-3, i=-1)) diff --git a/setup.py b/setup.py index 0e4595f..1e1be44 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ "lems.dlems", ], scripts=["pylems"], - data_files=[("man/man1", ['man/man1/pylems.1'])], + data_files=[("man/man1", ["man/man1/pylems.1"])], author="PyLEMS authors and contributors", author_email="gautham@lisphacker.org, p.gleeson@gmail.com", description="A Python library for working with the Low Entropy Model Specification language (LEMS)", From cb81080f58e56fe6fa0b7757c53c64b43fa0b0e5 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Tue, 21 Mar 2023 10:44:12 +0000 Subject: [PATCH 19/30] To v0.6.1 --- lems/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lems/__init__.py b/lems/__init__.py index d1ffd26..b8ad571 100644 --- a/lems/__init__.py +++ b/lems/__init__.py @@ -7,7 +7,7 @@ logger = logging.getLogger("LEMS") -__version__ = "0.6.0" +__version__ = "0.6.1" __schema_version__ = "0.7.6" __schema_branch__ = "development" From 0238efdc50ce3e9dca75b73ad2638829f23cb8c3 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Tue, 2 May 2023 10:57:16 +0100 Subject: [PATCH 20/30] Remove travis info from readme --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index c69f816..92e9545 100644 --- a/README.md +++ b/README.md @@ -99,11 +99,4 @@ Alternatively, you can obtain the latest version with - Decouple events from runnables - Improve dimension-checking on expressions. - -### Travis integration - -pylems is integrated with the the [Travis Continuous Integration service](http://travis-ci.com/). - -[![Build Status](https://travis-ci.com/LEMS/pylems.png?branch=master)](https://travis-ci.com/LEMS/pylems) - This code is distributed under the terms of the GNU Lesser General Public License. From f97b29076a2f39884b33bd99e5716a8b274e7af3 Mon Sep 17 00:00:00 2001 From: pgleeson Date: Wed, 10 May 2023 10:30:42 +0100 Subject: [PATCH 21/30] To v0.6.2 --- lems/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lems/__init__.py b/lems/__init__.py index b8ad571..0a1782d 100644 --- a/lems/__init__.py +++ b/lems/__init__.py @@ -7,7 +7,7 @@ logger = logging.getLogger("LEMS") -__version__ = "0.6.1" +__version__ = "0.6.2" __schema_version__ = "0.7.6" __schema_branch__ = "development" From 3345bab2dfe9bef41930d1e7055be94cbeb0d690 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 10 May 2023 12:26:25 +0100 Subject: [PATCH 22/30] fix(rtd): add conf file see: https://github.com/readthedocs/readthedocs.org/issues/10290#issuecomment-1535120995 --- .readthedocs.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..ae78afd --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,15 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + + +sphinx: + configuration: doc/conf.py + + +python: + install: + - requirements: doc/requirements.txt From 428cd28c417194f07f3e9da66ac9c9fe72eea021 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 14 Jun 2023 11:51:16 +0100 Subject: [PATCH 23/30] feat: migrate away from deprecated setup.py --- .gitignore | 3 ++- MANIFEST.in | 1 + lems/__init__.py | 8 ++++++-- pylems | 13 ------------- pyproject.toml | 3 +++ setup.cfg | 40 ++++++++++++++++++++++++++++++++++++++++ setup.py | 45 --------------------------------------------- 7 files changed, 52 insertions(+), 61 deletions(-) delete mode 100755 pylems create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 4e6d7db..b266466 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ doc/_build comp_* /lems/test/hhcell_resaved3.xml /lems/__init__$py.class -/PyLEMS.egg-info +*PyLEMS.egg-info /dist *ken.sh +*.whl diff --git a/MANIFEST.in b/MANIFEST.in index f8d036b..8b34167 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,3 +2,4 @@ include README.md include examples/*.xml include examples/*.py include LICENSE.lesser +recursive-include man *.1 diff --git a/lems/__init__.py b/lems/__init__.py index 0a1782d..b7040f9 100644 --- a/lems/__init__.py +++ b/lems/__init__.py @@ -4,11 +4,15 @@ """ import logging +try: + import importlib.metadata + __version__ = importlib.metadata.version("PyLEMS") +except ImportError: + import importlib_metadata + __version__ = importlib_metadata.version("PyLEMS") logger = logging.getLogger("LEMS") -__version__ = "0.6.2" - __schema_version__ = "0.7.6" __schema_branch__ = "development" __schema_location__ = ( diff --git a/pylems b/pylems deleted file mode 100755 index f15939e..0000000 --- a/pylems +++ /dev/null @@ -1,13 +0,0 @@ -#! /usr/bin/env python -""" -PyLEMS command line startup script. - -@author: Gautham Ganapathy -@organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) -@contact: gautham@lisphacker.org -""" - -from lems.run import main - -if __name__ == '__main__': - main() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fed528d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 72248c8..6ba14dd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,45 @@ +[metadata] +name = PyLEMS +version = 0.6.2 +author = PyLEMS authors and contributors +author_email = gautham@lisphacker.org, p.gleeson@gmail.com +maintainer_email = p.gleeson@gmail.com +url = https://github.com/LEMS/pylems +description = A Python library for working with the Low Entropy Model Specification language (LEMS) +long_description = file: README.md, LICENSE.lesser +classifiers = + Intended Audience :: Science/Research + License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3) + Natural Language :: English + Operating System :: OS Independent + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Topic :: Scientific/Engineering +license = LGPL-3.0-only + +[options] +install_requires = + lxml + typing; python_version<"3.5" + +packages = find: + +[options.packages.find] +where = . +include = lems* + +[options.entry_points] +console_scripts = + pylems = lems.run:main + + [flake8] # ignore: # spacing around operators, comment blocks, in argument lists # lines too long ignore = E501,E502,F403,F405,E231,E228,E225,E226,E265,E261 + diff --git a/setup.py b/setup.py deleted file mode 100644 index 1e1be44..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- - -from setuptools import setup - -long_description = open("README.md").read() - -import lems - -version = lems.__version__ - -setup( - name="PyLEMS", - version=version, - packages=[ - "lems", - "lems.base", - "lems.model", - "lems.parser", - "lems.sim", - "lems.dlems", - ], - scripts=["pylems"], - data_files=[("man/man1", ["man/man1/pylems.1"])], - author="PyLEMS authors and contributors", - author_email="gautham@lisphacker.org, p.gleeson@gmail.com", - description="A Python library for working with the Low Entropy Model Specification language (LEMS)", - long_description=long_description, - long_description_content_type="text/markdown", - install_requires=["lxml", 'typing; python_version<"3.5"'], - license="LGPL", - url="https://github.com/LEMS/pylems", - classifiers=[ - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering", - ], -) From 24104c6d24b72795152295f051bd3242c46e67c1 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 14 Jun 2023 12:00:38 +0100 Subject: [PATCH 24/30] chore: use installed pylems script --- Makefile | 28 +++++++++++----------- ci/run-examples-ghactions.sh | 46 ++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 9f172b0..07bb5cf 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/ci/run-examples-ghactions.sh b/ci/run-examples-ghactions.sh index f46124b..dcdfb8b 100755 --- a/ci/run-examples-ghactions.sh +++ b/ci/run-examples-ghactions.sh @@ -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 element, i.e. use not , 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... From c9a3e977fe1c3e0d1c05a7ecbf2a743dc9955de2 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 14 Jun 2023 15:28:42 +0100 Subject: [PATCH 25/30] chore: remove duplicate flake config, remove setup.py from docs --- .flake8 | 2 -- README.md | 7 ++----- setup.cfg | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 39fa7d4..0000000 --- a/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -exclude = NeuroML2 diff --git a/README.md b/README.md index 92e9545..73e5187 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,13 @@ A stable version of PyLEMS is [available on PyPI](https://pypi.python.org/pypi/P pip install pylems -To install as root: - - sudo 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 + pip install . + ### Usage as a LEMS model simulator diff --git a/setup.cfg b/setup.cfg index 6ba14dd..c12cd26 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,4 +42,3 @@ console_scripts = # spacing around operators, comment blocks, in argument lists # lines too long ignore = E501,E502,F403,F405,E231,E228,E225,E226,E265,E261 - From 5e16adc80bf4b2a169d01eb0b557f24d2f3c1976 Mon Sep 17 00:00:00 2001 From: pgleeson Date: Fri, 16 Jun 2023 16:50:41 +0100 Subject: [PATCH 26/30] To 0.6.3 and test on macos --- .github/workflows/ci.yml | 2 +- ci/run-apitest.sh | 8 ++++++-- setup.cfg | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef404cc..34dcad1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: python-version: ["3.7", "3.9", "3.10", "3.11"] - runs-on: [ubuntu-latest, windows-latest] + runs-on: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v3 diff --git a/ci/run-apitest.sh b/ci/run-apitest.sh index 7dfa607..48666b1 100755 --- a/ci/run-apitest.sh +++ b/ci/run-apitest.sh @@ -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 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index c12cd26..58c8c02 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = PyLEMS -version = 0.6.2 +version = 0.6.3 author = PyLEMS authors and contributors author_email = gautham@lisphacker.org, p.gleeson@gmail.com maintainer_email = p.gleeson@gmail.com From 16e725ca3887d5fbe9e799058fb608aa793963e8 Mon Sep 17 00:00:00 2001 From: pgleeson Date: Thu, 22 Jun 2023 17:27:26 +0100 Subject: [PATCH 27/30] Fix formatting for README.md and bump to v0.6.4 fornew release --- README.md | 27 +++++++++++++-------------- setup.cfg | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 73e5187..6919e7f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ [![Check LEMS examples](https://github.com/LEMS/pylems/actions/workflows/examples.yml/badge.svg)](https://github.com/LEMS/pylems/actions/workflows/examples.yml) [![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 models (see [here](https://docs.neuroml.org/Userdocs/Software/pyLEMS.html)). For more about PyLEMS see: @@ -21,33 +20,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 +``` +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 - pip 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 @@ -70,7 +71,6 @@ Alternatively, you can obtain the latest version with - Example 17 -- Working - Example 18 -- Working - **LEMS examples (in directory examples)** - example1.xml -- Working @@ -79,9 +79,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 `` element, - i.e. use `` not ``, to work in PyLEMS +TODO: Rest of examples require an update to the `` element, i.e. use `` not ``, to work in PyLEMS **LEMS elements that do not work** diff --git a/setup.cfg b/setup.cfg index 58c8c02..7fa4fa8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = PyLEMS -version = 0.6.3 +version = 0.6.4 author = PyLEMS authors and contributors author_email = gautham@lisphacker.org, p.gleeson@gmail.com maintainer_email = p.gleeson@gmail.com From 67d4d3cc124ab98738a3b27e9386ffd77920376e Mon Sep 17 00:00:00 2001 From: pgleeson Date: Thu, 22 Jun 2023 17:55:39 +0100 Subject: [PATCH 28/30] Add long_description_content_type --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 7fa4fa8..3068171 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,8 @@ author_email = gautham@lisphacker.org, p.gleeson@gmail.com maintainer_email = p.gleeson@gmail.com url = https://github.com/LEMS/pylems description = A Python library for working with the Low Entropy Model Specification language (LEMS) -long_description = file: README.md, LICENSE.lesser +long_description = file: README.md +long_description_content_type=text/markdown classifiers = Intended Audience :: Science/Research License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3) From 03027dfb9323e63ba837f1bd22cd38dc5ca3cd35 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 26 Jul 2023 13:23:58 +0100 Subject: [PATCH 29/30] chore(ci): bump GH actions --- .github/workflows/ci.yml | 2 +- .github/workflows/python-publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34dcad1..64978c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index f55528c..7d29880 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install dependencies From b8052aa5e81b0573ee61fbe89edc95c79355cd20 Mon Sep 17 00:00:00 2001 From: Padraig Gleeson Date: Wed, 26 Jul 2023 14:07:04 +0100 Subject: [PATCH 30/30] Tweak to formatting --- lems/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lems/__init__.py b/lems/__init__.py index b7040f9..c5218e9 100644 --- a/lems/__init__.py +++ b/lems/__init__.py @@ -4,11 +4,14 @@ """ import logging + try: import importlib.metadata + __version__ = importlib.metadata.version("PyLEMS") except ImportError: import importlib_metadata + __version__ = importlib_metadata.version("PyLEMS") logger = logging.getLogger("LEMS")