Skip to content

Commit

Permalink
Merge pull request #29 from INM-6/rtd-integration
Browse files Browse the repository at this point in the history
Readthedocs integration
  • Loading branch information
mdenker authored Oct 13, 2023
2 parents 34fb38c + 01b73a1 commit 9ebd2f5
Show file tree
Hide file tree
Showing 7 changed files with 1,449 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ contribution, and may not be the current affiliation of a contributor.
* Michael von Papen [1]
* Michael Denker [1]
* Aitor Morales-Gregorio [1][2]
* Oliver Kloss [1]

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
2. RWTH Aachen University, Aachen, Germany
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ A SciUnit_ library for validation testing of spiking networks.

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



.. image:: https://readthedocs.org/projects/networkunit/badge/?version=latest
:target: https://networkunit.readthedocs.io/en/latest/?badge=latest

.. image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/INM-6/NetworkUnit/master?filepath=examples%2Findex.ipynb
:alt: Binder Link
Expand Down
1,280 changes: 1,280 additions & 0 deletions examples/index.ipynb

Large diffs are not rendered by default.

136 changes: 136 additions & 0 deletions examples/joint_test.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"sys.path.insert(0, '../')\n",
"from networkunit import models, tests, scores\n",
"import quantities as pq\n",
"import sciunit"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"# Define models\n",
"model_A = models.stochastic_activity('model A', rate=5*pq.Hz)\n",
"model_B = models.stochastic_activity('model B', rate=15*pq.Hz)\n",
"\n",
"# Define test\n",
"class fr_lv_jtest(tests.TestM2M, tests.joint_test):\n",
" score_type = scores.ks_distance # <- define score statistic\n",
"# score_type = scores.kl_divergence\n",
" params = {}\n",
" test_list = [tests.firing_rate_test, tests.isi_variation_test, tests.isi_variation_test]\n",
" test_params = [{}, {'variation_measure': 'lv'}, {'variation_measure': 'cv'}]"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"jtest_inst = fr_lv_jtest()"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3, 100)"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pred = jtest_inst.generate_prediction(model_A)\n",
"pred.shape"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"isinstance(fr_lv_jtest, type)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"score = jtest_inst.judge([model_A, model_B])"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"sciunit.scores.collections_m2m.ScoreMatrixM2M"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(score)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
19 changes: 19 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# readthedocs version
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.9"

sphinx:
builder: html
configuration: doc/conf.py


python:
install:
- method: pip
path: .
extra_requirements:
- docs
5 changes: 5 additions & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Packages required to build docs (in addition to requirements-tutorials.rst)

jupyter>=1.0.0
sphinx>=7.2.5
nbsphinx>=0.9.3
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
with open('requirements.txt', 'r') as fp:
install_requires = fp.read()
extras_require = {}
for extra in ['docs']:
with open('requirements-{0}.txt'.format(extra)) as fp:
extras_require[extra] = fp.read()

setup(
name="networkunit",
Expand Down

0 comments on commit 9ebd2f5

Please sign in to comment.