Skip to content

Commit

Permalink
Merge pull request #3284 from jessica-mitchell/add-files-examples
Browse files Browse the repository at this point in the history
Configure Sphinx gallery to copy files from `pynest/examples`
  • Loading branch information
jessica-mitchell authored Aug 20, 2024
2 parents ed62f57 + c98c79c commit ba87440
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 21 deletions.
9 changes: 1 addition & 8 deletions doc/htmldoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"gallery_dirs": "auto_examples",
"plot_gallery": "False",
"download_all_examples": False,
"copyfile_regex": r".*\.rst|.*\.png|.*\.svg|Snakefile|.*\.txt",
}

# General information about the project.
Expand Down Expand Up @@ -260,14 +261,6 @@
]


def copy_example_file(src):
copyfile(os.path.join(pynest_dir, src), Path("examples") / Path(src).parts[-1])


# -- Copy documentation for Microcircuit Model ----------------------------
copy_example_file("examples/hpc_benchmark_connectivity.svg")


def patch_documentation(patch_url):
"""Apply a hot-fix patch to the documentation before building it.
Expand Down
6 changes: 3 additions & 3 deletions doc/htmldoc/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ PyNEST examples


.. grid-item-card:: Cortical microcircuit (Potjans)
:img-top: ../static/img/potjans_2014_raster_plot.png
:img-top: ../auto_examples/Potjans_2014/potjans_2014_raster_plot.png

* :doc:`../auto_examples/Potjans_2014/index`



.. grid-item-card:: EI clustered network (Rostami et al)
:img-top: ../static/img/pynest/EI_clustered_network_schematic.png
:img-top: ../auto_examples/EI_clustered_network/EI_clustered_network_schematic.png

:doc:`../auto_examples/EI_clustered_network/index`

Expand Down Expand Up @@ -256,7 +256,7 @@ PyNEST examples
* :doc:`../auto_examples/sonata_example/sonata_network`

.. grid-item-card:: HPC benchmark
:img-top: ../static/img/nest_logo-faded.png
:img-top: ../auto_examples/hpc_benchmark_connectivity.svg

* :doc:`../auto_examples/hpc_benchmark`

Expand Down
2 changes: 1 addition & 1 deletion pynest/examples/EI_clustered_network/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ EI-clustered circuit model

This is PyNEST implementation of the EI-clustered circuit model described by Rostami et al. [1]_.

.. figure:: /static/img/pynest/EI_clustered_network_schematic.png
.. figure:: EI_clustered_network_schematic.png
:alt: EI-clustered circuit model.

Schematic of the EI-clustered circuit model. The network consists of `n_clusters` with one excitatory and one inhibitory population each.
Expand Down
6 changes: 3 additions & 3 deletions pynest/examples/Potjans_2014/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ The network model represents four layers of cortex, L2/3, L4, L5, and L6, each c

.. grid-item::

.. image:: ../../static/img/potjans_2014_microcircuit.png
.. image:: potjans_2014_microcircuit.png

.. grid-item::

.. image:: ../../static/img/potjans_2014_raster_plot.png
.. image:: potjans_2014_raster_plot.png

.. grid-item::

.. image:: ../../static/img/potjans_2014_box_plot.png
.. image:: potjans_2014_box_plot.png



Expand Down
2 changes: 1 addition & 1 deletion pynest/examples/eprop_plasticity/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ E-prop plasticity examples
==========================


.. image:: ../../../../pynest/examples/eprop_plasticity/eprop_supervised_regression_schematic_sine-waves.png
.. image:: eprop_supervised_regression_schematic_sine-waves.png

Eligibility propagation (e-prop) [1]_ is a three-factor learning rule for spiking neural networks
that approximates backpropagation through time. The original TensorFlow implementation of e-prop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
infer the underlying rationale of the task. Here, the solution is to turn to the side in which more cues were
presented.
.. image:: ../../../../pynest/examples/eprop_plasticity/eprop_supervised_classification_schematic_evidence-accumulation.png
.. image:: eprop_supervised_classification_schematic_evidence-accumulation.png
:width: 70 %
:alt: See Figure 1 below.
:align: center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
learns to reproduce with its overall spiking activity a two-dimensional, roughly one-second-long target signal
which encode the x and y coordinates of the handwritten word "chaos".
.. image:: ../../../../pynest/examples/eprop_plasticity/eprop_supervised_regression_schematic_handwriting.png
.. image:: eprop_supervised_regression_schematic_handwriting.png
:width: 70 %
:alt: See Figure 1 below.
:align: center
Expand All @@ -57,6 +57,16 @@
Charl Linssen, inspired by activities and feedback received at the CapoCaccia Workshop toward Neuromorphic
Intelligence 2023.
Get the chaos_handwriting.txt file:
.. grid::
.. grid-item-card::
:columns: 3
:download:`chaos_handwriting.txt`
References
~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
learns to reproduce with its overall spiking activity a two-dimensional, roughly two-second-long target signal
which encode the x and y coordinates of an infinite-loop.
.. image:: ../../../../pynest/examples/eprop_plasticity/eprop_supervised_regression_schematic_infinite-loop.png
.. image:: eprop_supervised_regression_schematic_infinite-loop.png
:width: 70 %
:alt: See Figure 1 below.
:align: center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
network learns to reproduce with its overall spiking activity a one-dimensional, one-second-long target signal
which is a superposition of four sine waves of different amplitudes, phases, and periods.
.. image:: ../../../../pynest/examples/eprop_plasticity/eprop_supervised_regression_schematic_sine-waves.png
.. image:: eprop_supervised_regression_schematic_sine-waves.png
:width: 70 %
:alt: See Figure 1 below.
:align: center
Expand Down
2 changes: 1 addition & 1 deletion pynest/examples/hpc_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
A note on connectivity
~~~~~~~~~~~~~~~~~~~~~~
.. image:: ../examples/hpc_benchmark_connectivity.svg
.. image:: hpc_benchmark_connectivity.svg
:width: 50 %
:alt: HPC Benchmark network architecture
:align: right
Expand Down

0 comments on commit ba87440

Please sign in to comment.