Skip to content

Commit 268e72a

Browse files
committed
Merge branch 'development' into experimental
2 parents f25194c + cd27217 commit 268e72a

23 files changed

+559
-46
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Continuous builds
22

33
on:
44
push:
5-
branches: [ main, development, experimental ]
5+
branches: [ main, development, experimental, test* ]
66
pull_request:
7-
branches: [ main, development, experimental ]
7+
branches: [ main, development, experimental, test* ]
88

99
jobs:
1010

@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
27+
python-version: ["3.7", "3.8", "3.9", "3.10"]
2828

2929
steps:
3030
- uses: actions/checkout@v2

.github/workflows/python-publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
deploy:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
- name: Build package
31+
run: python -m build
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,4 @@ cython_debug/
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162162
.idea/
163163
/examples/document.specification.bson
164+
/examples/neuroml2/hello_world.v.dat

examples/document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A model for documents.
1313
<tr>
1414
<td><b>title</b></td>
1515
<td>str</td>
16-
<td><i>Document title</i></td>
16+
<td><i>The document title</i></td>
1717
</tr>
1818

1919

examples/document.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Document(Base):
4040
4141
Args:
4242
id: The unique id of the document
43-
title: Document title
43+
title: The document title
4444
ISBN: International Standard Book Number
4545
sections: The sections of the document
4646
"""
@@ -65,24 +65,29 @@ class Document(Base):
6565

6666
print(doc)
6767
print(doc.sections[0].paragraphs[0].contents)
68-
print(doc.sections[0].paragraphs[0].__getattribute__("contents"))
68+
print(doc.sections[0].paragraphs[1].__getattribute__("contents"))
6969

7070
doc.to_json_file("document.json")
7171
doc.to_yaml_file("document.yaml")
7272
doc.to_bson_file("document.bson")
7373

74+
print(" >> Full document details in YAML format:\n")
75+
76+
print(doc.to_yaml())
77+
7478
doc_md = doc.generate_documentation(format="markdown")
7579

7680
with open("document.md", "w") as d:
7781
d.write(doc_md)
7882

83+
7984
doc_rst = doc.generate_documentation(format="rst")
8085

8186
with open("document.rst", "w") as d:
8287
d.write(doc_rst)
8388

8489

85-
print("\nGenerating specification in dict form")
90+
print("\n >> Generating specification in dict form...")
8691
doc_dict = doc.generate_documentation(format="dict")
8792

8893
import json
@@ -92,9 +97,12 @@ class Document(Base):
9297
with open("document.specification.json", "w") as d:
9398
d.write(json.dumps(doc_dict, indent=4))
9499

95-
print("Generating specification in YAML")
100+
print(" >> Generating specification in YAML...\n")
101+
96102
with open("document.specification.yaml", "w") as d:
97-
d.write(yaml.dump(doc_dict, indent=4, sort_keys=False))
103+
yy = yaml.dump(doc_dict, indent=4, sort_keys=False)
104+
print(yy)
105+
d.write(yy)
98106

99107
with open("document.specification.bson", "wb") as d:
100108
d.write(bson.encode(doc_dict))

examples/document.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A model for documents.
99
Allowed field Data Type Description
1010
=============== =========== ==================================
1111
**id** str The unique id of the document
12-
**title** str Document title
12+
**title** str The document title
1313
**ISBN** int International Standard Book Number
1414
=============== =========== ==================================
1515

examples/document.specification.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"title": {
1010
"type": "str",
11-
"description": "Document title"
11+
"description": "The document title"
1212
},
1313
"ISBN": {
1414
"type": "int",

examples/document.specification.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Document:
66
description: The unique id of the document
77
title:
88
type: str
9-
description: Document title
9+
description: The document title
1010
ISBN:
1111
type: int
1212
description: International Standard Book Number
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Lems>
2+
3+
<!--
4+
5+
This LEMS file has been automatically generated using PyNeuroML v1.0.8 (libNeuroML v0.5.2)
6+
7+
-->
8+
9+
<!-- Specify which component to run -->
10+
<Target component="hello_world"/>
11+
12+
<!-- Include core NeuroML2 ComponentType definitions -->
13+
<Include file="Cells.xml"/>
14+
<Include file="Networks.xml"/>
15+
<Include file="Simulation.xml"/>
16+
17+
<Include file="hello_world_neuroml.net.nml"/>
18+
19+
<Simulation id="hello_world" length="1000ms" step="0.1ms" target="IzNet" seed="123"> <!-- Note seed: ensures same random numbers used every run -->
20+
21+
<OutputFile id="output0" fileName="hello_world.v.dat">
22+
<OutputColumn id="IzhPop0[0]" quantity="IzhPop0[0]/v"/>
23+
</OutputFile>
24+
25+
</Simulation>
26+
27+
</Lems>

examples/neuroml2/NeuroML2.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
## NeuroML
2+
Some description...
3+
4+
### Allowed parameters
5+
<table>
6+
<tr>
7+
<td><b>id</b></td>
8+
<td>str</td>
9+
<td><i>The id of the NeuroML 2 document</i></td>
10+
</tr>
11+
12+
13+
<tr>
14+
<td><b>version</b></td>
15+
<td>str</td>
16+
<td><i>NeuroML version used</i></td>
17+
</tr>
18+
19+
20+
</table>
21+
22+
### Allowed children
23+
<table>
24+
<tr>
25+
<td><b>networks</b></td>
26+
<td><a href="#network">Network</a></td>
27+
<td><i>The networks present</i></td>
28+
</tr>
29+
30+
31+
</table>
32+
33+
## Network
34+
Some description...
35+
36+
### Allowed parameters
37+
<table>
38+
<tr>
39+
<td><b>id</b></td>
40+
<td>str</td>
41+
<td><i>The id of the network</i></td>
42+
</tr>
43+
44+
45+
</table>
46+
47+
### Allowed children
48+
<table>
49+
<tr>
50+
<td><b>populations</b></td>
51+
<td><a href="#population">Population</a></td>
52+
<td><i>the pops in the net</i></td>
53+
</tr>
54+
55+
56+
</table>
57+
58+
## Population
59+
Some description...
60+
61+
### Allowed parameters
62+
<table>
63+
<tr>
64+
<td><b>id</b></td>
65+
<td>str</td>
66+
<td><i>The id of the population</i></td>
67+
</tr>
68+
69+
70+
<tr>
71+
<td><b>component</b></td>
72+
<td>str</td>
73+
<td><i>the component to use in the population</i></td>
74+
</tr>
75+
76+
77+
<tr>
78+
<td><b>size</b></td>
79+
<td>int</td>
80+
<td><i>the size of the population</i></td>
81+
</tr>
82+
83+
84+
</table>

0 commit comments

Comments
 (0)