Skip to content

Commit 21a644e

Browse files
authored
Merge pull request #74 from ModECI/development
To v0.3.4, mainly code cleanup & tests on mac14/py3.12
2 parents c67ef05 + c928fb6 commit 21a644e

File tree

17 files changed

+69
-86
lines changed

17 files changed

+69
-86
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ jobs:
1212
name: Format
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v3
17-
- uses: pre-commit/[email protected]
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.10"
19+
- uses: pre-commit/[email protected]
1820
with:
1921
extra_args: --hook-stage manual --all-files
2022

@@ -24,16 +26,25 @@ jobs:
2426
strategy:
2527
fail-fast: false
2628
matrix:
27-
python-version: [ "3.8", "3.9", "3.10", "3.11"]
29+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
2830
runs-on: [ubuntu-latest, macos-latest, windows-latest]
31+
exclude:
32+
- runs-on: macos-latest
33+
python-version: "3.8"
34+
- runs-on: macos-latest
35+
python-version: "3.9"
2936

3037
steps:
31-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
3239
- name: Set up Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v3
40+
uses: actions/setup-python@v5
3441
with:
3542
python-version: ${{ matrix.python-version }}
3643

44+
- name: Install HDF5 for pytables on macos-14
45+
if: ${{ matrix.runs-on == 'macos-latest' }}
46+
run: |
47+
brew install hdf5
3748
3849
- name: Install package
3950
run: |
@@ -52,12 +63,12 @@ jobs:
5263
run: |
5364
cd examples
5465
python document.py
66+
git diff
5567
5668
cd test
5769
python test.py
5870
5971
- name: Test NeuroML examples
60-
if: ${{ matrix.python-version != '3.7'}}
6172
run: |
6273
6374
cd examples/neuroml2
@@ -66,7 +77,6 @@ jobs:
6677
# Note: NeuroML files will be validated with OMV below
6778
6879
- name: Test SBML examples
69-
if: ${{ matrix.python-version != '3.7'}}
7080
run: |
7181
7282
cd examples/sbml
@@ -76,11 +86,11 @@ jobs:
7686
run: |
7787
pytest tests -v
7888
79-
- name: Install & test NeuroMLlite
89+
- name: Test NeuroMLlite
8090
run: |
8191
git clone --branch development https://github.com/NeuroML/NeuroMLlite.git
8292
cd NeuroMLlite
83-
#pip install . # Use versions of neuroml libs as set in setup.py
93+
# pip install . # Use versions of neuroml libs as set in modelspec's setup.cfg -> dev -> NeuroMLlite
8494
cd examples
8595
python Example1.py
8696
@@ -94,7 +104,6 @@ jobs:
94104
python arrays.py -run # test one example
95105
96106
- name: Build Documentation
97-
if: ${{ matrix.python-version != '3.7'}}
98107
run: |
99108
# Note: contributors generation below fails on py 3.7 due to pandas version...
100109
pip install .[docs]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,4 @@ cython_debug/
164164
/examples/document.specification.bson
165165
/examples/neuroml2/hello_world.v.dat
166166
/examples/sbml/example_sbml_test.xml
167+
/updatelibs.sh

docs/contributors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import requests
22
import pandas as pd
3-
import json
43
import textwrap
54
from datetime import date
65

docs/sphinx/source/api/Contributors.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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-12-13.
6+
This page is generated periodically, most recently on 2024-04-25.
77

88
- Padraig Gleeson ([@pgleeson](https://github.com/pgleeson))
99
- Manifest Chakalov ([@mqnifestkelvin](https://github.com/mqnifestkelvin))
@@ -12,3 +12,4 @@ This page is generated periodically, most recently on 2023-12-13.
1212
- Parikshit Singh Rathore ([@parikshit14](https://github.com/parikshit14))
1313
- Ankur Sinha ([@sanjayankur31](https://github.com/sanjayankur31))
1414
- kmantel ([@kmantel](https://github.com/kmantel))
15+
- Robert Vickerstaff ([@robertvi](https://github.com/robertvi))

docs/sphinx/source/api/examples/document.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
from modelspec.base_types import Base
44
from typing import List
55
import sys
6+
import json
7+
import yaml
8+
import bson
69

710
# Example showing how to create a model of a document and use it to create/serialize instances
811

@@ -96,9 +99,6 @@ class Document(Base):
9699
print("\n >> Generating specification in dict form...")
97100
doc_dict = doc.generate_documentation(format="dict")
98101

99-
import json
100-
import yaml
101-
import bson
102102

103103
with open("document.specification.json", "w") as d:
104104
d.write(json.dumps(doc_dict, indent=4))

examples/document.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
from modelspec.base_types import Base
44
from typing import List
55
import sys
6+
import json
7+
import yaml
8+
import bson
69

710
# Example showing how to create a model of a document and use it to create/serialize instances
811

@@ -96,9 +99,6 @@ class Document(Base):
9699
print("\n >> Generating specification in dict form...")
97100
doc_dict = doc.generate_documentation(format="dict")
98101

99-
import json
100-
import yaml
101-
import bson
102102

103103
with open("document.specification.json", "w") as d:
104104
d.write(json.dumps(doc_dict, indent=4))

examples/neuroml2/neuroml2_spec.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class neuroml(Base):
128128

129129

130130
if __name__ == "__main__":
131-
132131
nml_doc = neuroml(id="TestNeuroML")
133132

134133
izh = izhikevich2007Cell(

examples/sbml/sbml32spec.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ class SBase(Base):
8282

8383
@modelspec.define
8484
class SBaseWithId(SBase):
85-
8685
id: str = field(default=None, validator=optional([instance_of(str), valid_sid]))
8786

8887

examples/sbml/sbml_validators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def valid_kind(instance, attribute, value):
22-
if not value in sbml_si_units:
22+
if value not in sbml_si_units:
2323
raise ValueError(
2424
f"kind {value} must be one of the standard SI units: {sbml_si_units}"
2525
)
@@ -168,7 +168,6 @@ def validate_sbml(doc, units_consistency: bool = False) -> None:
168168

169169

170170
if __name__ == "__main__":
171-
172171
import libsbml
173172

174173
sbml_file = sys.argv[1]

examples/sbml/test_sbml3.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import json
99
import yaml
10-
import os
1110

1211
from sbml32spec import *
1312

0 commit comments

Comments
 (0)