Skip to content

Commit 35c23e0

Browse files
authored
Merge pull request #8 from ModECI/development
Attrs to main..
2 parents 345edc6 + 7f324b4 commit 35c23e0

22 files changed

+1659
-1116
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: [ 2.7, 3.7 , 3.9 ]
16+
python-version: [ 3.7 , 3.9 ]
1717

1818
steps:
1919
- uses: actions/checkout@v2
@@ -25,8 +25,7 @@ jobs:
2525
- name: Install package
2626
run: |
2727
python -m pip install --upgrade pip
28-
pip install flake8
29-
pip install .
28+
pip install .[dev]
3029
3130
- name: Lint with flake8
3231
run: |
@@ -43,15 +42,12 @@ jobs:
4342
4443
- name: Run pytest
4544
run: |
46-
pip install pytest
47-
cd modelspec/test/
48-
pytest -v
45+
pytest tests
4946
5047
- name: Install & test NeuroMLlite
5148
run: |
52-
git clone https://github.com/NeuroML/NeuroMLlite.git
49+
git clone --branch experimental https://github.com/NeuroML/NeuroMLlite.git
5350
cd NeuroMLlite
54-
git checkout modelspec # specific branch...
5551
pip install .
5652
pip install pyneuroml>=0.5.18
5753
cd examples
@@ -66,13 +62,12 @@ jobs:
6662
- name: Install MDF
6763
if: ${{ matrix.python-version != '2.7' }}
6864
run: |
69-
70-
# Install psyneulink - mdf branch
71-
python -m pip install git+https://github.com/PrincetonUniversity/PsyNeuLink.git@mdf
7265
73-
git clone https://github.com/ModECI/MDF.git
66+
# Install psyneulink
67+
python -m pip install git+https://github.com/PrincetonUniversity/PsyNeuLink.git
68+
69+
git clone --branch attrs_test https://github.com/ModECI/MDF.git
7470
cd MDF
75-
git checkout modelspec # specific branch...
7671
pip install .
7772
cd examples/MDF
7873
python arrays.py -run # test one example

.gitignore

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,156 @@
77
/modelspec/test/temp/Sim0.json
88
/modelspec/test/temp/net0.json
99
*acken.sh
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
build/
22+
develop-eggs/
23+
dist/
24+
downloads/
25+
eggs/
26+
.eggs/
27+
lib/
28+
lib64/
29+
parts/
30+
sdist/
31+
var/
32+
wheels/
33+
share/python-wheels/
34+
*.egg-info/
35+
.installed.cfg
36+
*.egg
37+
MANIFEST
38+
39+
# PyInstaller
40+
# Usually these files are written by a python script from a template
41+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
42+
*.manifest
43+
*.spec
44+
45+
# Installer logs
46+
pip-log.txt
47+
pip-delete-this-directory.txt
48+
49+
# Unit test / coverage reports
50+
htmlcov/
51+
.tox/
52+
.nox/
53+
.coverage
54+
.coverage.*
55+
.cache
56+
nosetests.xml
57+
coverage.xml
58+
*.cover
59+
*.py,cover
60+
.hypothesis/
61+
.pytest_cache/
62+
cover/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Django stuff:
69+
*.log
70+
local_settings.py
71+
db.sqlite3
72+
db.sqlite3-journal
73+
74+
# Flask stuff:
75+
instance/
76+
.webassets-cache
77+
78+
# Scrapy stuff:
79+
.scrapy
80+
81+
# Sphinx documentation
82+
docs/_build/
83+
84+
# PyBuilder
85+
.pybuilder/
86+
target/
87+
88+
# Jupyter Notebook
89+
.ipynb_checkpoints
90+
91+
# IPython
92+
profile_default/
93+
ipython_config.py
94+
95+
# pyenv
96+
# For a library or package, you might want to ignore these files since the code is
97+
# intended to run in multiple environments; otherwise, check them in:
98+
# .python-version
99+
100+
# pipenv
101+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
102+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
103+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
104+
# install all needed dependencies.
105+
#Pipfile.lock
106+
107+
# poetry
108+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109+
# This is especially recommended for binary packages to ensure reproducibility, and is more
110+
# commonly ignored for libraries.
111+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112+
#poetry.lock
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
.idea/

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
repos:
2+
3+
#- repo: https://github.com/psf/black
4+
# rev: 20.8b1
5+
# hooks:
6+
# - id: black
7+
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v3.4.0
10+
hooks:
11+
- id: check-added-large-files
12+
args: ['--maxkb=800']
13+
- id: check-case-conflict
14+
- id: check-merge-conflict
15+
- id: check-symlinks
16+
- id: check-yaml
17+
- id: check-json
18+
- id: debug-statements
19+
- id: end-of-file-fixer
20+
- id: mixed-line-ending
21+
- id: requirements-txt-fixer
22+
- id: trailing-whitespace
23+
24+
#- repo: https://github.com/PyCQA/isort
25+
# rev: 5.7.0
26+
# hooks:
27+
# - id: isort
28+
29+
- repo: https://github.com/asottile/pyupgrade
30+
rev: v2.7.4
31+
hooks:
32+
- id: pyupgrade
33+
args: ["--py36-plus"]
34+
35+
#- repo: https://github.com/pycqa/flake8
36+
# rev: 3.8.4
37+
# hooks:
38+
# - id: flake8
39+
# exclude: docs/conf.py
40+
# additional_dependencies: [flake8-bugbear, flake8-print]
41+
#
42+
#- repo: https://github.com/pre-commit/mirrors-mypy
43+
# rev: v0.800
44+
# hooks:
45+
# - id: mypy
46+
# files: src
47+
48+
- repo: https://github.com/psf/black
49+
rev: 20.8b1
50+
hooks:
51+
- id: black

examples/document.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
"title": "My life in Python",
44
"sections": {
55
"Abstract": {
6-
"paragraphs": {
7-
"contents": "Blah blah blah"
8-
}
6+
"paragraphs": [
7+
{
8+
"contents": "Blah blah blah"
9+
},
10+
{
11+
"contents": "Blah2"
12+
}
13+
]
914
},
10-
"Chapter 1": {}
15+
"Chapter 1": {
16+
"paragraphs": [
17+
{
18+
"contents": "More..."
19+
}
20+
]
21+
}
1122
}
1223
}
13-
}
24+
}

examples/document.md

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,42 @@
11
## Document
2-
32
A model for documents
43

5-
### Allowed parameters
6-
<table>
7-
<tr>
8-
<td><b>title</b></td>
9-
<td>str</td>
10-
<td><i>Document title</i></td>
11-
</tr>
12-
13-
<tr>
14-
<td><b>ISBN</b></td>
15-
<td>int</td>
16-
<td><i>International Standard Book Number</i></td>
17-
</tr>
18-
19-
<tr>
20-
<td><b>id</b></td>
21-
<td>str</td>
22-
<td><i>Unique ID of element</i></td>
23-
</tr>
24-
25-
<tr>
26-
<td><b>notes</b></td>
27-
<td>str</td>
28-
<td><i>Human readable notes</i></td>
29-
</tr>
4+
#### Allowed parameters
5+
<table><tr><td><b>id</b></td><td>str</td><td><i>The unique id of the document</i></td></tr>
6+
7+
<tr><td><b>title</b></td><td>str</td><td><i>Document title</i></td></tr>
8+
9+
<tr><td><b>ISBN</b></td><td>int</td><td><i>International Standard Book Number</i></td></tr>
10+
3011

3112
</table>
3213

3314
#### Allowed children
15+
<table><tr><td><b>sections</b></td><td><a href="#section">Section</a></td><td><i>The sections of the document</i></td></tr>
3416

35-
<table>
36-
<tr>
37-
<td><b>sections</b></td>
38-
<td><a href="#section">Section</a></td>
39-
<td><i>The sections of the document</i></td>
40-
</tr>
4117

4218
</table>
4319

4420
## Section
45-
4621
A model of a section of the document. Will contain a <a href="#paragraph">Paragraph</a> or two
4722

48-
### Allowed parameters
49-
<table>
50-
<tr>
51-
<td><b>id</b></td>
52-
<td>str</td>
53-
<td><i>Unique ID of element</i></td>
54-
</tr>
23+
#### Allowed parameters
24+
<table><tr><td><b>id</b></td><td>str</td><td><i>The id of the section</i></td></tr>
5525

56-
<tr>
57-
<td><b>notes</b></td>
58-
<td>str</td>
59-
<td><i>Human readable notes</i></td>
60-
</tr>
6126

6227
</table>
6328

6429
#### Allowed children
30+
<table><tr><td><b>paragraphs</b></td><td><a href="#paragraph">Paragraph</a></td><td><i>The paragraphs</i></td></tr>
6531

66-
<table>
67-
<tr>
68-
<td><b>paragraphs</b></td>
69-
<td><a href="#paragraph">Paragraph</a></td>
70-
<td><i>The paragraphs</i></td>
71-
</tr>
7232

7333
</table>
7434

7535
## Paragraph
76-
7736
A model of a paragraph
7837

79-
### Allowed parameters
80-
<table>
81-
<tr>
82-
<td><b>contents</b></td>
83-
<td>str</td>
84-
<td><i>Paragraph contents, which make up the <a href="#section">Section</a>s.</i></td>
85-
</tr>
38+
#### Allowed parameters
39+
<table><tr><td><b>contents</b></td><td>str</td><td><i>Paragraph contents, which make up the <a href="#section">Section</a>s.</i></td></tr>
8640

87-
</table>
8841

42+
</table>

0 commit comments

Comments
 (0)