Skip to content

Commit c67ef05

Browse files
authored
Merge pull request #65 from ModECI/development
To v0.3.3; XML export & sbml, neuroml examples
2 parents e158706 + 490505e commit c67ef05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6013
-113
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
python-version: [ "3.7", "3.8", "3.9", "3.10"]
27+
python-version: [ "3.8", "3.9", "3.10", "3.11"]
2828
runs-on: [ubuntu-latest, macos-latest, windows-latest]
2929

3030
steps:
@@ -34,6 +34,7 @@ jobs:
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636

37+
3738
- name: Install package
3839
run: |
3940
python -m pip install --upgrade pip
@@ -47,24 +48,33 @@ jobs:
4748
run: |
4849
pip list
4950
50-
- name: Run some examples
51+
- name: Run simple examples
5152
run: |
5253
cd examples
5354
python document.py
5455
5556
cd test
5657
python test.py
5758
58-
## Test NeuroML example
59+
- name: Test NeuroML examples
60+
if: ${{ matrix.python-version != '3.7'}}
61+
run: |
5962
60-
cd ../neuroml2
63+
cd examples/neuroml2
6164
python neuroml2_spec.py
6265
6366
# Note: NeuroML files will be validated with OMV below
6467
68+
- name: Test SBML examples
69+
if: ${{ matrix.python-version != '3.7'}}
70+
run: |
71+
72+
cd examples/sbml
73+
./regenerateAndTest.sh
74+
6575
- name: Run pytest
6676
run: |
67-
pytest tests
77+
pytest tests -v
6878
6979
- name: Install & test NeuroMLlite
7080
run: |

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: actions/checkout@v3
3434

3535
- name: Set up Python
36-
uses: actions/setup-python@v2
36+
uses: actions/setup-python@v4
3737
with:
3838
python-version: 3.9
3939

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,4 @@ cython_debug/
163163
.idea/
164164
/examples/document.specification.bson
165165
/examples/neuroml2/hello_world.v.dat
166+
/examples/sbml/example_sbml_test.xml

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Modelspec
22

3-
43
[![Continuous builds](https://github.com/ModECI/modelspec/actions/workflows/ci.yml/badge.svg)](https://github.com/ModECI/modelspec/actions/workflows/ci.yml) [![PyPI](https://img.shields.io/pypi/v/modelspec)](https://pypi.org/project/modelspec/)
54

6-
7-
Functionality for specifying the structure of models & enabling automatic serialization to them (e.g. in JSON and YAML format).
5+
Functionality for specifying the allowed structure of models, facilitating the creation of APIs in Python for handling the models & enabling automatic serialization of instances of them (e.g. in JSON and YAML format).
86

97
This package is being used by [NeuroMLlite](https://github.com/NeuroML/NeuroMLlite) & [MDF](https://github.com/ModECI/MDF).
108

docs/sphinx/source/api/Contributors.md

Lines changed: 1 addition & 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-09-12.
6+
This page is generated periodically, most recently on 2023-12-13.
77

88
- Padraig Gleeson ([@pgleeson](https://github.com/pgleeson))
99
- Manifest Chakalov ([@mqnifestkelvin](https://github.com/mqnifestkelvin))

docs/sphinx/source/api/Introduction.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Modelspec
22

3-
43
[![Continuous builds](https://github.com/ModECI/modelspec/actions/workflows/ci.yml/badge.svg)](https://github.com/ModECI/modelspec/actions/workflows/ci.yml) [![PyPI](https://img.shields.io/pypi/v/modelspec)](https://pypi.org/project/modelspec/)
54

6-
7-
Functionality for specifying the structure of models & enabling automatic serialization to them (e.g. in JSON and YAML format).
5+
Functionality for specifying the allowed structure of models, facilitating the creation of APIs in Python for handling the models & enabling automatic serialization of instances of them (e.g. in JSON and YAML format).
86

97
This package is being used by [NeuroMLlite](https://github.com/NeuroML/NeuroMLlite) & [MDF](https://github.com/ModECI/MDF).
108

docs/sphinx/source/api/Quickstart.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ More details, and importantly, how to set up a [virtual environment](https://vir
1515

1616
### Simple example
1717

18-
A basic example which illustrates how to create the specification for a document(model) and create serialized instances can be found [here](examples/README).
18+
A basic example which illustrates how to create the specification for a document (i.e. the model definition for a document) and create serialized instances can be found [here](examples/README).
1919

2020
### Serialization formats
2121

22-
Python scripts can be used to generate the specification of a type of model(e.g. [this](https://github.com/ModECI/modelspec/blob/main/examples/document.py)), but the models are saved in standardized format in either text based [JSON](https://github.com/ModECI/modelspec/blob/main/examples/document.json) or [YAML](https://github.com/ModECI/modelspec/blob/main/examples/document.yaml) formats or in binary [BSON](https://github.com/ModECI/modelspec/blob/main/examples/document.bson) format. Support for XML serialization is under development.
22+
Python scripts can be used to generate the specification of a type of model (e.g. [this](https://github.com/ModECI/modelspec/blob/main/examples/document.py)), but the models are saved in standardized format in either text based ([JSON](https://github.com/ModECI/modelspec/blob/main/examples/document.json) or [YAML](https://github.com/ModECI/modelspec/blob/main/examples/document.yaml)) formats or in binary ([BSON](https://github.com/ModECI/modelspec/blob/main/examples/document.bson)) format. Support for [XML](https://github.com/ModECI/modelspec/blob/main/examples/document.xml) serialization has recently been added.
2323

2424
### Current formats using modelspec
2525

26-
#### MDF
26+
#### MDF (Model Description Format)
2727

28-
MDF uses modelspec to create the structure of its models and convert the models into serialized formats such as JSON, YAML, and BSON.
28+
[ModECI's MDF](https://modeci.org/quickstart) uses modelspec to create the structure of its models and convert the models into serialized formats such as JSON, YAML, and BSON.
2929

3030
#### NeuroML
3131

32-
NeuroMLlite uses modelspec to create the structure of its models and convert the models into serialize formats such as JSON, YAML, and BSON.
32+
[NeuroMLlite](https://github.com/NeuroML/NeuroMLlite) uses modelspec to create the structure of its models and convert the models into serialize formats such as JSON, YAML, and BSON.
33+
The XML serialisation of modelspec will be useful for integrating NeuroML 2 files into the framework, see [here](https://github.com/ModECI/modelspec/tree/main/examples/neuroml2).
10 Bytes
Binary file not shown.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"MyBook": {
33
"title": "My life in Python",
4+
"ISBN": 123,
45
"sections": {
56
"Abstract": {
67
"paragraphs": [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Document(Base):
5252
sections: List[Section] = field(factory=list)
5353

5454

55-
doc = Document(id="MyBook")
55+
doc = Document(id="MyBook", ISBN=123)
5656
doc.title = "My life in Python"
5757

5858
a = Section(id="Abstract")

0 commit comments

Comments
 (0)