Skip to content

Commit

Permalink
Merge pull request #60 from ModECI/development
Browse files Browse the repository at this point in the history
To v0.3.2
  • Loading branch information
pgleeson authored Sep 12, 2023
2 parents 1844dea + 97832b3 commit e158706
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 45 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 }}

Expand Down Expand Up @@ -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: |
Expand All @@ -78,7 +74,6 @@ jobs:
cd examples
python Example1.py
- name: Install MDF
run: |
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,4 +69,3 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

59 changes: 33 additions & 26 deletions docs/contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,57 @@
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
requests_status = "unsuccessful"
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)
7 changes: 5 additions & 2 deletions docs/sphinx/source/api/Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
5 changes: 5 additions & 0 deletions examples/neuroml2/.test.validate.omt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]
maintainer = Padraig Gleeson; ...
maintainer = Padraig Gleeson, David Turner
maintainer_email = [email protected]
license = LGPLv3
license_files = LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/modelspec/__init__.py
Original file line number Diff line number Diff line change
@@ -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_

Expand Down
7 changes: 7 additions & 0 deletions test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e158706

Please sign in to comment.