Skip to content

Commit 9ebd2f5

Browse files
authored
Merge pull request #29 from INM-6/rtd-integration
Readthedocs integration
2 parents 34fb38c + 01b73a1 commit 9ebd2f5

File tree

7 files changed

+1449
-0
lines changed

7 files changed

+1449
-0
lines changed

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ contribution, and may not be the current affiliation of a contributor.
1212
* Michael von Papen [1]
1313
* Michael Denker [1]
1414
* Aitor Morales-Gregorio [1][2]
15+
* Oliver Kloss [1]
1516

1617
1. Institute of Neuroscience and Medicine (INM-6), Computational and Systems Neuroscience & Institute for Advanced Simulation (IAS-6), Theoretical Neuroscience, Jülich Research Centre and JARA, Jülich, Germany
1718
2. RWTH Aachen University, Aachen, Germany

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ A SciUnit_ library for validation testing of spiking networks.
66

77
.. _SciUnit: https://github.com/scidash/sciunit
88

9+
10+
11+
.. image:: https://readthedocs.org/projects/networkunit/badge/?version=latest
12+
:target: https://networkunit.readthedocs.io/en/latest/?badge=latest
13+
914
.. image:: https://mybinder.org/badge.svg
1015
:target: https://mybinder.org/v2/gh/INM-6/NetworkUnit/master?filepath=examples%2Findex.ipynb
1116
:alt: Binder Link

examples/index.ipynb

Lines changed: 1280 additions & 0 deletions
Large diffs are not rendered by default.

examples/joint_test.ipynb

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import sys\n",
10+
"sys.path.insert(0, '../')\n",
11+
"from networkunit import models, tests, scores\n",
12+
"import quantities as pq\n",
13+
"import sciunit"
14+
]
15+
},
16+
{
17+
"cell_type": "code",
18+
"execution_count": 13,
19+
"metadata": {},
20+
"outputs": [],
21+
"source": [
22+
"# Define models\n",
23+
"model_A = models.stochastic_activity('model A', rate=5*pq.Hz)\n",
24+
"model_B = models.stochastic_activity('model B', rate=15*pq.Hz)\n",
25+
"\n",
26+
"# Define test\n",
27+
"class fr_lv_jtest(tests.TestM2M, tests.joint_test):\n",
28+
" score_type = scores.ks_distance # <- define score statistic\n",
29+
"# score_type = scores.kl_divergence\n",
30+
" params = {}\n",
31+
" test_list = [tests.firing_rate_test, tests.isi_variation_test, tests.isi_variation_test]\n",
32+
" test_params = [{}, {'variation_measure': 'lv'}, {'variation_measure': 'cv'}]"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": 14,
38+
"metadata": {},
39+
"outputs": [],
40+
"source": [
41+
"jtest_inst = fr_lv_jtest()"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 22,
47+
"metadata": {},
48+
"outputs": [
49+
{
50+
"data": {
51+
"text/plain": [
52+
"(3, 100)"
53+
]
54+
},
55+
"execution_count": 22,
56+
"metadata": {},
57+
"output_type": "execute_result"
58+
}
59+
],
60+
"source": [
61+
"pred = jtest_inst.generate_prediction(model_A)\n",
62+
"pred.shape"
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": 11,
68+
"metadata": {},
69+
"outputs": [
70+
{
71+
"data": {
72+
"text/plain": [
73+
"True"
74+
]
75+
},
76+
"execution_count": 11,
77+
"metadata": {},
78+
"output_type": "execute_result"
79+
}
80+
],
81+
"source": [
82+
"isinstance(fr_lv_jtest, type)"
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": 17,
88+
"metadata": {},
89+
"outputs": [],
90+
"source": [
91+
"score = jtest_inst.judge([model_A, model_B])"
92+
]
93+
},
94+
{
95+
"cell_type": "code",
96+
"execution_count": 21,
97+
"metadata": {},
98+
"outputs": [
99+
{
100+
"data": {
101+
"text/plain": [
102+
"sciunit.scores.collections_m2m.ScoreMatrixM2M"
103+
]
104+
},
105+
"execution_count": 21,
106+
"metadata": {},
107+
"output_type": "execute_result"
108+
}
109+
],
110+
"source": [
111+
"type(score)"
112+
]
113+
}
114+
],
115+
"metadata": {
116+
"kernelspec": {
117+
"display_name": "Python 3",
118+
"language": "python",
119+
"name": "python3"
120+
},
121+
"language_info": {
122+
"codemirror_mode": {
123+
"name": "ipython",
124+
"version": 3
125+
},
126+
"file_extension": ".py",
127+
"mimetype": "text/x-python",
128+
"name": "python",
129+
"nbconvert_exporter": "python",
130+
"pygments_lexer": "ipython3",
131+
"version": "3.7.3"
132+
}
133+
},
134+
"nbformat": 4,
135+
"nbformat_minor": 4
136+
}

readthedocs.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# readthedocs version
2+
version: 2
3+
4+
build:
5+
os: ubuntu-22.04
6+
tools:
7+
python: "3.9"
8+
9+
sphinx:
10+
builder: html
11+
configuration: doc/conf.py
12+
13+
14+
python:
15+
install:
16+
- method: pip
17+
path: .
18+
extra_requirements:
19+
- docs

requirements-docs.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Packages required to build docs (in addition to requirements-tutorials.rst)
2+
3+
jupyter>=1.0.0
4+
sphinx>=7.2.5
5+
nbsphinx>=0.9.3

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
with open('requirements.txt', 'r') as fp:
99
install_requires = fp.read()
1010
extras_require = {}
11+
for extra in ['docs']:
12+
with open('requirements-{0}.txt'.format(extra)) as fp:
13+
extras_require[extra] = fp.read()
1114

1215
setup(
1316
name="networkunit",

0 commit comments

Comments
 (0)