diff --git a/README.md b/README.md index 33a65ddfa1..5271cbeef0 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![Ubuntu version](https://img.shields.io/badge/ubuntu-(PPA)-blue?logo=debian)](https://nest-simulator.readthedocs.io/en/latest/installation/) [![Fedora package](https://img.shields.io/fedora/v/nest?logo=fedora)](https://src.fedoraproject.org/rpms/nest) -[![Conda version](https://img.shields.io/conda/vn/conda-forge/nest-simulator.svg?logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/nest-simulator) +[![conda-forge version](https://img.shields.io/conda/vn/conda-forge/nest-simulator.svg?logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/nest-simulator) [![Homebrew version](https://img.shields.io/homebrew/v/nest.svg?logo=apple)](https://formulae.brew.sh/formula/nest) [![Docker Image Version](https://img.shields.io/docker/v/nest/nest-simulator?color=blue&label=docker&logo=docker&logoColor=white&sort=semver)](https://hub.docker.com/r/nest/nest-simulator) [![Virtual applicance](https://img.shields.io/badge/VM-v3.7-blue?logo=CodeSandbox)](https://nest-simulator.readthedocs.io/en/latest/installation/livemedia.html#live-media) @@ -22,110 +22,81 @@ NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact -morphology of individual neurons. The development of NEST is coordinated by the -NEST Initiative. General information on the NEST Initiative can be found at -its homepage at https://www.nest-initiative.org. +morphology of individual neurons. + +A NEST simulation tries to follow the logic of an electrophysiological +experiment that takes place inside a computer with the difference that the +neural system to be investigated must be defined by the experimenter. NEST is ideal for networks of spiking neurons of any size, for example: -- Models of information processing e.g. in the visual or auditory cortex of +- Models of information processing, e.g., in the visual or auditory cortex of mammals, -- Models of network activity dynamics, e.g. laminar cortical networks or +- Models of network activity dynamics, e.g., laminar cortical networks or balanced random networks, - Models of learning and plasticity. -For copyright information please refer to the `LICENSE` file and to the -information header in the source files. +## Key features of NEST -## How do I use NEST? +* NEST provides a Python interface or a stand-alone application +* NEST provides a large collection of [neurons and synapse models](https://nest-simulator.org/documentation/models/index.html) +* NEST provides numerous [example network scripts](https://nest-simulator.org/documentation/examples/index.html) along with + [tutorials and guides](https://nest-simulator.org/documentation/get-started_index.html) to help you develop your simulation +* NEST has a large community of experienced developers and users; NEST was first released in 1994 under the name SYNOD, and has been extended and improved ever since +* NEST is extensible: you can extend NEST by adding your own modules +* NEST is scalable: Use NEST on your laptop or the largest supercomputers +* NEST is memory efficient: It makes the best use of your multi-core computer and compute clusters with minimal user intervention +* NEST is an open source project and is licensed under the GNU General Public License v2 or later +* NEST employs continuous integration workflows in order to maintain high code quality standards for correct and reproducible simulations -You can use NEST either via Python (PyNEST) or as a stand-alone application -(nest). PyNEST provides a set of commands to the Python interpreter which give -you access to NEST's simulation kernel. With these commands, you describe and -run your network simulation. You can also complement PyNEST with PyNN, a -simulator-independent set of Python commands to formulate and run neural -simulations. While you define your simulations in Python, the actual simulation -is executed within NEST's highly optimized simulation kernel which is written -in C++. -A NEST simulation tries to follow the logic of an electrophysiological -experiment that takes place inside a computer with the difference, that the -neural system to be investigated must be defined by the experimenter. +## Documentation -The neural system is defined by a possibly large number of neurons and their -connections. In a NEST network, different neuron and synapse models can -coexist. Any two neurons can have multiple connections with different -properties. Thus, the connectivity can in general not be described by a weight -or connectivity matrix but rather as an adjacency list. - -To manipulate or observe the network dynamics, the experimenter can define -so-called devices which represent the various instruments (for measuring and -stimulation) found in an experiment. These devices write their data either to -memory or to file. - -NEST is extensible and new models for neurons, synapses, and devices can be -added. - -To get started with NEST, please see the [Documentation Page for -Tutorials](https://www.nest-simulator.org/documentation/). - -## Why should I use NEST? - -To learn more about the capabilities of NEST, please read the complete [feature -summary](https://www.nest-simulator.org/features/). - -- NEST provides over 50 neuron models many of which have been published. Choose - from simple integrate-and-fire neurons with current or conductance based - synapses, over the Izhikevich or AdEx models, to Hodgkin-Huxley models. -- NEST provides over 10 synapse models, including short-term plasticity - (Tsodyks & Markram) and different variants of spike-timing dependent - plasticity (STDP). -- NEST provides many examples that help you getting started with your own - simulation project. -- NEST offers convenient and efficient commands to define and connect large - networks, ranging from algorithmically determined connections to data-driven - connectivity. -- NEST lets you inspect and modify the state of each neuron and each connection - at any time during a simulation. -- NEST is fast and memory efficient. It makes best use of your multi-core - computer and compute clusters with minimal user intervention. -- NEST runs on a wide range of UNIX-like systems, from MacBooks to - supercomputers. -- NEST has minimal dependencies. All it really needs is a C++ compiler. - Everything else is optional. -- NEST developers are using agile continuous integration-based workflows in - order to maintain high code quality standards for correct and reproducible - simulations. -- NEST has one of the largest and most experienced developer communities of all - neural simulators. NEST was first released in 1994 under the name SYNOD and - has been extended and improved ever since. +Please visit our [online documentation](https://nest-simulator.org/documentation) for details on installing and using NEST. -## License -NEST is open source software and is licensed under the [GNU General Public -License v2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) or -later. +## Cite NEST + +If you use NEST as part of your research, please cite the *version* of NEST you used. +The full citation for each release can be found on [Zenodo](https://zenodo.org/search?q=title%3ANEST%20AND%20-description%3Agraphical%20AND%20simulator&l=list&p=1&s=10&sort=publication-desc) + +For general citations, please use + +`Gewaltig M-O & Diesmann M (2007) NEST (Neural Simulation Tool) Scholarpedia 2(4):1430.` + +## Contact -## Installing NEST -Please see the online [NEST Installation Instructions](http://www.nest-simulator.org/installation) -to find out how to install NEST. +If you need help or would like to discuss an idea or issue, +join our [maling list](https://nest-simulator.org/documentation/developer_space/guidelines/mailing_list_guidelines.html), +where we encourage active participation from our developers and users to share their knowledge and experience with NEST. -## Getting help -- You can run the `help` command in the NEST interpreter to find documentation - and learn more about available commands. -- For queries regarding NEST usage, please use the [NEST users mailing - list](https://www.nest-initiative.org/mailinglist/). -- Information on the Python bindings to NEST can be found in - `${prefix}/share/doc/nest/README.md`. -- For those looking to extend NEST, developer documentation on [Contributing to - NEST](https://nest-simulator.readthedocs.io/en/latest/contribute/index.html) is available. +You can find other [ways to get in touch here](https://nest-simulator.org/documentation/community.html). -## Citing NEST -Please cite NEST if you use it in your work. +## Contribute -- You can find all the information for [citing NEST here](https://nest-simulator.readthedocs.io/en/latest/citing-nest.html) +NEST is built on an active community and we welcome contributions to our code and documentation. +For bug reports, feature requests, documentation improvements, or other issues, +you can create a [GitHub issue](https://github.com/nest/nest-simulator/issues/new/choose), + +For working with NEST code and documentation, you can find guidelines for contributions +[in our documentation](https://nest-simulator.org/documentation/developer_space/index.html#contribute-to-nest) + + +## Publications + +You can find a list of NEST [related publications here](https://www.nest-simulator.org/publications/). + +## License + + +NEST is open source software and is licensed under the [GNU General Public +License v2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) or +later. + +General information on the NEST Initiative can be found at +its homepage at https://www.nest-initiative.org. diff --git a/bin/nest-server-mpi b/bin/nest-server-mpi index 900d15e20b..155d58545f 100755 --- a/bin/nest-server-mpi +++ b/bin/nest-server-mpi @@ -73,4 +73,4 @@ else: continue log(call_name, f"sending reponse gather, data={response}") - comm.gather(nest.serializable(response), root=0) + comm.gather(nest.serialize_data(response), root=0) diff --git a/doc/htmldoc/benchmark_results.rst b/doc/htmldoc/benchmark_results.rst index bc0bf0fecc..46954b0ead 100644 --- a/doc/htmldoc/benchmark_results.rst +++ b/doc/htmldoc/benchmark_results.rst @@ -44,7 +44,13 @@ Strong scaling experiment of the Multi-area-model [5]_ :class: sd-align-major-center :columns: 10 - .. image:: /static/img/mam_benchmark.png + Dynamical regime: Ground state + + .. image:: /static/img/mam_ground-state_benchmark.png + + Dynamical regime: Metastable state + + .. image:: /static/img/mam_metastable-state_benchmark.png .. grid:: 1 1 1 1 @@ -54,6 +60,7 @@ Strong scaling experiment of the Multi-area-model [5]_ :class: sd-align-minor-center * The model has ~4.1 million neurons and ~24 billion synapses, minimal delay 0.1 ms + * It can be run in two different dynamical regimes: the ground state and the metastable state [5]_. * 2 MPI processes per node, 64 threads per MPI process * Steady decrease of run time with additional compute resources * Data averaged over 3 runs with different seeds, error bars indicate standard deviation diff --git a/doc/htmldoc/developer_space/guidelines/mailing_list_guidelines.rst b/doc/htmldoc/developer_space/guidelines/mailing_list_guidelines.rst index d499ba0c8f..f8684d8b8a 100644 --- a/doc/htmldoc/developer_space/guidelines/mailing_list_guidelines.rst +++ b/doc/htmldoc/developer_space/guidelines/mailing_list_guidelines.rst @@ -30,7 +30,7 @@ please follow the guidelines below: * the steps you took that lead to the problem. * the specific error messages you get. - * relevant system and version information (e.g., Ubuntu 22.04/ NEST 3.5 installed using the Conda package). + * relevant system and version information (e.g., Ubuntu 22.04/ NEST 3.8 installed using the conda-forge package). #. Keep topics separate. diff --git a/doc/htmldoc/developer_space/workflows/documentation_workflow/user_documentation_workflow.rst b/doc/htmldoc/developer_space/workflows/documentation_workflow/user_documentation_workflow.rst index 131a868a74..37374f3f05 100644 --- a/doc/htmldoc/developer_space/workflows/documentation_workflow/user_documentation_workflow.rst +++ b/doc/htmldoc/developer_space/workflows/documentation_workflow/user_documentation_workflow.rst @@ -84,23 +84,23 @@ If you have not done so alrealdy first Set up your environment ~~~~~~~~~~~~~~~~~~~~~~~ -Using the Conda package (includes everything to build NEST, including documentation) -```````````````````````````````````````````````````````````````````````````````````` +Using the conda-forge package (includes everything to build NEST, including documentation) +``````````````````````````````````````````````````````````````````````````````````````````` -For details on Conda, see :ref:`conda_tips` +For details on installation see :ref:`conda_forge_install` .. code-block:: bash cd / - conda env create -p conda/ - conda activate conda/ + mamba env create -p mamba/ + mamba activate mamba/ If you later on want to deactivate or delete the build environment: .. code-block:: bash - conda deactivate - rm -rf conda/ + mamba deactivate + rm -rf mamba/ Using pip (includes packages for documentation only) ```````````````````````````````````````````````````` @@ -108,6 +108,14 @@ Using pip (includes packages for documentation only) If you want to install only a minimal set of packages for building the documentation and avoid using Conda, you can use pip: +Create and activate a Python virtual environment: + +.. code-block:: bash + + python -m venv + + source /bin/activate + .. code-block:: bash pip3 install -r /doc/requirements.txt diff --git a/doc/htmldoc/developer_space/workflows/nest_with_ides.rst b/doc/htmldoc/developer_space/workflows/nest_with_ides.rst index de10e2d08a..7ff36c6bc2 100644 --- a/doc/htmldoc/developer_space/workflows/nest_with_ides.rst +++ b/doc/htmldoc/developer_space/workflows/nest_with_ides.rst @@ -25,7 +25,7 @@ Requirements and limitations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Focus on single build configuration -* Assumes all dependencies (OpenMPI, GSL, etc) installed in a Conda environment +* Assumes all dependencies (OpenMPI, GSL, etc) installed in a Mamba environment * Does not support debugging on macOS (because Eclipse does not support lldb) * Does not read the NEST `.clang-format` file, so code formatting may be incorrect @@ -62,10 +62,10 @@ Setting up the project #. Right click the project and choose ``Properties`` from the context menu - a. Under ``C/C++ Build/Build Variables``, define ``BUILD_DIR`` and ``CONDA_ENV``, + a. Under ``C/C++ Build/Build Variables``, define ``BUILD_DIR`` and ``MAMBA_ENV``, both of type ``Path``. The first should contain the full path to the build - directory you created above, the second the full path to your conda - environment, usually something like ``.../miniconda3/envs/nest-dev``. + directory you created above, the second the full path to your mamba + environment, usually something like ``.../mamba/envs/nest-dev``. #. Under ``C/C++ Build – [Tab] Builder Settings``, #. uncheck ``Use default build command`` @@ -73,14 +73,14 @@ Setting up the project number of processes to your situation) #. set ``Build Directory`` to ``${BUILD_DIR}`` #. Under ``C/C++ Build > Environment``, prepend - ``${CONDA_ENV}/bin`` to ``PATH`` + ``${MAMBA_ENV}/bin`` to ``PATH`` #. Under ``C/C++ General > Paths and Symbols – [Tab] Includes``, add the following two direcories * ``${BUILD_DIR}/libnestutil`` (contains ``config.h``) - * ``${CONDA_ENV}/include`` (all headers from packages provided in conda environment) + * ``${mamba_env}/include`` (all headers from packages provided in Mamba environment) #. Under ``PyDev - Interpreter/Grammar``, choose the interpreter from - your Conda environment (you may need to add it by following the + your Mamba environment (you may need to add it by following the ``Click here to configure an interpreter not listed`` link and then ``Browse for python/pypy exe`` (this temporarily takes you to the global Eclipse preferences in a separate window). @@ -261,7 +261,7 @@ We need several packages installed, before we can become productive with NEST: * gsl * cmake * libtool -* ipython, python, cython, ... The best way to install all the python requirements is to use `Anaconda `_. +* ipython, python, cython, ... The best way to install all the python requirements is to use `Mamba `_. We present two ways to install the rest: MacPorts and Homebrew. For both versions you need to have Xcode and Xcode command line tools installed: diff --git a/doc/htmldoc/faqs/qa-precise-spike-times.rst b/doc/htmldoc/faqs/qa-precise-spike-times.rst index 6a4b0ae641..d01caed9e0 100644 --- a/doc/htmldoc/faqs/qa-precise-spike-times.rst +++ b/doc/htmldoc/faqs/qa-precise-spike-times.rst @@ -140,7 +140,7 @@ Questions and answers about precise neurons 13. Q: **What is the rate at which spikes are missed in a typical large-scale neuronal network simulation of integrate-and-fire model neurons with linear subthreshold dynamics in the balanced state and - a spike rate of around 10 Hz**? + a spike rate of around 10 spks/s**? A: At a typical parameter setting for a simulation with around 10,000 neurons and 15 million synapses, the total rate at which spikes are diff --git a/doc/htmldoc/get-started_index.rst b/doc/htmldoc/get-started_index.rst index b3cf5d9ddd..47330b633e 100644 --- a/doc/htmldoc/get-started_index.rst +++ b/doc/htmldoc/get-started_index.rst @@ -226,7 +226,7 @@ More topics Simulation behavior Randomness in NEST Built-in timers - Connect NEST with other tools + Connect NEST with other tools From NEST 2.x to 3.x .. toctree:: diff --git a/doc/htmldoc/hpc/slurm_script.rst b/doc/htmldoc/hpc/slurm_script.rst index fc1843e17e..b80b724c2e 100644 --- a/doc/htmldoc/hpc/slurm_script.rst +++ b/doc/htmldoc/hpc/slurm_script.rst @@ -42,6 +42,8 @@ In this example, we are using 1 node, which contains 2 sockets and 64 cores per export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK export OMP_PROC_BIND=TRUE + # Optional + python -c "import nest, subprocess as s, os; s.check_call(['/usr/bin/pldd', str(os.getpid())])" 2>&1 | tee -a "pldd-nest.out" # On some systems, MPI is run by SLURM srun --exclusive python3 my_nest_simulation.py @@ -174,6 +176,21 @@ will prevent the threads from moving around. | +:: + + python -c "import nest, subprocess as s, os; s.check_call(['/usr/bin/pldd', str(os.getpid())])" 2>&1 | tee -a "pldd-nest.out" + +Prints out the linked libraries into a file with name ``pldd-nest.out``. +In this way, you can check whether dynamically linked librariries for +the execution of ``nest`` is indeed used. For example, you can check if ``jemalloc`` is used for the network construction +in highly parallel simulations. + +.. note:: + + The above command uses ``pldd`` which is commonly available in Linux distributions. However, you might need to change + the path, which you can find with the command ``which pldd``. + +| You can then tell the job script to schedule your simulation. Setting the ``exclusive`` option prevents other processes or jobs from doing work on the same node. @@ -222,11 +239,3 @@ It should match the number of ``cpus-per-task``. .. seealso:: :ref:`parallel_computing` - - - - - - - - diff --git a/doc/htmldoc/installation/conda_forge.rst b/doc/htmldoc/installation/conda_forge.rst index dc6198dc36..ea2cd743fa 100644 --- a/doc/htmldoc/installation/conda_forge.rst +++ b/doc/htmldoc/installation/conda_forge.rst @@ -1,23 +1,22 @@ .. _conda_forge_install: -Conda forge install +conda-forge install =================== .. admonition:: osx-arm64: missing random number generators - Due to a cross-compiling issue in the conda NEST package, some random number - generators are not available if you are using macOS arm64 architecture. + Due to a cross-compiling issue in the conda-forge NEST package, some random number + generators are not available if you are using macOS arm64 architecture. The available generators are the Mersenne Twister generators `mt19937` and `mt19937_64`. .. note:: - If you encounter problems installing the NEST conda package and - environment, we recommend using Mamba (https://mamba.readthedocs.io). + We recommend using Mamba (https://mamba.readthedocs.io). Mamba has the advantage of installing conda packages and environments more quickly and can be used as a complete drop-in replacement for conda. -1. To keep your conda setup tidy, we recommend that you install NEST into - a separate `conda environment `_ +1. To keep your mamba setup tidy, we recommend that you install NEST into + a separate environment together with Python packages that you will use when working with NEST; see also our :ref:`conda_tips`. @@ -25,27 +24,25 @@ Conda forge install .. code-block:: sh - conda create --name ENVNAME -c conda-forge nest-simulator + mamba create --name ENVNAME -c conda-forge nest-simulator To install additional packages into the environment, just list them together with ``nest-simulator``. .. code-block:: sh - conda create --name ENVNAME -c conda-forge nest-simulator jupyterlab seaborn + mamba create --name ENVNAME -c conda-forge nest-simulator jupyterlab seaborn #. To see all NEST versions available via conda, either run .. code-block:: sh - conda search -c conda-forge nest-simulator + mamba search -c conda-forge nest-simulator - or browse the `conda forge file list - `_ (note - there are multiple pages). To install, e.g., NEST 2.18.0, run + To install a specific version e.g., NEST 2.18.0, run .. code-block:: sh - conda create --name nest_2_18_0 -c conda-forge nest-simulator=2.18.0=* + mamba create --name nest_2_18_0 -c conda-forge nest-simulator=2.18.0=* The syntax for this install follows the pattern: ``nest-simulator==``. @@ -53,9 +50,9 @@ Conda forge install .. code-block:: sh - conda activate ENVNAME + mamba activate ENVNAME #. Note the following: - - We currently provide NEST with thread-based parallelization on conda. This should suffice for most + - We currently provide NEST with thread-based parallelization on conda-forge. This should suffice for most uses on personal computers. diff --git a/doc/htmldoc/installation/conda_tips.rst b/doc/htmldoc/installation/conda_tips.rst index 17a6116eae..8d2de3b2e5 100644 --- a/doc/htmldoc/installation/conda_tips.rst +++ b/doc/htmldoc/installation/conda_tips.rst @@ -1,35 +1,27 @@ .. _conda_tips: -Tips for installing NEST with conda +Tips for installing NEST with Mamba =================================== -.. note:: +.. note:: - If you encounter problems installing the NEST conda package and - environment, we recommend using Mamba (https://mamba.readthedocs.io). - Mamba has the advantage of installing conda packages and + We recommend using Mamba (https://mamba.readthedocs.io). + Mamba has the advantage of installing conda packages and environments more quickly and can be used as a complete drop-in replacement for conda. This page provides a series of recommendations for installing pre-built NEST with conda or to set up conda environments for building NEST and NEST documentation. -Basic conda setup +Basic mamba setup ----------------- -Choice of conda base installation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -We test NEST in conda environments using Miniconda installations and thus recommend -that you do the same. The recommendations that we provide here will also likely work with a -full-sized Anaconda installation, but we can only provide limited support for this. - -You can either install +Apple systems +~~~~~~~~~~~~~ -- Miniconda from ``_ -- Miniforge from ``_ -For Apple systems with an M1 chip, you must at present use Miniforge and -select the ``arm64 (Apple Silicon)`` installer to create a conda environment +For Apple systems with an M1 chip, you must at present use `Miniforge +`_ and +select the ``arm64 (Apple Silicon)`` installer to create a mamba environment that will support native builds of NEST. @@ -38,32 +30,29 @@ Keep your base environment empty Your base environment should be as empty as possible in order to avoid conflicts with other environments. Always install packages only in the new -environments (don't worry about duplicates, conda will link the packages +environments (don't worry about duplicates, mamba will link the packages if they are used in multiple environments, and not produce disk eating copies). -Get familiar with conda environments +Get familiar with mamba environments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Conda environments are a powerful tool. See the `Conda documentation on Managing Environments -`_ -for more information. To see which environments are installed on your system, use .. code:: sh - conda info --envs + mamba info --envs -Installing NEST with Conda --------------------------- +Installing NEST with conda-forge +-------------------------------- -We provide pre-built versions of NEST on `Conda Forge `_. -Follow :ref:`these instructions to install NEST from Conda Forge `. +We provide pre-built versions of NEST on `conda-forge `_. +Follow :ref:`these instructions to install NEST from conda-forge `. -Creating a Conda environment for running and building NEST +Creating a mamba environment for running and building NEST ---------------------------------------------------------- If you want to compile NEST yourself, you can create an environment containing all necessary @@ -72,15 +61,15 @@ software for running and building NEST by executing the following command from t .. code:: sh cd - conda env create -p conda + mamba env create -p mamba -This will create an environment in the folder ``conda/``. If you would like to activate the environment, use +This will create an environment in the folder ``mamba/``. If you would like to activate the environment, use .. code:: sh - conda activate conda/ + mamba activate mamba/ -Note that the trailing slash is required for conda not to confuse the path with a named environment (for example when +Note that the trailing slash is required for mamba not to confuse the path with a named environment (for example when using ``--name``). @@ -88,15 +77,10 @@ Get a good overview ------------------- Obtain a good overview of which packages are installed where. You can use -``conda env export -n base`` and ``conda env export -n yournestenv`` +``mamba env export -n base`` and ``mamba env export -n yournestenv`` (replacing the ``yournestenv`` name with whatever you chose). Make -sure each environment contains all dependencies. One way to make -this obvious would be to reduce conda stack to ``0`` (see conda documentation on -`nested activation `_), -and/or to a certain degree by not auto-activating the base environment (see conda documentation on -`conda init `_). -Then packages from base do not 'leak' into your new environments. +sure each environment contains all dependencies. .. note:: - Packages from your system will usually also be available in your conda + Packages from your system will usually also be available in your mamba environment and may cause similar conflicts. diff --git a/doc/htmldoc/installation/condaenv_install.rst b/doc/htmldoc/installation/condaenv_install.rst index 488774acbe..b4ea7947c7 100644 --- a/doc/htmldoc/installation/condaenv_install.rst +++ b/doc/htmldoc/installation/condaenv_install.rst @@ -1,24 +1,21 @@ .. _condaenv: -Install from source in a conda environment +Install from source in a mamba environment ========================================== -.. note:: +.. note:: - If you encounter problems installing the NEST conda package and - environment, we recommend using Mamba (https://mamba.readthedocs.io). - Mamba has the advantage of installing conda packages and + We recommend using Mamba (https://mamba.readthedocs.io). + Mamba has the advantage of installing conda packages and environments more quickly and can be used as a complete drop-in replacement for conda. -* Create a conda environment from the `environment.yml `_ file. - We recommend specifying a dedicated location (``-p ``) for your environment. - See the `conda documentation `_ - on using a custom location rather than the default envs folder. +* Create a mamba environment from the `environment.yml `_ file. + We recommend specifying a dedicated location (``-p ``) for your environment. .. code-block:: sh - conda env create -f nest-simulator/environment.yml --p - conda activate + mamba env create -f nest-simulator/environment.yml --p + mamba activate * Create a build directory: @@ -32,7 +29,7 @@ Install from source in a conda environment cd build_dir -* Configure NEST. Add the cmake option ``-CDMAKE_INSTALL_PREFIX:PATH=$CONDA_PREFIX`` to link nest to your active conda environment. +* Configure NEST. Add the cmake option ``-CDMAKE_INSTALL_PREFIX:PATH=$CONDA_PREFIX`` to link nest to your active mamba environment. You may need additional ``cmake`` options (see :ref:`cmake_options`). .. code-block:: sh @@ -60,5 +57,3 @@ sourcing the script: .. note:: To build the developer or user documentation see :ref:`doc_workflow` - - diff --git a/doc/htmldoc/installation/developer.rst b/doc/htmldoc/installation/developer.rst index 8ad5c567cb..e1cd378b1d 100644 --- a/doc/htmldoc/installation/developer.rst +++ b/doc/htmldoc/installation/developer.rst @@ -31,9 +31,9 @@ file that contains all possible packages needed for NEST development. .. grid:: 2 - .. grid-item-card:: Install NEST with conda + .. grid-item-card:: Install NEST with mamba - See our instructions for installing NEST from source in a :ref:`conda environment ` + See our instructions for installing NEST from source in a :ref:`mamba environment ` .. grid-item-card:: Install NEST without environment @@ -60,5 +60,3 @@ By default, everything will be installed to the subdirectories `` - conda env create -p conda/ + mamba env create -p mamba/ .. note:: @@ -40,10 +40,10 @@ Preparations .. code:: sh - conda activate conda/ + mamba activate mamba/ - This assumes that you have created the environment in the folder ``conda/`` as given above. Note that the trailing - slash is necessary for conda to distinguish it from a named environment. + This assumes that you have created the environment in the folder ``mamba/`` as given above. Note that the trailing + slash is necessary for mamba to distinguish it from a named environment. #. If you want to build NEST with MPI, you must digitally sign the ``orterun`` and ``orted`` binaries @@ -57,7 +57,7 @@ Preparations codesign -f -s "gdb-cert" `which orted` codesign -f -s "gdb-cert" `which orterun` - Instead of the ``which`` command you can also give the full path to the binary inside your conda + Instead of the ``which`` command you can also give the full path to the binary inside your mamba environment. .. note:: @@ -80,17 +80,17 @@ Building NEST cmake - If you have libraries required by NEST such as GSL installed with Homebrew and Conda, this + If you have libraries required by NEST such as GSL installed with Homebrew and mamba, this can lead to library conflicts (error messages like ``Initializing libomp.dylib, but found - libomp.dylib already initialized.``). To ensure that libraries are found first in your conda + libomp.dylib already initialized.``). To ensure that libraries are found first in your mamba environment, invoke ``cmake`` like this .. code-block:: sh - CMAKE_PREFIX_PATH= cmake + CMAKE_PREFIX_PATH= cmake - You can find the ```` for the currently active conda environment by running - ``conda info`` and looking for the "active env location" entry in the output. + You can find the ```` for the currently active mamba environment by running + ``mamba info`` and looking for the "active env location" entry in the output. To compile NEST with :ref:`MPI support `, add ``-Dwith-mpi=ON`` as ``cmake`` option. For further CMake options, see :ref:`cmake_options`. @@ -119,14 +119,13 @@ module is impossible, and environment variables must be set before NEST can be u Troubleshooting --------------- -Conda with Intel MKL +Mamba with Intel MKL ~~~~~~~~~~~~~~~~~~~~ -A default installation of Anaconda or Miniconda will install a version of NumPy -built on the Intel Math Kernel Library (MKL). This library uses a different OpenMP +The Intel Math Kernel Library (MKL) uses a different OpenMP library to support threading than what's included with Apple Clang or GCC. This will lead to conflicts if NEST is built with support for threading, which is the default and usually desirable. One way to avoid this is to follow the instructions above. An -alternative is to create a conda environment in which you install ``nomkl`` as *the -very first package*. This will tell conda to install MKL-free versions of NumPy and +alternative is to create a mamba environment in which you install ``nomkl`` as *the +very first package*. This will tell mamba to install MKL-free versions of NumPy and other linear-algebra intensive packages. diff --git a/doc/htmldoc/installation/user.rst b/doc/htmldoc/installation/user.rst index 0cc8532bfe..4cff738cf4 100644 --- a/doc/htmldoc/installation/user.rst +++ b/doc/htmldoc/installation/user.rst @@ -13,8 +13,8 @@ Docker |linux| |macos| |windows| :ref:`See our docker installation instructions `. -Conda install |linux| |macos| -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +conda-forge install |linux| |macos| +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can install NEST with the :ref:`Conda forge package `. diff --git a/doc/htmldoc/connect_nest/index.rst b/doc/htmldoc/interface_nest/index.rst similarity index 100% rename from doc/htmldoc/connect_nest/index.rst rename to doc/htmldoc/interface_nest/index.rst diff --git a/doc/htmldoc/connect_nest/nest_server.rst b/doc/htmldoc/interface_nest/nest_server.rst similarity index 99% rename from doc/htmldoc/connect_nest/nest_server.rst rename to doc/htmldoc/interface_nest/nest_server.rst index 87d3212259..1fd530490b 100644 --- a/doc/htmldoc/connect_nest/nest_server.rst +++ b/doc/htmldoc/interface_nest/nest_server.rst @@ -59,11 +59,11 @@ For native installations, the requirements can be simply installed via ``pip``:: pip3 install Flask Flask-Cors gunicorn RestrictedPython -or by installing the full NEST development environment in case you prefer using ``conda``:: +or by installing the full NEST development environment in case you prefer using ``mamba``:: cd - conda env create -p conda/ - conda activate conda/ + mamba env create -p mamba/ + mamba activate mamba/ As an alternative to a native installation, NEST Server is available from the NEST Docker image. Please check out the corresponding :ref:`installation instructions ` for more details. diff --git a/doc/htmldoc/connect_nest/using_nest_with_music.rst b/doc/htmldoc/interface_nest/using_nest_with_music.rst similarity index 100% rename from doc/htmldoc/connect_nest/using_nest_with_music.rst rename to doc/htmldoc/interface_nest/using_nest_with_music.rst diff --git a/doc/htmldoc/nest_behavior/random_numbers.rst b/doc/htmldoc/nest_behavior/random_numbers.rst index 611591910c..0777551328 100644 --- a/doc/htmldoc/nest_behavior/random_numbers.rst +++ b/doc/htmldoc/nest_behavior/random_numbers.rst @@ -5,7 +5,7 @@ Randomness in NEST Simulations .. admonition:: osx-arm64: missing random number generators - Due to a cross-compiling issue in the conda NEST package, some random number + Due to a cross-compiling issue in the conda-forge NEST package, some random number generators are not available if you are using macOS arm64 architecture. The available generators are the Mersenne Twister generators `mt19937` and `mt19937_64`. diff --git a/doc/htmldoc/ref_material/glossary.rst b/doc/htmldoc/ref_material/glossary.rst index e60c782dc3..12ff3381aa 100644 --- a/doc/htmldoc/ref_material/glossary.rst +++ b/doc/htmldoc/ref_material/glossary.rst @@ -41,22 +41,19 @@ Units of measure Nanosiemens (nS). g_L - Leak conductance in Nanosiemens (nS). + Leak conductance in nanosiemens (nS). g_K - Potassium peak conductance in Nanosiemens (nS). + Potassium peak conductance in nanosiemens (nS). g_Na - Sodium peak conductance in Nanosiemens (nS). + Sodium peak conductance in nanosiemens (nS). spike rates - Spikes/second. - - modulation frequencies - Herz (Hz). + The number of spikes that occurred in a certain time interval, usually expressed in terms of spikes per second (spks/s or s^-1). frequency - Frequncy in Hertz (Hz). + Frequency in Hertz (Hz). Note that spike rates are often better expressed in terms of spikes per second (spks/s or s^-1). voltage Millivolts (mV). diff --git a/doc/htmldoc/static/img/mam_benchmark.png b/doc/htmldoc/static/img/mam_benchmark.png deleted file mode 100644 index 56a4601910..0000000000 Binary files a/doc/htmldoc/static/img/mam_benchmark.png and /dev/null differ diff --git a/doc/htmldoc/static/img/mam_ground-state_benchmark.png b/doc/htmldoc/static/img/mam_ground-state_benchmark.png new file mode 100644 index 0000000000..d8d1f9b89b Binary files /dev/null and b/doc/htmldoc/static/img/mam_ground-state_benchmark.png differ diff --git a/doc/htmldoc/static/img/mam_metastable-state_benchmark.png b/doc/htmldoc/static/img/mam_metastable-state_benchmark.png new file mode 100644 index 0000000000..00adf12306 Binary files /dev/null and b/doc/htmldoc/static/img/mam_metastable-state_benchmark.png differ diff --git a/doc/htmldoc/troubleshooting.rst b/doc/htmldoc/troubleshooting.rst index 3d1adb2788..cd7944bb7b 100644 --- a/doc/htmldoc/troubleshooting.rst +++ b/doc/htmldoc/troubleshooting.rst @@ -150,7 +150,7 @@ If your Python version is correct and you still have the same error, then try on .. code-block:: bash - conda info -e + mamba info -e An asterisk (\*) indicates the active environment. @@ -158,7 +158,7 @@ If your Python version is correct and you still have the same error, then try on .. code-block:: bash - conda activate ENVNAME + mamba activate ENVNAME Try to ``import nest`` in Python. @@ -175,22 +175,22 @@ If your Python version is correct and you still have the same error, then try on .. code-block:: bash - /path/to/conda/envs/ENVNAME/bin/python3 - /path/to/conda/envs/ENVNAME/bin/nest + /path/to/mamba/envs/ENVNAME/bin/python3 + /path/to/mamba/envs/ENVNAME/bin/nest You can also view the list of packages in the active environment, by running: .. code-block:: bash - conda list + mamba list If the package is not in your environment, then it needs to be installed. - If something is missing, you can try to ``conda install `` BUT be aware that this **may break pre-installed packages**! + If something is missing, you can try to ``mamba install `` BUT be aware that this **may break pre-installed packages**! - You may be better off creating a new Conda environment and install NEST with all needed packages at one time! - See the section on :ref:`installation for Conda `. + You may be better off creating a new mamba environment and install NEST with all needed packages at one time! + See the section on :ref:`installation for NEST with conda-forge `. diff --git a/doc/htmldoc/whats_new/v3.0/features/index.rst b/doc/htmldoc/whats_new/v3.0/features/index.rst index c8826be02f..dfdc605674 100644 --- a/doc/htmldoc/whats_new/v3.0/features/index.rst +++ b/doc/htmldoc/whats_new/v3.0/features/index.rst @@ -27,4 +27,4 @@ Here you can discover the new features NEST 3.0 has to offer! random_number_generators recording_simulations stimulation_backends - ../../../connect_nest/nest_server + ../../../interface_nest/nest_server diff --git a/environment.yml b/environment.yml index 6927bd8e27..973e486abc 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,6 @@ -# Conda environment specification for NEST Simulator. +# Mamba environment specification for NEST Simulator. # -# This file specifies a conda environment for those who would +# This file specifies a mamba environment for those who would # like to compile NEST or build NEST documentation themselves. # If you just want to execute NEST, you should install NEST # directly as described in https://www.nest-simulator.org/installation. @@ -19,7 +19,7 @@ # # To create an environment from this file, run # -# conda env create --name --file environment.yml +# mamba env create --name --file environment.yml # # where is a name of your choice. @@ -42,11 +42,11 @@ dependencies: - doxygen - graphviz - # mpi4py must be installed by conda in order to automatically find the path - # to OpenMPI installed by conda. Note that mpi4py also is included in + # mpi4py must be installed by mamba in order to automatically find the path + # to OpenMPI installed by mamba. Note that mpi4py also is included in # requirements_pynest.txt in case someone wants to build an environment - # without conda. When this conda environment is built, the pip installation - # of mpi4py will be skipped since it is already installed by conda. + # without mamba. When this mamba environment is built, the pip installation + # of mpi4py will be skipped since it is already installed by mamba. - mpi4py - pip: diff --git a/models/aeif_cond_alpha.cpp b/models/aeif_cond_alpha.cpp index 4f4d2a7524..dc8298bc3e 100644 --- a/models/aeif_cond_alpha.cpp +++ b/models/aeif_cond_alpha.cpp @@ -384,9 +384,9 @@ nest::aeif_cond_alpha::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.s_ ) { diff --git a/models/aeif_cond_alpha.h b/models/aeif_cond_alpha.h index 43ff066e9a..4cdc4ddf6e 100644 --- a/models/aeif_cond_alpha.h +++ b/models/aeif_cond_alpha.h @@ -103,7 +103,14 @@ and For the reference implementation of this model, see `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. -See also [1]_. + +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. Parameters ++++++++++ diff --git a/models/aeif_cond_alpha_astro.cpp b/models/aeif_cond_alpha_astro.cpp index 949f07b6d3..9b073b5487 100644 --- a/models/aeif_cond_alpha_astro.cpp +++ b/models/aeif_cond_alpha_astro.cpp @@ -386,9 +386,9 @@ nest::aeif_cond_alpha_astro::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.s_ ) { diff --git a/models/aeif_cond_alpha_astro.h b/models/aeif_cond_alpha_astro.h index afc1e08f8f..09a15141e6 100644 --- a/models/aeif_cond_alpha_astro.h +++ b/models/aeif_cond_alpha_astro.h @@ -110,7 +110,14 @@ For implementation details of the adaptive exponential integrate-and-fire neuron model, see the `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. -See also [1]_. + +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. Parameters ++++++++++ diff --git a/models/aeif_cond_alpha_multisynapse.cpp b/models/aeif_cond_alpha_multisynapse.cpp index 01dde98917..f027713973 100644 --- a/models/aeif_cond_alpha_multisynapse.cpp +++ b/models/aeif_cond_alpha_multisynapse.cpp @@ -347,7 +347,7 @@ aeif_cond_alpha_multisynapse::Buffers_::Buffers_( aeif_cond_alpha_multisynapse& , c_( nullptr ) , e_( nullptr ) , step_( Time::get_resolution().get_ms() ) - , IntegrationStep_( std::min( 0.01, step_ ) ) + , IntegrationStep_( step_ ) , I_stim_( 0.0 ) { } @@ -416,9 +416,9 @@ aeif_cond_alpha_multisynapse::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.c_ ) { diff --git a/models/aeif_cond_alpha_multisynapse.h b/models/aeif_cond_alpha_multisynapse.h index a85fca7009..2366f81b96 100644 --- a/models/aeif_cond_alpha_multisynapse.h +++ b/models/aeif_cond_alpha_multisynapse.h @@ -96,6 +96,14 @@ When the neuron fires a spike, the adaptation current :math:`w <- w + b`. For implementation details see the `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. + Parameters ++++++++++ @@ -155,6 +163,14 @@ Receives SpikeEvent, CurrentEvent, DataLoggingRequest +References +++++++++++ + +.. [1] Brette R and Gerstner W (2005). Adaptive exponential + integrate-and-fire model as an effective description of neuronal + activity. Journal of Neurophysiology. 943637-3642 + DOI: https://doi.org/10.1152/jn.00686.2005 + See also ++++++++ diff --git a/models/aeif_cond_beta_multisynapse.cpp b/models/aeif_cond_beta_multisynapse.cpp index 786d3d2613..5ef7e10717 100644 --- a/models/aeif_cond_beta_multisynapse.cpp +++ b/models/aeif_cond_beta_multisynapse.cpp @@ -355,7 +355,7 @@ aeif_cond_beta_multisynapse::Buffers_::Buffers_( aeif_cond_beta_multisynapse& n , c_( nullptr ) , e_( nullptr ) , step_( Time::get_resolution().get_ms() ) - , IntegrationStep_( std::min( 0.01, step_ ) ) + , IntegrationStep_( step_ ) , I_stim_( 0.0 ) { } @@ -424,9 +424,9 @@ aeif_cond_beta_multisynapse::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.c_ ) { diff --git a/models/aeif_cond_beta_multisynapse.h b/models/aeif_cond_beta_multisynapse.h index faa5523cd8..34eec8f0d7 100644 --- a/models/aeif_cond_beta_multisynapse.h +++ b/models/aeif_cond_beta_multisynapse.h @@ -113,6 +113,14 @@ When the neuron fires a spike, the adaptation current `w <- w + b`. For implementation details see the `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. + Parameters ++++++++++ @@ -172,6 +180,14 @@ Receives SpikeEvent, CurrentEvent, DataLoggingRequest +References +++++++++++ + +.. [1] Brette R and Gerstner W (2005). Adaptive exponential + integrate-and-fire model as an effective description of neuronal + activity. Journal of Neurophysiology. 943637-3642 + DOI: https://doi.org/10.1152/jn.00686.2005 + See also ++++++++ diff --git a/models/aeif_cond_exp.cpp b/models/aeif_cond_exp.cpp index 9f45e5bbb6..cb0eb86d0c 100644 --- a/models/aeif_cond_exp.cpp +++ b/models/aeif_cond_exp.cpp @@ -379,9 +379,9 @@ nest::aeif_cond_exp::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.s_ ) { diff --git a/models/aeif_cond_exp.h b/models/aeif_cond_exp.h index 43036f7c51..dc314629b1 100644 --- a/models/aeif_cond_exp.h +++ b/models/aeif_cond_exp.h @@ -105,7 +105,14 @@ setting V_peak too high. For implementation details see the `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. -See also [1]_. + +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. Parameters: diff --git a/models/aeif_psc_alpha.cpp b/models/aeif_psc_alpha.cpp index e8e1ad2b93..b4a1b9c86e 100644 --- a/models/aeif_psc_alpha.cpp +++ b/models/aeif_psc_alpha.cpp @@ -374,9 +374,9 @@ nest::aeif_psc_alpha::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.s_ ) { diff --git a/models/aeif_psc_alpha.h b/models/aeif_psc_alpha.h index 44dce7c868..36c8e43b54 100644 --- a/models/aeif_psc_alpha.h +++ b/models/aeif_psc_alpha.h @@ -95,7 +95,13 @@ Here :math:`H(t)` is the Heaviside step function and `k` indexes incoming spikes For implementation details see the `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. -See also [1]_. +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. Parameters ++++++++++ diff --git a/models/aeif_psc_delta.cpp b/models/aeif_psc_delta.cpp index 5c9122a489..7cafe3ad64 100644 --- a/models/aeif_psc_delta.cpp +++ b/models/aeif_psc_delta.cpp @@ -351,9 +351,9 @@ nest::aeif_psc_delta::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.s_ ) { diff --git a/models/aeif_psc_delta.h b/models/aeif_psc_delta.h index 5ce8cda93a..26f937ea95 100644 --- a/models/aeif_psc_delta.h +++ b/models/aeif_psc_delta.h @@ -97,7 +97,13 @@ the value of `J` after a spike. For implementation details see the `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. -See also [1]_. +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. Parameters ++++++++++ diff --git a/models/aeif_psc_delta_clopath.cpp b/models/aeif_psc_delta_clopath.cpp index d73405128f..c45158ee77 100644 --- a/models/aeif_psc_delta_clopath.cpp +++ b/models/aeif_psc_delta_clopath.cpp @@ -417,9 +417,9 @@ nest::aeif_psc_delta_clopath::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.s_ ) { diff --git a/models/aeif_psc_delta_clopath.h b/models/aeif_psc_delta_clopath.h index 6a3ece45e9..111fae8303 100644 --- a/models/aeif_psc_delta_clopath.h +++ b/models/aeif_psc_delta_clopath.h @@ -93,6 +93,14 @@ For implementation details see the See also [2]_. +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [4]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. + Parameters ++++++++++ @@ -190,6 +198,11 @@ References .. [3] Voltage-based STDP synapse (Clopath et al. 2010) on ModelDB https://modeldb.science/144566?tab=1 +.. [4] Brette R and Gerstner W (2005). Adaptive exponential + integrate-and-fire model as an effective description of neuronal + activity. Journal of Neurophysiology. 943637-3642 + DOI: https://doi.org/10.1152/jn.00686.2005 + See also ++++++++ diff --git a/models/aeif_psc_exp.cpp b/models/aeif_psc_exp.cpp index 928363340e..6b8aec869c 100644 --- a/models/aeif_psc_exp.cpp +++ b/models/aeif_psc_exp.cpp @@ -369,9 +369,9 @@ nest::aeif_psc_exp::init_buffers_() B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); - - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.s_ ) { diff --git a/models/aeif_psc_exp.h b/models/aeif_psc_exp.h index 35ee0ed501..80beca144b 100644 --- a/models/aeif_psc_exp.h +++ b/models/aeif_psc_exp.h @@ -95,7 +95,13 @@ Here :math:`H(t)` is the Heaviside step function and `k` indexes incoming spikes For implementation details see the `aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook. -See also [1]_. +.. note:: + + The default refractory period for ``aeif`` models is zero, consistent with the model definition in + Brette & Gerstner [1]_. Thus, an ``aeif`` neuron with default parameters can fire multiple spikes in a single + time step, which can lead to exploding spike numbers and extreme slow-down of simulations. + + To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``. Parameters ++++++++++ diff --git a/models/glif_cond.cpp b/models/glif_cond.cpp index 35fe0d47d9..a1434786b9 100644 --- a/models/glif_cond.cpp +++ b/models/glif_cond.cpp @@ -465,7 +465,7 @@ nest::glif_cond::Buffers_::Buffers_( glif_cond& n ) , c_( nullptr ) , e_( nullptr ) , step_( Time::get_resolution().get_ms() ) - , IntegrationStep_( std::min( 0.01, step_ ) ) + , IntegrationStep_( step_ ) , I_( 0.0 ) { } @@ -534,8 +534,9 @@ nest::glif_cond::init_buffers_() B_.logger_.reset(); // includes resize B_.step_ = Time::get_resolution().get_ms(); - // We must integrate this model with high-precision to obtain decent results - B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); + B_.IntegrationStep_ = + B_.step_; // reasonable initial value for numerical integrator step size; this will anyway be overwritten by + // gsl_odeiv_evolve_apply(), but it might confuse the integrator if it contains uninitialised data if ( not B_.c_ ) { diff --git a/models/mip_generator.cpp b/models/mip_generator.cpp index 7ff9f6e48d..bf60516e97 100644 --- a/models/mip_generator.cpp +++ b/models/mip_generator.cpp @@ -44,7 +44,7 @@ nest::register_mip_generator( const std::string& name ) * ---------------------------------------------------------------- */ nest::mip_generator::Parameters_::Parameters_() - : rate_( 0.0 ) // Hz + : rate_( 0.0 ) // spks/s , p_copy_( 1.0 ) { } @@ -114,7 +114,7 @@ nest::mip_generator::pre_run_hook() { StimulationDevice::pre_run_hook(); - // rate_ is in Hz, dt in ms, so we have to convert from s to ms + // rate_ is in spks/s, dt in ms, so we have to convert from s to ms poisson_distribution::param_type param( Time::get_resolution().get_ms() * P_.rate_ * 1e-3 ); V_.poisson_dist_.param( param ); } diff --git a/models/mip_generator.h b/models/mip_generator.h index fc85e151a7..ff1eb91ded 100644 --- a/models/mip_generator.h +++ b/models/mip_generator.h @@ -151,7 +151,7 @@ class mip_generator : public StimulationDevice */ struct Parameters_ { - double rate_; //!< process rate in Hz + double rate_; //!< process rate in spks/s double p_copy_; //!< copy probability for each spike in the parent process Parameters_(); //!< Sets default parameter values diff --git a/models/poisson_generator.cpp b/models/poisson_generator.cpp index 82296b00c4..516a886bca 100644 --- a/models/poisson_generator.cpp +++ b/models/poisson_generator.cpp @@ -48,7 +48,7 @@ nest::register_poisson_generator( const std::string& name ) * ---------------------------------------------------------------- */ nest::poisson_generator::Parameters_::Parameters_() - : rate_( 0.0 ) // Hz + : rate_( 0.0 ) // spks/s { } @@ -112,7 +112,7 @@ nest::poisson_generator::pre_run_hook() { StimulationDevice::pre_run_hook(); - // rate_ is in Hz, dt in ms, so we have to convert from s to ms + // rate_ is in spks/s, dt in ms, so we have to convert from s to ms poisson_distribution::param_type param( Time::get_resolution().get_ms() * P_.rate_ * 1e-3 ); V_.poisson_dist_.param( param ); } diff --git a/models/poisson_generator_ps.cpp b/models/poisson_generator_ps.cpp index 8f587de1a3..7a913d15bc 100644 --- a/models/poisson_generator_ps.cpp +++ b/models/poisson_generator_ps.cpp @@ -51,7 +51,7 @@ nest::register_poisson_generator_ps( const std::string& name ) * ---------------------------------------------------------------- */ nest::poisson_generator_ps::Parameters_::Parameters_() - : rate_( 0.0 ) // Hz + : rate_( 0.0 ) // spks/s , dead_time_( 0.0 ) // ms , num_targets_( 0 ) { diff --git a/models/poisson_generator_ps.h b/models/poisson_generator_ps.h index 075c16a23b..4718c4f055 100644 --- a/models/poisson_generator_ps.h +++ b/models/poisson_generator_ps.h @@ -148,7 +148,7 @@ class poisson_generator_ps : public StimulationDevice */ struct Parameters_ { - double rate_; //!< process rate [Hz] + double rate_; //!< process rate [spks/s] double dead_time_; //!< dead time [ms] /** diff --git a/models/sinusoidal_poisson_generator.cpp b/models/sinusoidal_poisson_generator.cpp index 5c8560deaf..6a24cfae5f 100644 --- a/models/sinusoidal_poisson_generator.cpp +++ b/models/sinusoidal_poisson_generator.cpp @@ -281,7 +281,7 @@ nest::sinusoidal_poisson_generator::update( Time const& origin, const long from, kernel().event_delivery_manager.send( *this, se, lag ); } } - // store rate in Hz + // store rate in spks/s B_.logger_.record_data( origin.get_steps() + lag ); } } diff --git a/models/step_rate_generator.h b/models/step_rate_generator.h index c3f3219319..4853c15f7f 100644 --- a/models/step_rate_generator.h +++ b/models/step_rate_generator.h @@ -53,7 +53,7 @@ The ``rate_generator`` provides a piecewise constant rate input to the connected rate unit(s). Please note that this input is handled in the same way as input from any other rate unit, that is, it is processed by the input function of the receiving rate unit. The amplitude of the rate is changed -at the specified times. The unit of the rate is Hz. +at the specified times. The unit of the rate is spks/s. If ``allow_offgrid_times`` is false, times will be rounded to the nearest grid point if they are less than tic/2 from the grid point, otherwise diff --git a/nestkernel/CMakeLists.txt b/nestkernel/CMakeLists.txt index 94aee72cc9..685fb741aa 100644 --- a/nestkernel/CMakeLists.txt +++ b/nestkernel/CMakeLists.txt @@ -135,7 +135,7 @@ if ( HAVE_MPI ) endif () -# Prevent problems with Conda path substitution (see #2348) +# Prevent problems with Mamba path substitution (see #2348) set_source_files_properties( dynamicloader.cpp PROPERTIES COMPILE_OPTIONS "-O0" ) diff --git a/nestkernel/growth_curve.h b/nestkernel/growth_curve.h index 1d4b03b148..9671ea0023 100644 --- a/nestkernel/growth_curve.h +++ b/nestkernel/growth_curve.h @@ -104,7 +104,7 @@ class GrowthCurve * rate that the neuron should achieve. For example, an * eps = 0.05 [Ca2+] with tau_Ca = 10000.0 and beta_Ca = * 0.001 for a synaptic element means a desired firing - * rate of 5Hz. + * rate of 5 spks/s. * * References: * [1] Butz, Markus, Florentin Wörgötter, and Arjen van Ooyen. @@ -184,7 +184,7 @@ class GrowthCurveLinear : public GrowthCurve * firing rate that the neuron should achieve. For * example, an eps = 0.05 [Ca2+] with tau_Ca = 10000.0 * and beta_Ca = 0.001 for a synaptic element means a - * desired firing rate of 5Hz. + * desired firing rate of 5 spks/s. * * nu double - Growth rate in elements/ms. The growth rate nu is * defined in the SynapticElement class. Can be negative. @@ -265,7 +265,7 @@ class GrowthCurveGaussian : public GrowthCurve * firing rate that the neuron should achieve. For * example, an eps = 0.05 [Ca2+] with tau_Ca = 10000.0 * and beta_Ca = 0.001 for a synaptic element means a - * desired firing rate of 5Hz. + * desired firing rate of 5 spks/s. * * nu double - Growth rate in elements/ms. The growth rate nu is * defined in the SynapticElement class. Can be negative. diff --git a/nestkernel/structural_plasticity_node.h b/nestkernel/structural_plasticity_node.h index 55c0847488..ffaf0c9f67 100644 --- a/nestkernel/structural_plasticity_node.h +++ b/nestkernel/structural_plasticity_node.h @@ -130,7 +130,7 @@ class StructuralPlasticityNode : public Node * * Intracellular calcium concentration has a linear factor to mean * electrical activity of 10^2, this means, for example, that a [Ca2+] of - * 0.2 is equivalent to a mean activity of 20 Hz. + * 0.2 is equivalent to a mean activity of 20 spks/s. */ double Ca_minus_; diff --git a/pynest/examples/EI_clustered_network/network_EI.py b/pynest/examples/EI_clustered_network/network_EI.py index aa7a4fe7c1..8c12bf7030 100644 --- a/pynest/examples/EI_clustered_network/network_EI.py +++ b/pynest/examples/EI_clustered_network/network_EI.py @@ -147,14 +147,18 @@ def create_populations(self): "t_ref": self._params["t_ref"], "V_th": self._params["V_th_E"], "V_reset": self._params["V_r"], - "I_e": I_xE - if self._params["delta_I_xE"] == 0 - else I_xE * nest.random.uniform(1 - self._params["delta_I_xE"] / 2, 1 + self._params["delta_I_xE"] / 2), + "I_e": ( + I_xE + if self._params["delta_I_xE"] == 0 + else I_xE * nest.random.uniform(1 - self._params["delta_I_xE"] / 2, 1 + self._params["delta_I_xE"] / 2) + ), "tau_syn_ex": self._params["tau_syn_ex"], "tau_syn_in": self._params["tau_syn_in"], - "V_m": self._params["V_m"] - if not self._params["V_m"] == "rand" - else self._params["V_th_E"] - 20 * nest.random.lognormal(0, 1), + "V_m": ( + self._params["V_m"] + if not self._params["V_m"] == "rand" + else self._params["V_th_E"] - 20 * nest.random.lognormal(0, 1) + ), } I_neuron_params = { "E_L": self._params["E_L"], @@ -163,14 +167,18 @@ def create_populations(self): "t_ref": self._params["t_ref"], "V_th": self._params["V_th_I"], "V_reset": self._params["V_r"], - "I_e": I_xI - if self._params["delta_I_xE"] == 0 - else I_xI * nest.random.uniform(1 - self._params["delta_I_xE"] / 2, 1 + self._params["delta_I_xE"] / 2), + "I_e": ( + I_xI + if self._params["delta_I_xE"] == 0 + else I_xI * nest.random.uniform(1 - self._params["delta_I_xE"] / 2, 1 + self._params["delta_I_xE"] / 2) + ), "tau_syn_ex": self._params["tau_syn_ex"], "tau_syn_in": self._params["tau_syn_in"], - "V_m": self._params["V_m"] - if not self._params["V_m"] == "rand" - else self._params["V_th_I"] - 20 * nest.random.lognormal(0, 1), + "V_m": ( + self._params["V_m"] + if not self._params["V_m"] == "rand" + else self._params["V_th_I"] - 20 * nest.random.lognormal(0, 1) + ), } # iaf_psc_exp allows stochasticity, if not used - don't supply the parameters and use diff --git a/pynest/examples/astrocytes/astrocyte_interaction.py b/pynest/examples/astrocytes/astrocyte_interaction.py index f75fa0ea16..7634ef4be9 100644 --- a/pynest/examples/astrocytes/astrocyte_interaction.py +++ b/pynest/examples/astrocytes/astrocyte_interaction.py @@ -134,7 +134,7 @@ axes[1].plot(data_astro["times"], data_astro["IP3"]) axes[2].plot(data_post["times"], data_post["I_SIC"]) axes[3].plot(data_astro["times"], data_astro["Ca_astro"]) -axes[0].set_title(f"Presynaptic neuron\n(Poisson rate = {poisson_rate_neuro} Hz)") +axes[0].set_title(f"Presynaptic neuron\n(Poisson rate = {poisson_rate_neuro} spks/s)") axes[0].set_ylabel("Membrane potential (mV)") axes[2].set_title("Postsynaptic neuron") axes[2].set_ylabel("Slow inward current (pA)") diff --git a/pynest/examples/balancedneuron.py b/pynest/examples/balancedneuron.py index d815a07c06..a76cecc587 100644 --- a/pynest/examples/balancedneuron.py +++ b/pynest/examples/balancedneuron.py @@ -123,13 +123,13 @@ def output_rate(guess): - print("Inhibitory rate estimate: %5.2f Hz" % guess) + print(f"Inhibitory rate estimate: {guess:5.2f} spks/s") rate = float(abs(n_in * guess)) noise[1].rate = rate spikerecorder.n_events = 0 nest.Simulate(t_sim) out = spikerecorder.n_events * 1000.0 / t_sim - print(" -> Neuron rate: %6.2f Hz (goal: %4.2f Hz)" % (out, r_ex)) + print(f" -> Neuron rate: {out:6.2f} spks/s (goal: {r_ex:4.2f} spks/s)") return out @@ -143,13 +143,13 @@ def output_rate(guess): # During simulation, the ``spike_recorder`` counts the spikes of the target # neuron and the total number is read out at the end of the simulation # period. The return value of ``output_rate()`` is the firing rate of the -# target neuron in Hz. +# target neuron in spks/s. # # Second, the scipy function ``bisect`` is used to determine the optimal # firing rate of the neurons of the inhibitory population. in_rate = bisect(lambda x: output_rate(x) - r_ex, lower, upper, xtol=prec) -print("Optimal rate for the inhibitory population: %.2f Hz" % in_rate) +print(f"Optimal rate for the inhibitory population: {in_rate:.2f} spks/s") ############################################################################### # The function ``bisect`` takes four arguments: first a function whose diff --git a/pynest/examples/brunel_alpha_nest.py b/pynest/examples/brunel_alpha_nest.py index cae0a6ca1e..5c2217d139 100755 --- a/pynest/examples/brunel_alpha_nest.py +++ b/pynest/examples/brunel_alpha_nest.py @@ -154,7 +154,7 @@ def ComputePSPnorm(tauMem, CMem, tauSyn): # Definition of threshold rate, which is the external rate needed to fix the # membrane potential around its threshold, the external firing rate and the # rate of the poisson generator which is multiplied by the in-degree CE and -# converted to Hz by multiplication by 1000. +# converted to spks/s by multiplication by 1000. nu_th = (theta * CMem) / (J_ex * CE * np.exp(1) * tauMem * tauSyn) nu_ex = eta * nu_th @@ -281,7 +281,7 @@ def ComputePSPnorm(tauMem, CMem, tauSyn): # Calculation of the average firing rate of the excitatory and the inhibitory # neurons by dividing the total number of recorded spikes by the number of # neurons recorded from and the simulation time. The multiplication by 1000.0 -# converts the unit 1/ms to 1/s=Hz. +# converts the unit 1/ms to 1/s. rate_ex = events_ex / simtime * 1000.0 / N_rec rate_in = events_in / simtime * 1000.0 / N_rec @@ -310,8 +310,8 @@ def ComputePSPnorm(tauMem, CMem, tauSyn): print(f"Number of synapses: {num_synapses}") print(f" Excitatory : {num_synapses_ex}") print(f" Inhibitory : {num_synapses_in}") -print(f"Excitatory rate : {rate_ex:.2f} Hz") -print(f"Inhibitory rate : {rate_in:.2f} Hz") +print(f"Excitatory rate : {rate_ex:.2f} spks/s") +print(f"Inhibitory rate : {rate_in:.2f} spks/s") print(f"Building time : {build_time:.2f} s") print(f"Simulation time : {sim_time:.2f} s") diff --git a/pynest/examples/brunel_delta_nest.py b/pynest/examples/brunel_delta_nest.py index 6d8d27bd69..863a15f79a 100755 --- a/pynest/examples/brunel_delta_nest.py +++ b/pynest/examples/brunel_delta_nest.py @@ -106,7 +106,7 @@ # Definition of threshold rate, which is the external rate needed to fix the # membrane potential around its threshold, the external firing rate and the # rate of the poisson generator which is multiplied by the in-degree CE and -# converted to Hz by multiplication by 1000. +# converted to spks/s by multiplication by 1000. nu_th = theta / (J * CE * tauMem) nu_ex = eta * nu_th @@ -233,7 +233,7 @@ # Calculation of the average firing rate of the excitatory and the inhibitory # neurons by dividing the total number of recorded spikes by the number of # neurons recorded from and the simulation time. The multiplication by 1000.0 -# converts the unit 1/ms to 1/s=Hz. +# converts the unit 1/ms to 1/s. rate_ex = events_ex / simtime * 1000.0 / N_rec rate_in = events_in / simtime * 1000.0 / N_rec @@ -262,8 +262,8 @@ print(f"Number of synapses: {num_synapses}") print(f" Excitatory : {num_synapses_ex}") print(f" Inhibitory : {num_synapses_in}") -print(f"Excitatory rate : {rate_ex:.2f} Hz") -print(f"Inhibitory rate : {rate_in:.2f} Hz") +print(f"Excitatory rate : {rate_ex:.2f} spks/s") +print(f"Inhibitory rate : {rate_in:.2f} spks/s") print(f"Building time : {build_time:.2f} s") print(f"Simulation time : {sim_time:.2f} s") diff --git a/pynest/examples/brunel_exp_multisynapse_nest.py b/pynest/examples/brunel_exp_multisynapse_nest.py index bcd5eec8ca..815ca783f5 100644 --- a/pynest/examples/brunel_exp_multisynapse_nest.py +++ b/pynest/examples/brunel_exp_multisynapse_nest.py @@ -130,7 +130,7 @@ # Definition of threshold rate, which is the external rate needed to fix the # membrane potential around its threshold, the external firing rate and the # rate of the poisson generator which is multiplied by the in-degree CE and -# converted to Hz by multiplication by 1000. +# converted to spks/s by multiplication by 1000. nu_th = theta / (J * CE * tauMem) nu_ex = eta * nu_th @@ -265,7 +265,7 @@ # Calculation of the average firing rate of the excitatory and the inhibitory # neurons by dividing the total number of recorded spikes by the number of # neurons recorded from and the simulation time. The multiplication by 1000.0 -# converts the unit 1/ms to 1/s=Hz. +# converts the unit 1/ms to 1/s. rate_ex = events_ex / simtime * 1000.0 / N_rec rate_in = events_in / simtime * 1000.0 / N_rec @@ -294,8 +294,8 @@ print(f"Number of synapses: {num_synapses}") print(f" Excitatory : {num_synapses_ex}") print(f" Inhibitory : {num_synapses_in}") -print(f"Excitatory rate : {rate_ex:.2f} Hz") -print(f"Inhibitory rate : {rate_in:.2f} Hz") +print(f"Excitatory rate : {rate_ex:.2f} spks/s") +print(f"Inhibitory rate : {rate_in:.2f} spks/s") print(f"Building time : {build_time:.2f} s") print(f"Simulation time : {sim_time:.2f} s") diff --git a/pynest/examples/brunel_siegert_nest.py b/pynest/examples/brunel_siegert_nest.py index eb82703fb1..f6f0a22dc4 100644 --- a/pynest/examples/brunel_siegert_nest.py +++ b/pynest/examples/brunel_siegert_nest.py @@ -202,5 +202,5 @@ rates_ex = data["rate"][numpy.where(data["senders"] == siegert_ex.global_id)] rates_in = data["rate"][numpy.where(data["senders"] == siegert_in.global_id)] times = data["times"][numpy.where(data["senders"] == siegert_in.global_id)] -print(f"Excitatory rate : {rates_ex[-1]:.2f} Hz") -print(f"Inhibitory rate : {rates_in[-1]:.2f} Hz") +print(f"Excitatory rate : {rates_ex[-1]:.2f} spks/s") +print(f"Inhibitory rate : {rates_in[-1]:.2f} spks/s") diff --git a/pynest/examples/gap_junctions_inhibitory_network.py b/pynest/examples/gap_junctions_inhibitory_network.py index 18a0d0d9a0..8c68754f31 100644 --- a/pynest/examples/gap_junctions_inhibitory_network.py +++ b/pynest/examples/gap_junctions_inhibitory_network.py @@ -143,11 +143,11 @@ spikes = events["senders"] n_spikes = sr.n_events -hz_rate = (1000.0 * n_spikes / simtime) / n_neuron +spike_rate = (1000.0 * n_spikes / simtime) / n_neuron plt.figure(1) plt.plot(times, spikes, "o") -plt.title(f"Average spike rate (Hz): {hz_rate:.2f}") +plt.title(f"Average spike rate: {spike_rate:.2f} spks/s") plt.xlabel("time (ms)") plt.ylabel("neuron no") plt.show() diff --git a/pynest/examples/gif_pop_psc_exp.py b/pynest/examples/gif_pop_psc_exp.py index 6867ff4206..f1b091bac2 100644 --- a/pynest/examples/gif_pop_psc_exp.py +++ b/pynest/examples/gif_pop_psc_exp.py @@ -226,12 +226,12 @@ plt.figure(1) plt.clf() plt.subplot(2, 1, 1) -plt.plot(t, A_N * 1000) # plot population activities (in Hz) -plt.ylabel(r"$A_N$ [Hz]") +plt.plot(t, A_N * 1000) # plot population activities (in spks/s) +plt.ylabel(r"$A_N$ [spks/s]") plt.title("Population activities (mesoscopic sim.)") plt.subplot(2, 1, 2) plt.plot(t, Abar * 1000) # plot instantaneous population rates (in Hz) -plt.ylabel(r"$\bar A$ [Hz]") +plt.ylabel(r"$\bar A$ [spks/s]") plt.xlabel("time [ms]") ############################################################################### @@ -334,19 +334,19 @@ ############################################################################### # Let's retrieve the data of the spike recorder and plot the activity of the -# excitatory population (in Hz): +# excitatory population (in spks/s): for i in range(len(nest_pops)): data_sr = nest_sr[i].get("events", "times") * dt - t0 bins = np.concatenate((t, np.array([t[-1] + dt_rec]))) A = np.histogram(data_sr, bins=bins)[0] / float(N[i]) / dt_rec - A_N[:, i] = A * 1000 # in Hz + A_N[:, i] = A * 1000 # in spks/s t = np.arange(dt, t_end + dt, dt_rec) plt.figure(2) plt.plot(t, A_N[:, 0]) plt.xlabel("time [ms]") -plt.ylabel("population activity [Hz]") +plt.ylabel("population activity [spks/s]") plt.title("Population activities (microscopic sim.)") ############################################################################### diff --git a/pynest/examples/gif_population.py b/pynest/examples/gif_population.py index 9f73dbccdb..bd005e710a 100644 --- a/pynest/examples/gif_population.py +++ b/pynest/examples/gif_population.py @@ -95,7 +95,7 @@ # GIF neurons population. N_noise = 50 # size of Poisson group -rate_noise = 10.0 # firing rate of Poisson neurons (Hz) +rate_noise = 10.0 # firing rate of Poisson neurons (spks/s) w_noise = 20.0 # synaptic weights from Poisson to population neurons (pA) ############################################################################### diff --git a/pynest/examples/lin_rate_ipn_network.py b/pynest/examples/lin_rate_ipn_network.py index a8b8140b54..b972a33cff 100644 --- a/pynest/examples/lin_rate_ipn_network.py +++ b/pynest/examples/lin_rate_ipn_network.py @@ -74,7 +74,7 @@ # time constant of neuronal dynamics in ms "mu": 2.0, # mean input - "sigma": 5.0 + "sigma": 5.0, # noise parameter } diff --git a/pynest/examples/one_neuron_with_noise.py b/pynest/examples/one_neuron_with_noise.py index ea64005bd2..44e5954611 100755 --- a/pynest/examples/one_neuron_with_noise.py +++ b/pynest/examples/one_neuron_with_noise.py @@ -56,9 +56,9 @@ ############################################################################### # Third, the Poisson generator is configured using ``SetStatus``, which expects # a list of node handles and a list of parameter dictionaries. We set the -# Poisson generators to 80,000 Hz and 15,000 Hz, respectively. Note that we do -# not need to set parameters for the neuron and the voltmeter, since they have -# satisfactory defaults. +# Poisson generators to 80,000 spks/s and 15,000 spks/s, respectively. Note that +# we do not need to set parameters for the neuron and the voltmeter, since they +# have satisfactory defaults. noise[0].rate = 80000.0 noise[1].rate = 15000.0 diff --git a/pynest/examples/pong/networks.py b/pynest/examples/pong/networks.py index 4081888d6f..db5aa188b9 100644 --- a/pynest/examples/pong/networks.py +++ b/pynest/examples/pong/networks.py @@ -259,7 +259,7 @@ class PongNetDopa(PongNet): # Synaptic delay for the direct connection between striatum and # dopaminergic neurons d_dir = 200 - # Rate (Hz) for the background poisson generators + # Rate (spks/s) for the background poisson generators poisson_rate = 15 def __init__(self, apply_noise=True, num_neurons=20): diff --git a/pynest/examples/sudoku/sudoku_net.py b/pynest/examples/sudoku/sudoku_net.py index b709010fae..06bb28f05e 100644 --- a/pynest/examples/sudoku/sudoku_net.py +++ b/pynest/examples/sudoku/sudoku_net.py @@ -232,6 +232,6 @@ def set_noise_rate(self, rate): Parameters ---------- rate : float - average spike frequency in Hz + average spike rate in spks/s """ self.noise.rate = rate diff --git a/pynest/examples/urbanczik_synapse_example.py b/pynest/examples/urbanczik_synapse_example.py index be5ec7f791..8c09e03e2b 100644 --- a/pynest/examples/urbanczik_synapse_example.py +++ b/pynest/examples/urbanczik_synapse_example.py @@ -217,7 +217,7 @@ def h(U, nrn_params): # poisson generators. The recorded spike times are then given to spike # generators. n_pg = 200 # number of poisson generators -p_rate = 10.0 # rate in Hz +p_rate = 10.0 # rate in spks/s pgs = nest.Create("poisson_generator", n=n_pg, params={"rate": p_rate}) diff --git a/pynest/nest/lib/hl_api_connection_helpers.py b/pynest/nest/lib/hl_api_connection_helpers.py index 3f1e68851f..e9fe89b7be 100644 --- a/pynest/nest/lib/hl_api_connection_helpers.py +++ b/pynest/nest/lib/hl_api_connection_helpers.py @@ -291,8 +291,8 @@ def _process_input_nodes(pre, post, conn_spec): # check for 'one_to_one' conn_spec one_to_one_cspec = ( - conn_spec if not isinstance(conn_spec, dict) else conn_spec.get("rule", "all_to_all") == "one_to_one" - ) + conn_spec if not isinstance(conn_spec, dict) else conn_spec.get("rule", "all_to_all") + ) == "one_to_one" # check and convert input types pre_is_nc, post_is_nc = True, True diff --git a/pynest/nest/raster_plot.py b/pynest/nest/raster_plot.py index fa6450762c..410125c51f 100644 --- a/pynest/nest/raster_plot.py +++ b/pynest/nest/raster_plot.py @@ -268,7 +268,7 @@ def _make_plot(ts, ts1, node_ids, neurons, hist=True, hist_binwidth=5.0, graysca plt.bar(t_bins, heights, width=hist_binwidth, color=color_bar, edgecolor=color_edge) plt.yticks([int(x) for x in numpy.linspace(0.0, int(max(heights) * 1.1) + 5, 4)]) - plt.ylabel("Rate (Hz)") + plt.ylabel("Rate (spks/s)") plt.xlabel(xlabel) plt.xlim(xlim) plt.axes(ax1) diff --git a/requirements.txt b/requirements.txt index 049c562de0..e6b3dca464 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,15 +5,15 @@ # If you just want to execute NEST, you should install NEST # directly as described in https://www.nest-simulator.org/installation. # -# Note that this file only specifies the required Python packages and +# Note that this file only specifies the required Python packages and # not the entire software stack needed to build and work with NEST Simulator. -# To create a conda environment with the entire software stack for NEST +# To create a mamba environment with the entire software stack for NEST # Simulator, use the the environment yaml file. # # The requirements from this file can be installed by # # pip install -r requirements.txt - + # To build and work with PyNEST -r requirements_pynest.txt diff --git a/requirements_docs.txt b/requirements_docs.txt index 08fae95760..a9aefa787f 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -6,9 +6,9 @@ # NEST, you should install NEST directly as described in # https://www.nest-simulator.org/installation. # -# The listed requirements are used to build the conda environment defined +# The listed requirements are used to build the mamba environment defined # in the environment yaml file. If you want to build an environment -# yourself, e.g., independent of conda, the requirements from this file +# yourself, e.g., independent of mamba, the requirements from this file # can be installed by # # pip install -r requirements_docs.txt diff --git a/requirements_nest_server.txt b/requirements_nest_server.txt index 6ad40632db..f6824f26cf 100644 --- a/requirements_nest_server.txt +++ b/requirements_nest_server.txt @@ -1,15 +1,16 @@ # Required Python packages to run NEST Server. # -# This file specifies the required Python packages to run NEST Server. It is -# meant for those who would like to compile NEST or build NEST documentation -# themselves. If you just want to execute NEST, you should install NEST -# directly as described in https://www.nest-simulator.org/installation. +# This file specifies the required Python packages to run NEST Server. +# It is meant for those who would like to compile NEST or build NEST +# documentation themselves. If you just want to execute NEST, you should +# install NEST directly as described in +# https://www.nest-simulator.org/installation. # -# The listed requirements are used to build the conda environment defined in -# the environment yaml file. If you want to run nest-server with mpi, please +# The listed requirements are used to build the mamba environment defined +# in the environment yaml file. If you want to run nest-server with mpi, please # uncomment to install required packages. If you want to build an environment -# yourself, e.g., independent of conda, the requirements from this file can be -# installed by +# yourself, e.g., independent of mamba, the requirements from this file +# can be installed by # # pip install -r requirements_nest_server.txt diff --git a/requirements_pynest.txt b/requirements_pynest.txt index f7e5c64a6a..fc2a19555f 100644 --- a/requirements_pynest.txt +++ b/requirements_pynest.txt @@ -6,9 +6,9 @@ # NEST, you should install NEST directly as described in # https://www.nest-simulator.org/installation. # -# The listed requirements are used to build the conda environment defined +# The listed requirements are used to build the mamba environment defined # in the environment yaml file. If you want to build an environment -# yourself, e.g., independent of conda, the requirements from this file +# yourself, e.g., independent of mamba, the requirements from this file # can be installed by # # pip install -r requirements_pynest.txt diff --git a/requirements_testing.txt b/requirements_testing.txt index a377b7bf54..c4d4b95fa0 100644 --- a/requirements_testing.txt +++ b/requirements_testing.txt @@ -6,9 +6,9 @@ # NEST, you should install NEST directly as described in # https://www.nest-simulator.org/installation. # -# The listed requirements are used to build the conda environment defined +# The listed requirements are used to build the mamba environment defined # in the environment yaml file. If you want to build an environment -# yourself, e.g., independent of conda, the requirements from this file +# yourself, e.g., independent of mamba, the requirements from this file # can be installed by # # pip install -r requirements_testing.txt diff --git a/testsuite/pytests/test_erfc_neuron.py b/testsuite/pytests/test_erfc_neuron.py index a6ec3f10e8..4c1f2ac559 100644 --- a/testsuite/pytests/test_erfc_neuron.py +++ b/testsuite/pytests/test_erfc_neuron.py @@ -71,7 +71,6 @@ def activation_function_theory(sigma, theta): class ErfcNeuronTheoryTestCase(unittest.TestCase): - """Compare results to theoretical predictions""" def setUp(self): diff --git a/testsuite/pytests/test_jonke_synapse.py b/testsuite/pytests/test_jonke_synapse.py index 2b96fc7871..2fc3fd324d 100644 --- a/testsuite/pytests/test_jonke_synapse.py +++ b/testsuite/pytests/test_jonke_synapse.py @@ -38,8 +38,8 @@ class TestJonkeSynapse: """ resolution = 0.1 # [ms] - presynaptic_firing_rate = 20.0 # [Hz] - postsynaptic_firing_rate = 20.0 # [Hz] + presynaptic_firing_rate = 20.0 # [spks/s] + postsynaptic_firing_rate = 20.0 # [spks/s] simulation_duration = 1e4 # [ms] hardcoded_trains_length = 15.0 # [ms] synapse_parameters = { diff --git a/testsuite/pytests/test_poisson_generator_campbell_alpha.py b/testsuite/pytests/test_poisson_generator_campbell_alpha.py index 1c3e427b09..12aca85afa 100644 --- a/testsuite/pytests/test_poisson_generator_campbell_alpha.py +++ b/testsuite/pytests/test_poisson_generator_campbell_alpha.py @@ -46,7 +46,7 @@ def test_poisson_generator_alpha(): tolerance = 0.05 V_m_target = 20.0 J = 0.01 - # solve for rate, convert to Hz, drop C_m as it is 1. + # solve for rate, convert to spks/s, drop C_m as it is 1. rate = 1000.0 * V_m_target / (J * neuron_params["tau_m"] * np.exp(1) * neuron_params["tau_syn_ex"]) poisson = nest.Create("poisson_generator") diff --git a/testsuite/pytests/test_rate_copy_model.py b/testsuite/pytests/test_rate_copy_model.py index 39bcad06dc..e80af03d1d 100644 --- a/testsuite/pytests/test_rate_copy_model.py +++ b/testsuite/pytests/test_rate_copy_model.py @@ -27,7 +27,6 @@ @nest.ll_api.check_stack class RateCopyModelTestCase(unittest.TestCase): - """ Test whether a rate connection created by copy model behaves identical to the original version diff --git a/testsuite/pytests/test_rate_instantaneous_and_delayed.py b/testsuite/pytests/test_rate_instantaneous_and_delayed.py index 669765788b..f9d5abc423 100644 --- a/testsuite/pytests/test_rate_instantaneous_and_delayed.py +++ b/testsuite/pytests/test_rate_instantaneous_and_delayed.py @@ -27,7 +27,6 @@ @nest.ll_api.check_stack class RateInstantaneousAndDelayedTestCase(unittest.TestCase): - """ Test whether delayed rate connections have same properties as instantaneous connections but with the correct delay diff --git a/testsuite/pytests/test_rate_neuron.py b/testsuite/pytests/test_rate_neuron.py index 05f784e300..2d2fc7f077 100644 --- a/testsuite/pytests/test_rate_neuron.py +++ b/testsuite/pytests/test_rate_neuron.py @@ -33,7 +33,6 @@ @nest.ll_api.check_stack class RateNeuronTestCase(unittest.TestCase): - """Check rate_neuron""" def setUp(self): diff --git a/testsuite/pytests/test_rate_neuron_communication.py b/testsuite/pytests/test_rate_neuron_communication.py index 9ccda06064..ac76144e22 100644 --- a/testsuite/pytests/test_rate_neuron_communication.py +++ b/testsuite/pytests/test_rate_neuron_communication.py @@ -34,7 +34,6 @@ def H(x): @nest.ll_api.check_stack class RateNeuronCommunicationTestCase(unittest.TestCase): - """Check rate_neuron""" def setUp(self): diff --git a/testsuite/pytests/test_sp/test_growth_curves.py b/testsuite/pytests/test_sp/test_growth_curves.py index 7097fcee23..09f51dcb7a 100644 --- a/testsuite/pytests/test_sp/test_growth_curves.py +++ b/testsuite/pytests/test_sp/test_growth_curves.py @@ -217,7 +217,6 @@ def growth_curve(self, t): class SigmoidNumericSEI(SynapticElementIntegrator): - """ Compute the number of synaptic element corresponding to a sigmoid growth curve diff --git a/testsuite/pytests/test_stdp_nn_synapses.py b/testsuite/pytests/test_stdp_nn_synapses.py index ae25882ff5..7707b525d9 100644 --- a/testsuite/pytests/test_stdp_nn_synapses.py +++ b/testsuite/pytests/test_stdp_nn_synapses.py @@ -48,8 +48,8 @@ class TestSTDPNNSynapses: @pytest.fixture(autouse=True) def setUp(self): self.resolution = 0.1 # [ms] - self.presynaptic_firing_rate = 20.0 # [Hz] - self.postsynaptic_firing_rate = 20.0 # [Hz] + self.presynaptic_firing_rate = 20.0 # [spks/s] + self.postsynaptic_firing_rate = 20.0 # [spks/s] self.simulation_duration = 1e4 # [ms] self.synapse_parameters = { "receptor_type": 1, diff --git a/testsuite/pytests/test_step_rate_generator.py b/testsuite/pytests/test_step_rate_generator.py index 83d15f876f..ab317adbba 100644 --- a/testsuite/pytests/test_step_rate_generator.py +++ b/testsuite/pytests/test_step_rate_generator.py @@ -27,7 +27,6 @@ @nest.ll_api.check_stack class StepRateGeneratorTestCase(unittest.TestCase): - """ Test whether the step_rate_generator produces and communicates the desired rates diff --git a/testsuite/pytests/test_tsodyks2_synapse.py b/testsuite/pytests/test_tsodyks2_synapse.py index f5746c7041..fdc8803586 100644 --- a/testsuite/pytests/test_tsodyks2_synapse.py +++ b/testsuite/pytests/test_tsodyks2_synapse.py @@ -35,7 +35,7 @@ class Tsodyks2SynapseTest(unittest.TestCase): def setUp(self): self.resolution = 0.1 # [ms] - self.presynaptic_firing_rate = 20.0 # [Hz] + self.presynaptic_firing_rate = 20.0 # [spks/s] self.simulation_duration = 1e3 # [ms] self.hardcoded_trains_length = 15.0 # [ms] self.synapse_parameters = { diff --git a/testsuite/pytests/test_vogels_sprekeler_synapse.py b/testsuite/pytests/test_vogels_sprekeler_synapse.py index 59cb87e5c1..fa4e748667 100644 --- a/testsuite/pytests/test_vogels_sprekeler_synapse.py +++ b/testsuite/pytests/test_vogels_sprekeler_synapse.py @@ -29,7 +29,6 @@ @nest.ll_api.check_stack class VogelsSprekelerConnectionTestCase(unittest.TestCase): - """Check vogels_sprekeler_synapse model properties.""" def setUp(self):