Skip to content

Commit e158706

Browse files
authored
Merge pull request #60 from ModECI/development
To v0.3.2
2 parents 1844dea + 97832b3 commit e158706

File tree

8 files changed

+76
-45
lines changed

8 files changed

+76
-45
lines changed

.github/workflows/ci.yml

+22-12
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
name: Format
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v1
16-
- uses: actions/setup-python@v2
17-
- uses: pre-commit/action@v2.0.0
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v3
17+
- uses: pre-commit/action@v3.0.0
1818
with:
1919
extra_args: --hook-stage manual --all-files
2020

@@ -28,9 +28,9 @@ jobs:
2828
runs-on: [ubuntu-latest, macos-latest, windows-latest]
2929

3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v2
33+
uses: actions/setup-python@v3
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636

@@ -60,11 +60,7 @@ jobs:
6060
cd ../neuroml2
6161
python neuroml2_spec.py
6262
63-
pip install pyneuroml
64-
65-
# Requires: pip install pyneuroml
66-
pynml -validate hello_world_neuroml.net.nml
67-
pynml -validate TestNeuroML.xml
63+
# Note: NeuroML files will be validated with OMV below
6864
6965
- name: Run pytest
7066
run: |
@@ -78,7 +74,6 @@ jobs:
7874
cd examples
7975
python Example1.py
8076
81-
8277
- name: Install MDF
8378
run: |
8479
@@ -89,8 +84,9 @@ jobs:
8984
python arrays.py -run # test one example
9085
9186
- name: Build Documentation
87+
if: ${{ matrix.python-version != '3.7'}}
9288
run: |
93-
89+
# Note: contributors generation below fails on py 3.7 due to pandas version...
9490
pip install .[docs]
9591
cd docs
9692
python generate.py
@@ -99,6 +95,20 @@ jobs:
9995
make clean
10096
make html
10197
98+
- name: Install and test with OMV
99+
if: ${{ matrix.runs-on != 'windows-latest' }}
100+
run: |
101+
# Note: OMV not well tested on Windows...
102+
103+
pip install git+https://github.com/OpenSourceBrain/osb-model-validation
104+
pip install scipy sympy matplotlib cython pandas tables
105+
106+
# Run OMV tests on all engines
107+
cd examples
108+
omv all -V
109+
110+
omv list -V # list installed engines
111+
102112
- name: Final version info
103113
run: |
104114
pip list

.github/workflows/static.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Checkout
3333
uses: actions/checkout@v3
3434

35-
- name: Set up Python
35+
- name: Set up Python
3636
uses: actions/setup-python@v2
3737
with:
3838
python-version: 3.9
@@ -69,4 +69,3 @@ jobs:
6969
- name: Deploy to GitHub Pages
7070
id: deployment
7171
uses: actions/deploy-pages@v2
72-

docs/contributors.py

+33-26
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,57 @@
1717
len_per_info = len(per_info)
1818

1919
empty_list = []
20+
max_tries = 100
21+
2022
for i in range(len_per_info):
2123
url = per_info[i]
2224
print(url)
2325
data = requests.get(url=url)
2426
requests_status = "unknown"
25-
while (requests_status == "unknown") or (requests_status == "unsuccessful"):
27+
while max_tries > 0 and (
28+
(requests_status == "unknown") or (requests_status == "unsuccessful")
29+
):
2630
if data.status_code == 200:
2731
requests_status = "successful"
32+
print(" Received: %s" % data.json())
2833
empty_list.append(data.json())
2934
else:
3035
# handle failure on requests to the url for mac os
3136
requests_status = "unsuccessful"
3237
print(f"Failed to get data from: {url}")
3338
# make request again to get data from the url
3439
data = requests.get(url=url)
40+
max_tries -= 1
3541

36-
df1 = pd.DataFrame(empty_list)
37-
df1["name"] = df1["name"].fillna("")
38-
name = df1["name"]
39-
login = df1["login"]
40-
url_html = df1["html_url"]
41-
url_id = df1["id"]
42+
if len(empty_list) > 0:
43+
df1 = pd.DataFrame(empty_list)
44+
df1["name"] = df1["name"].fillna(df1["login"])
45+
name = df1["name"]
46+
login = df1["login"]
47+
url_html = df1["html_url"]
48+
url_id = df1["id"]
4249

43-
login_html = list(zip(name, login, url_html))
44-
zip_dict = dict(zip(url_id, login_html))
50+
login_html = list(zip(name, login, url_html))
51+
zip_dict = dict(zip(url_id, login_html))
4552

46-
file = "sphinx/source/api/Contributors.md"
47-
with open(file, "w") as f:
48-
print(
49-
textwrap.dedent(
50-
"""\
51-
(Modelspec:contributors)=
53+
file = "sphinx/source/api/Contributors.md"
54+
with open(file, "w") as f:
55+
print(
56+
textwrap.dedent(
57+
"""\
58+
(Modelspec:contributors)=
5259
53-
# Modelspec contributors
60+
# Modelspec contributors
5461
55-
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
56-
This page is generated periodically, most recently on {}.""".format(
57-
date.today()
58-
)
59-
),
60-
file=f,
61-
)
62+
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
63+
This page is generated periodically, most recently on {}.""".format(
64+
date.today()
65+
)
66+
),
67+
file=f,
68+
)
6269

63-
print("", file=f)
70+
print("", file=f)
6471

65-
for key, val in zip_dict.items():
66-
print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f)
72+
for key, val in zip_dict.items():
73+
print("- {} ([@{}]({}))".format(val[0], val[1], val[2]), file=f)

docs/sphinx/source/api/Contributors.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
# Modelspec contributors
44

55
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
6-
This page is generated periodically, most recently on 2023-07-05.
6+
This page is generated periodically, most recently on 2023-09-12.
77

88
- Padraig Gleeson ([@pgleeson](https://github.com/pgleeson))
9+
- Manifest Chakalov ([@mqnifestkelvin](https://github.com/mqnifestkelvin))
910
- David Turner ([@davidt0x](https://github.com/davidt0x))
11+
- Peace Ododo ([@Onoyiza](https://github.com/Onoyiza))
1012
- Parikshit Singh Rathore ([@parikshit14](https://github.com/parikshit14))
11-
- Katherine Mantel ([@kmantel](https://github.com/kmantel))
13+
- Ankur Sinha ([@sanjayankur31](https://github.com/sanjayankur31))
14+
- kmantel ([@kmantel](https://github.com/kmantel))

examples/neuroml2/.test.validate.omt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Script for running automated tests on OSB using Travis-CI, see https://github.com/OpenSourceBrain/osb-model-validation
2+
3+
# This test will validate NeuroML 2 files in the current directory using: jnml -validate *.nml
4+
target: "*.nml TestNeuroML.xml"
5+
engine: jNeuroML_validate

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ description = A common JSON/YAML based format for compact model specification
55
long_description = file: README.md
66
long_description_content_type = text/markdown
77
url = https://github.com/ModECI/modelspec
8-
author = Padraig Gleeson; ...
8+
author = ModECI contributors
99
author_email = [email protected]
10-
maintainer = Padraig Gleeson; ...
10+
maintainer = Padraig Gleeson, David Turner
1111
maintainer_email = [email protected]
1212
license = LGPLv3
1313
license_files = LICENSE

src/modelspec/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.3.1"
1+
__version__ = "0.3.2"
22

33
from .base_types import Base, define, has, field, fields, optional, instance_of, in_
44

test_all.sh

+7
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,21 @@ cd ../..
3131

3232
pytest tests -v
3333

34+
## Run OMV tests
35+
36+
omv all -V
37+
3438

3539
## Generate the docs
3640

3741
cd docs
3842
python generate.py
43+
python contributors.py
3944
cd sphinx
4045
make clean
4146
make html
4247
cd ..
4348

49+
## Format all file
50+
4451
pre-commit run --all-files

0 commit comments

Comments
 (0)