diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8146db18..c3d8cf85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,9 @@ jobs: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.0 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 with: extra_args: --hook-stage manual --all-files @@ -28,9 +28,9 @@ jobs: runs-on: [ubuntu-latest, macos-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 }} @@ -60,11 +60,7 @@ jobs: cd ../neuroml2 python neuroml2_spec.py - pip install pyneuroml - - # Requires: pip install pyneuroml - pynml -validate hello_world_neuroml.net.nml - pynml -validate TestNeuroML.xml + # Note: NeuroML files will be validated with OMV below - name: Run pytest run: | @@ -78,7 +74,6 @@ jobs: cd examples python Example1.py - - name: Install MDF run: | @@ -89,8 +84,9 @@ jobs: python arrays.py -run # test one example - name: Build Documentation + if: ${{ matrix.python-version != '3.7'}} run: | - + # Note: contributors generation below fails on py 3.7 due to pandas version... pip install .[docs] cd docs python generate.py @@ -99,6 +95,20 @@ jobs: make clean make html + - name: Install and test with OMV + if: ${{ matrix.runs-on != 'windows-latest' }} + run: | + # Note: OMV not well tested on Windows... + + pip install git+https://github.com/OpenSourceBrain/osb-model-validation + pip install scipy sympy matplotlib cython pandas tables + + # Run OMV tests on all engines + cd examples + omv all -V + + omv list -V # list installed engines + - name: Final version info run: | pip list diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 75d8b336..e146eb91 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -32,7 +32,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Set up Python + - name: Set up Python uses: actions/setup-python@v2 with: python-version: 3.9 @@ -69,4 +69,3 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 - diff --git a/docs/contributors.py b/docs/contributors.py index 251badc3..f472f3b9 100644 --- a/docs/contributors.py +++ b/docs/contributors.py @@ -17,14 +17,19 @@ len_per_info = len(per_info) empty_list = [] +max_tries = 100 + for i in range(len_per_info): url = per_info[i] print(url) data = requests.get(url=url) requests_status = "unknown" - while (requests_status == "unknown") or (requests_status == "unsuccessful"): + while max_tries > 0 and ( + (requests_status == "unknown") or (requests_status == "unsuccessful") + ): if data.status_code == 200: requests_status = "successful" + print(" Received: %s" % data.json()) empty_list.append(data.json()) else: # handle failure on requests to the url for mac os @@ -32,35 +37,37 @@ print(f"Failed to get data from: {url}") # make request again to get data from the url data = requests.get(url=url) + max_tries -= 1 -df1 = pd.DataFrame(empty_list) -df1["name"] = df1["name"].fillna("") -name = df1["name"] -login = df1["login"] -url_html = df1["html_url"] -url_id = df1["id"] +if len(empty_list) > 0: + df1 = pd.DataFrame(empty_list) + df1["name"] = df1["name"].fillna(df1["login"]) + name = df1["name"] + login = df1["login"] + url_html = df1["html_url"] + url_id = df1["id"] -login_html = list(zip(name, login, url_html)) -zip_dict = dict(zip(url_id, login_html)) + login_html = list(zip(name, login, url_html)) + zip_dict = dict(zip(url_id, login_html)) -file = "sphinx/source/api/Contributors.md" -with open(file, "w") as f: - print( - textwrap.dedent( - """\ - (Modelspec:contributors)= + file = "sphinx/source/api/Contributors.md" + with open(file, "w") as f: + print( + textwrap.dedent( + """\ + (Modelspec:contributors)= - # Modelspec contributors + # Modelspec contributors - This page list names and Github profiles of contributors to Modelspec, listed in no particular order. - This page is generated periodically, most recently on {}.""".format( - date.today() - ) - ), - file=f, - ) + This page list names and Github profiles of contributors to Modelspec, listed in no particular order. + This page is generated periodically, most recently on {}.""".format( + date.today() + ) + ), + file=f, + ) - print("", file=f) + print("", file=f) - for key, val in zip_dict.items(): - print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f) + for key, val in zip_dict.items(): + print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f) diff --git a/docs/sphinx/source/api/Contributors.md b/docs/sphinx/source/api/Contributors.md index b743cde1..e64cc00e 100644 --- a/docs/sphinx/source/api/Contributors.md +++ b/docs/sphinx/source/api/Contributors.md @@ -3,9 +3,12 @@ # Modelspec contributors This page list names and Github profiles of contributors to Modelspec, listed in no particular order. -This page is generated periodically, most recently on 2023-07-05. +This page is generated periodically, most recently on 2023-09-12. - Padraig Gleeson ([@pgleeson](https://github.com/pgleeson)) +- Manifest Chakalov ([@mqnifestkelvin](https://github.com/mqnifestkelvin)) - David Turner ([@davidt0x](https://github.com/davidt0x)) +- Peace Ododo ([@Onoyiza](https://github.com/Onoyiza)) - Parikshit Singh Rathore ([@parikshit14](https://github.com/parikshit14)) -- Katherine Mantel ([@kmantel](https://github.com/kmantel)) +- Ankur Sinha ([@sanjayankur31](https://github.com/sanjayankur31)) +- kmantel ([@kmantel](https://github.com/kmantel)) diff --git a/examples/neuroml2/.test.validate.omt b/examples/neuroml2/.test.validate.omt new file mode 100644 index 00000000..a5fe151d --- /dev/null +++ b/examples/neuroml2/.test.validate.omt @@ -0,0 +1,5 @@ +# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation + +# This test will validate NeuroML 2 files in the current directory using: jnml -validate *.nml +target: "*.nml TestNeuroML.xml" +engine: jNeuroML_validate diff --git a/setup.cfg b/setup.cfg index 3b764297..8d8f84cf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,9 +5,9 @@ description = A common JSON/YAML based format for compact model specification long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/ModECI/modelspec -author = Padraig Gleeson; ... +author = ModECI contributors author_email = p.gleeson@gmail.com -maintainer = Padraig Gleeson; ... +maintainer = Padraig Gleeson, David Turner maintainer_email = p.gleeson@gmail.com license = LGPLv3 license_files = LICENSE diff --git a/src/modelspec/__init__.py b/src/modelspec/__init__.py index 3421eb5d..8f33cf5a 100644 --- a/src/modelspec/__init__.py +++ b/src/modelspec/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.3.1" +__version__ = "0.3.2" from .base_types import Base, define, has, field, fields, optional, instance_of, in_ diff --git a/test_all.sh b/test_all.sh index 824b994b..0a91b46b 100755 --- a/test_all.sh +++ b/test_all.sh @@ -31,14 +31,21 @@ cd ../.. pytest tests -v +## Run OMV tests + +omv all -V + ## Generate the docs cd docs python generate.py +python contributors.py cd sphinx make clean make html cd .. +## Format all file + pre-commit run --all-files