# Release notes

## Brian 2.10.1

This release fixes a bug, where the names of clocks in `run_regularly` and `run_at` where not necessarily unique, leading to build failures in C++ standalone mode (# 1742).

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

## Brian 2.10.0

### New features

- `PopulationRateMonitor` and `SpikeMonitor` now have a unified interface where both can provide smoothed and binned firing rates with `smooth_rate` and `binned_rate` (# 1657). Thanks to Mrigesh Thakur for implementing this feature.

- Supplementing `Group.run_regularly` (which runs code at regular intervals), there is now a `Group.run_at` method to run code at specific time points. Under the hood, it uses a new `EventClock`, which can also be used directly, e.g. in a `StateMonitor` to record values at specific times (# 1602). Thanks to Samuele De Cristofaro for implementing this feature.

### Selected improvements and bug fixes

- The `run_args` feature could lead to a `ReferenceError` in some situations (# 1673). Thanks to Lucas Binder for making us aware of this issue.

- The support for the GNU Scientific Library (GSL) was broken in C++ standalone mode (# 1687), and another bug in our test suite meant that this problem stayed undetected. Thanks to Maurizio De Pitta for making us aware of this issue.

- Time measurements (for profiling and for the progress report) were adding significant overhead in C++ standalone mode, and measured processor instead of wall time (# 1718). Thanks to Mathias Cauwet for contributing to the understanding of this issue.

- The `.device.build(...clean=True)` functionality was broken on Windows (# 1721). Thanks to Daniel Müller-Komorowska for making us aware of the issue.

- The `store`/`restore` mechanism did not take into account synaptic delays (# 1726).

- In C++ standalone mode, the default argument for `make` on Linux/macOS is no longer `make -j`, but instead uses the number of CPUs. This avoids using all system resources for big simulations, trying to compile too many files in parallel (# 1727).

- Fewer spurious “unused object” warnings (# 1724).

- Restoring from disk now works regardless of whether the simulation used the Python or Cython version of the spike queue (# 1688). Thanks to Mrigesh Thakur for contributing this fix.

### Infrastructure and documentation improvements

- We’ve switched our code-formatting and liniting used for pre-commit hooks to ruff, which reduces the number of dependencies and makes the pre-commit checks faster (# 1712).

- To be in line with the major packages in the scientific Python ecosystem, we now also follow the SPEC-0 policy for minimum dependencies (# 1700).

- Various updates to out GitHub actions for testing and package building, making them more secure, robust and faster due to better use of caches.

- The Python fallback for the spike queue has been removed, the Cython version is now mandatory. The underlying C++ implementation is now used directly from within the Cython code (# 1649, # 1643). Thanks to Mrigesh Thakur for his work on this, as part of this year’s Google Summer of Code.

- Dynamic arrays are now always using a C++ implementation, instead of having separate implementations in runtime and standalone mode (# 1650). Thanks to Mrigesh Thakur for this contribution.

- Random number and SpikeQueue state are now written to disk at the end of a standalone simulation, preparing a feature to continue previous simulations (# 1720).

### Backwards-incompatible changes

Due to the removal of the Python fallback for the spike queue, and the use of a compiled dynamic array in runtime mode, Brian can no longer run directly from its source directory without installation. If you downloaded the source code (or cloned the git repository), you will therefore have to install the package before using it; having the `PYTHONPATH` point to the source directory is no longer sufficient. During development, you can use an editable install to avoid having to repeat the installation after each change. Note that this does not affect users that install Brian in the usual way (e.g. with `pip` or `conda`). This change only concerns developers working on the source code directly.

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Mrigesh Thakur (@Legend101Zz)

- Ayush (@ayush4874)

- Samuele De Cristofaro (@De-Cri)

- Dan Goodman (@thesamovar)

- @itu-itis21-nguyen21

- Mohamed Abidalrekab (@abidalrekab)

- Silviya (@silviyahasana)

- Guy Singer (@guy-singer)

- Liam Keegan (@lkeegan)

- @Peace-png

- Maurizio DE PITTA (@mdepitta)

- Sagar Shahari (@maverick4code)

- Simo Vanni (@sivanni)

- hillsberg (@hillsberg3008)

- Hong Zhu (@Jasmine969)

- @mahipalimkar

- @wcx12306

Other contributions outside of GitHub (ordered alphabetically, apologies to anyone we forgot…):

- Mathias Cauwet (@macauwet)

- Chaitanya Chintaluri

## Brian 2.9.0

### New features

- Simulations now stop “gracefully” if you interrupt them with Ctrl+C (or e.g. the interrupt button in a Jupyter notebook). This means that the simulation finishes the current time step and stops, making it possible to access the results for inspection (# 1621).

- The Linked variables mechanism is now more powerful and supports linked variables that use another variable for indexing, and linked variables in `Synapses` (# 1584).

### Selected improvements and bug fixes

- Improve C99 check on UNIX to avoid spurious errors when a non-standard compiler is used (e.g. via Anaconda) (# 1618).

- Raise an error when `run` is called with a negative duration (# 1608). Thanks to Palash Chitnavis for contributing this fix.

- Fix compatibility with recent setuptools versions (# 1590, # 1622)

- Raise an AttributeError instead of a KeyError, when accessing non-existing attributes of the preferences object (# 1629). This prevents an error on Google Collab when the Debugger is active. Thanks to forum user `@SaeedF36` for making us aware of this issue.

### Infrastructure and documentation improvements

- A new example Example: homeostatic_stdp_at_inhibitory_synapes, demonstrating a homoestatic modulation of STDP, based on a population firing rate. Thanks to Paul Brodersen for contributing this example (# 1581).

- A new example Example: network_operation_stop, demonstrating the use of `NetworkOperation` to stop a simulation when a certain condition is met. Thanks to Sagar Shahari for contributing this example (# 1604).

- GitHub Actions are now pinned by hash to avoid security issues (# 1607).

- A new GitHub Action to update `CITATION.cff` and `README.md` with the latest Zenodo and Software Heritage links, so that they are always up-to-date with the latest release (# 1574).

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Samuele De Cristofaro (@De-Cri)

- Dan Goodman (@thesamovar)

- Sagar Shahari (@maverick4code)

- @mahipalimkar

- Mrigesh Thakur (@Legend101Zz)

- Md Khurshid (@alikhere)

- Palash Chitnavis (@PalashChitnavis)

- Ben Evans (@bdevans)

- @clinssen

- shriyaise725 (@shriya7ise)

- Ankur Sinha (@sanjayankur31)

- Hong Zhu (@Jasmine969)

- 火焰青年 (@zhengrenjie)

## Brian 2.8.0.1-2.8.0.4

Several patch-level releases, correcting metadata files about authors and contributors, updating release scripts, and fixing issues in a test and in the continuous integration infrastructure. Wheel packages for linux-aarch64 are now built on GitHub’s recently added ARM runners, removing the need for emulation and greatly improving the built time. No other user-facing changes are included in this release.

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

## Brian 2.8.0

This release comes with an important performance improvement for random number generation in C++ standalone mode, various minor improvements and bugfixes, as well as a number of behind-the-scenes improvements for our release process and compatibility with Python 3.13.

### Selected improvements and bug fixes

- Faster simulation of random numbers (by replacing our outdated random number generator), now up to 5 times faster, speeding up all uses of random numbers including noise and Poisson groups/inputs. Note that the random number algorithm behind the scenes is still the same, so simulations will still use the same sequence of random numbers with a given seed, with the limitations given in Seeding and reproducibility (# 1559).

- `delete` has a new option to delete arrays stored on disk for the `run_args` feature – this can be useful for training paradigms, where the `run_args` are used to provide a large array of weights from a previous run.

- Fixes for compatiblity with recent versions of `setuptools` and `sympy`. Thanks to Étienne Mollier for noticing and fixing a related test failure (# 1553).

### Infrastructure and documentation improvements

- Full compatibility with Python 3.13, and corresponding binary wheels.

- A new mechanism to automatically update our `CITATION.cff` and README files with the latest links to the Zenodo and Software Heritage archives, so that they are always up-to-date with the latest release (# 1575).

- We now provide a `codemeta.json` file for Brian (see https://codemeta.github.io; # 1574).

- We know push docker images for the latest release to the GitHub Container Registry (see https://github.com/brian-team/brian2/pkgs/container/brian and https://github.com/brian-team/brian2/pkgs/container/brian-dev) in addition to Docker Hub (# 1551).

- New example: Example: Diehl_Cook_2015 – note that this example needs a long time to run, a faster version using C++ standalone mode is in preparation. Thanks to Björn A. Lindqvist for contributing this example (# 1548).

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- @neworderofjamie

- @NickChernov

- Kyle Johnsen (@kjohnsen)

- Liam Keegan (@lkeegan)

- Étienne Mollier (@emollier)

- Bernhard Vogginger (@bvogginger)

- Dan Goodman (@thesamovar)

- @Treetalker

- Björn Lindqvist (@bjourne)

- @wcx12306

## Brian 2.7.1

This minor bug-fix release contains a fix for a regression in the handling of the `on_event` argument of `Synapses` for custom events and non-default pathways, which was introduced in Brian 2.6.0.

### Selected improvements and bug fixes

- Fix a bug in interpreting the `on_event` argument of `Synapses` for custom events and non-default pathways (a regression introduced with Brian 2.6). Thanks to forum users `mreynes` and `mmiekus` for making us aware of this issue. (# 1541)

- Make parsing SWC files more robust, by not being as strict for a correct 3-point-soma format (which is often slightly inexact on https://neuromorpho.org). Thanks to forum user `cbx` for making us aware of this issue. (# 1544)

### Infrastructure and documentation improvements

- Move to `pytest-cov` for coverage measurements – this fixes issues with wrong coverage reports on https://coveralls.io/github/brian-team/brian2. (# 1545)

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- @mareba2030

- Björn Lindqvist (@bjourne)

Other contributions outside of GitHub (ordered alphabetically, apologies to anyone we forgot…):

- cbx

- mmiekus

- mreynes

## Brian 2.7.0

This release contains a number of bug fixes and improvements. Notably, it is fully compatible with the upcoming numpy 2.0 release and can be installed alongside either numpy versions 1.23–1.26, or numpy 2.0.

### Selected improvements and bug fixes

- Objects (e.g. `NeuronGroup` or `Synapses`) that are not used now raise warnings, avoiding errors for accidentally unused objects (# 1536). Thanks to Jannik Luboeinski for suggesting this feature.

- Fix the run_args feature for object names with upper case letters (# 1533). Thanks to DavidKing2020 for making us aware of this issue.

- Extremely short refractoriness periods were not converted into code correctly, truncating their value (# 1521). Thanks to YannaelB for reporting this issue.

- The numbers 0 and 1 were converted into `true`/`false` in C++ code, breaking tests expecting the numbers to appear (# 1520)

- The logging system was broken for 3rd-party packages that have names starting with `brian` (# 1519)

### Infrastructure and documentation improvements

- The reference documentation was not correctly built, missing a lot of the information present in the source code. Thanks to Harsh Khilawala for making us aware of this issue (# 1534)

- Binary wheels are built against numpy 2.0. These wheels are still backwards compatible with numpy >= 1.23 (# 1527)

- Faster tests on GitHub actions by caching the compiled Cython code (# 1528)

- The test suite was no longer testing the GSL integration (# 1523 and # 1526)

- Brian no longer includes the date in its documentation for reproducible builds (# 1518).

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Harsh Khilawala (@HarshKhilawala)

- Ben Evans (@bdevans)

- Jannik Luboeinski (@jlubo)

- @flomlo

- Sven Leach (@SvennoNito)

Other contributions outside of GitHub (ordered alphabetically, apologies to anyone we forgot…):

- DavidKing2020

- YannaelB

## Brian 2.6.0

This release introduces a major new feature for running standalone simulations repeatedly (or in parallel), without having to recompile the code. It also fixes a number of compatiblity issues with the upcoming numpy 2.0 release, and offers compiled wheels for Python 3.12. Finally, we now offer pre-built docker images containing a full installation of Brian and related tools for convenient testing and development.

### New features

- The new `run_args` argument makes it possible to run standalone simulations repeatedly (or in parallel) with different parameters without recompiling the code. See Multiple full simulation runs for details (# 1429).

- We now provide regularly updated Docker images with a full installation of Brian and related tools. You can find the latest release images on https://hub.docker.com/repository/docker/briansimulator/brian/general, and temporary images for development versions on https://hub.docker.com/repository/docker/briansimulator/brian-dev/general (# 1503).

### Selected improvements and bug fixes

- Various fixes for compatibility with recent Python versions and the future numpy 2.0 release (# 1482, # 1484, # 1488, # 1510).

- Do not assume that the test directory is writeable (# 1507`)

- Fix the power operator for integer values in Cython (# 1502). Thanks to Hong Zhu for reporting this issue.

- Fix floor division on C++ (# 1496). Thanks to Brian forum user `ansuz` for reporting this issue.

### Infrastructure and documentation improvements

- We now build wheels and test against for Python 3.12 (# 1481).

- We now build and test on Apple Silicon (M1) hardware (# 1501).

- Improved support for 3rd-party packages to use Brian’s logging system (# 1480).

- New examples: Example: Spreizer_et_al_2019, Example: Wang_2002 (# 1447, # 1489)

- Use dependabot to keep GitHub actions and the dev container up-to-date (# 1513).

### Contributions

GitHub code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Ben Evans (@bdevans)

- Jannik Luboeinski (@jlubo)

- Dan Goodman (@thesamovar)

- Arash Golmohammadi (@arashgmn)

- xyz (@DHRUVJ2003)

- Kyle Johnsen (@kjohnsen)

- McCoy R. Becker (@femtomc)

- Max Talanov (@max-talanov)

- @lysea-haggie

- Hong Zhu (@Jasmine969)

- Paul Brodersen (@paulbrodersen)

- @MichielMoe

- Ian Quah (@IanQS)

- Adam Willats (@awillats)

- @flomlo

Other contributions outside of GitHub (ordered alphabetically, apologies to anyone we forgot…):

- `ansuz <https://brian.discourse.group/u/ansuz/summary>`_`

- `@l-luo1 <https://github.com/l-luo1>_``

- Klaus Wimmer (`@wklausitor <https://github.com/wklausito>_`)

## Brian 2.5.4

Yet another minor release that fixes an issue with the documentation build. As a bonus, we now provide wheels built with the musl standard library, which allows installing Brian on distributions such as Alpine Linux.

### Selected bug fixes

- Re-introduce the tutorials and example plots that were omitted from the documentation by accident. Thanks to Felix Kern for making us aware of the issue.

### Infrastructure improvements

- Provide `musllinux` (see PEP 656) wheels for distributions such as Alpine Linux (# 1478).

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Felix Benjamin Kern (@kernfel)

## Brian 2.5.3

This new minor release only fixes two infrastructure issues that came up with the previous release.

### Selected bug fixes

- Re-introduce the reference documentation that was no longer created on https://brian2.readthedocs.org with the latest release (# 1474). Thanks to Michalis Pagkalos for making us aware of the issue.

### Infrastructure improvements

- Brian’s packaging infrastructure now switches to modern tools such as `pyproject.toml` for metadata declaration, `build` for source package creation, and `setuptools_scm` for versioning (# 1475).

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

## Brian 2.5.2

This new minor release fixes incompatibility issues with the latest numpy release, and a number of other issues. To make it easier to contribute to Brian, we have now adopted a consistent code style and updated our infrastructure so that the style gets enforced for all new code contributions (see Code style for details). Following NEP 29, this release supports Python 3.9 & numpy 1.21 and newer.

### New features

- We now provide Python wheels for the `linux-aarch64` architecture (# 1463), making it easier to install Brian on ARM-based systems running Linux (including recent Apple hardware).

### Selected improvements and bug fixes

- Fix compability with numpy 1.25 and avoid deprecation warnings (# 1473)

- Add missing `volume` attribute to `SpatialNeuron` (# 1430). Thanks to Sebastian Schmitt for contributing this fix.

- Fix an issue with pickling `Quantity` objects (# 1438). Thanks to Shailesh Appukuttan for making us aware of this issue.

- No longer use the deprecated `distutils` package (# 1442).

- Fix an issue with log files on Windows (# 1454). Thanks to discourse user `@NiKnight` for making us aware of the issue.

- Fix an issue that prevents building the documentation on recent Python versions (# 1450). Thanks to Étienne Mollier for contributing this fix.

- Fix an issue with the upcoming Cython version for GSL integration (# 1471).

- Fix a broken error message (# 1467). Thanks to `@pjsph` for contributing the fix.

- Fix an issue with user-provided header files (# 1436). Thanks to `@wxie2013` for reporting the issue.

- Fix an issue when using `SpatialNeuron` with `TimedArray` on Cython (# 1428). Thanks to Sebastian Schmitt for reporting the issue.

### Infrastructure and documentation improvements

- We now enforce a consistent code style for all new code contributions, and check/enforce the code style with tools such as `black`, `isort`, `flake8`, and `pyupgrade` (# 1435, # 1444, # 1446). See Code style for details. Thanks to Oleksii Leonov for contributing this feature.

- A number of new examples have been added: Example: Tetzlaff_2015, Example: Nicola_Clopath_2017 (contributed by Sebastian Schmitt) and Example: coupled_oscillators.

- The development container has been updated, and the repository now contains a file with all the places where dependency versions are listed (# 1451, # 1468).

### Backwards incompatible changes

- Using `SpatialNeuron` with the `numpy` code generation target now requires the `scipy` package to be installed (# 1460).

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Ben Evans (@bdevans)

- Oleksii Leonov (@oleksii-leonov)

- Sebastian Schmitt (@schmitts)

- Denis Alevi (@denisalevi)

- Shailesh Appukuttan (@appukuttan-shailesh)

- @TheSquake

- @tim-ufer

- Akalanka (@boneyag)

- @pjsph

- @Bitloader22

- @MunozatABI

- Étienne Mollier (@emollier)

- @KarimHabashy

- @hunjunlee

- Arash Golmohammadi (@arashgmn)

- Steathy Spikes (@steathy-spikes)

- Adam Willats (@awillats)

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…): * @NiKnight

## Brian 2.5.1

This new minor release contains a large number of bug fixes and improvements, in particular for the C++ standalone mode, as well as many new contributed examples. For users of Visual Studio Code, getting involved with Brian development is now easier than ever, thanks to a new “development container” that automatically provides an environment with all the necessary dependencies.

### New features

- Ben Evans added a Docker container for development with Visual Studio Code (# 1387).

- Synaptic indices of synapses created with manually provided indices can now be accessed in standalone mode even before the situation has been run. This makes certain complex situations (e.g. synapses modulating other synapses) easier to write and also makes more detailed error checking possible (# 1403).

- Additional “code slots”, as well as more detailed profiling information about compilation times are avaiable for C++ standalone mode (# 1390, # 1391). Thanks to Denis Alevi for contributing this feature.

- LaTeX output for quantity arrays (which is automatically used for the “rich representation” in jupyter notebooks), is now limited to reasonable size and no longer tries to display all values for large arrays. It now also observes most of numpy’s print options (# 1426)

### Selected improvements and bug fixes

- Internally, Brian objects now have more consistent names (used in the generated code), and variables declarations are generated in deterministic order. This should make repeated runs of models faster, since less code has to be recompiled (# 1384, # 1417).

- Running several simulations in parallel with Python’s `multiprocessing` meant that all processes accessed the same log file which led to redundant information and could lead to crashes when several processes tried to rotate the same file. Brian now switches off logging in subprocesses, but users can enable also enable individual logs for each process, see Logging and multiprocessing. The default log level for the file log has also been raised to `DEBUG` (# 1419).

- Some common plotting idioms (e.g. `plt.plot(spike_mon.t/ms, spike_mon.i, '.')`) were broken with the most recent matplotlib version and are now working again (# 1412)

- Very long runs (with more then 2e9 simulation time steps) failed to run in C++ standalone mode (# 1394). Thanks to Kai Chen for making us aware of the issue.

### Infrastructure and documentation improvements

- Sebastian Schmitt has contributed several new Examples, reproducing results from several papers (e.g. Example: Maass_Natschlaeger_Markram_2002 and Example: Naud_et_al_2008_adex_firing_patterns)

- Akif Erdem Sağtekin and Sebastian Schmitt contributed the example Example: Izhikevich_2003.

- A number of fixes to the documentation have been contributed by Sebastian Schmitt.

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Ben Evans (@bdevans)

- Sebastian Schmitt (@schmitts)

- Denis Alevi (@denisalevi)

- Akif Erdem Sağtekin (@aesagtekin)

- @MunozatABI

- Dan Goodman (@thesamovar)

- @ivapl

- @dokato

- Davide Schiavone (@davideschiavone)

- Kai Chen (@NeoNeuron)

- Yahya Ashrafi (@yahya-ashrafi)

- Ariel Martínez Silberstein (@ariel-m-s)

- Adam Willats (@awillats)

## Brian 2.5.0.3

Another patch-level release that fixes incorrectly built Python wheels (the binary package used to install packages with `pip`). The wheels where mistakenly built against the most recent version of `numpy` (1.22), which made them incompatible with earlier versions of `numpy`. This release also fixes a few minor mistakes in the string representation of monitors, contributed by Felix Benjamin Kern.

## Brian 2.5.0.2

A new patch-level release that fixes a missing `#include` in the synapse generation code for C++ standalone code. This does not matter for most compilers (in particular, it does not matter for the gcc, clang, and Visual Studio compilers that we use for testing on Linux, OS X, and Windows), but it can matter for projects like Brian2GeNN that build on top of Brian2 and use Nvidia’s `nvcc` compiler. The release also fixes a minor string-formatting error (# 1377), which led to quantities that were displayed without their units.

## Brian 2.5.0.1

A new build to provide binary wheels for Python 3.10.

## Brian 2.5

This new major release contains a large number of bug fixes and improvements, as well as important new features for synapse generation: the Creating synapses with the generator syntax can now create synapses “in both directions”, and also supports random samples of fixed size. In addition, several contributors have helped to improve the documentation, in particular by adding several new Examples. We have also updated our test infrastructure and removed workarounds and warnings related to older, now unsupported, versions of Python. Our policy for supported Python and numpy versions now follows the NEP 29 policy adopted by most packages in the scientific Python ecosystem. This and other policies related to compatibility have been documented in Compatibility and reproducibility. As always, we recommend all users of Brian 2 to upgrade.

### New features

- Creating synapses with the generator syntax has become more powerful: it is now possible to express pre-synaptic indices as a function of post-synaptic indices – previously, only the other direction was supported (# 1294).

- Synapse generation can now make use of fixed-size random sampling (# 1280). Together with the more powerful generator syntax, this finally makes it possible to have networks where each cell receives a fixed number of random inputs: `syn.connect(i='k for k in sample(N_pre, size=number_of_inputs)')`.

### Selected improvements and bug fixes

- Fair default build flags on several architectures (# 1277). Thanks to Étienne Mollier for contributing this feature.

- Better C++ compiler detection on UNIX systems, e.g. with Anaconda installations (# 1304). Thanks to Jan Marker for this contribution.

- Fixed LaTeX output for newer sympy versions (# 1299). Thanks to Sebastian Schmitt for reporting this issue. The problem and its fix is described in detail in this blog post.

- Fixed string representation for units (# 1291). Recreating a unit from its string representation gave wrong results in some corner cases.

- Fix an error during the determination of appropriate C++ compiler flags on Windows with Python 3.9 (# 1286), and fix the detection of a C99-compatible compiler on Windows (# 1257). Thanks to Kyle Johnsen for reporting the errors and providing both fixes.

- More robust usage of external constants in C++ standalone code, avoiding clashes when the user defines constants with common names like `x` (# 1279). Thanks to user `@wxie2013` for making us aware of this issue.

- Raise an error if summed variables refer to event-based variables (# 1274) and a general rework of the dependency checks (# 1328). Thanks to Rohith Varma Buddaraju for fixing this issue.

- Fix an error for deactivated spike-emitting objects (e.g. `NeuronGroup`, `PoissonGroup`). They continued to emit spikes despite `active=False` if they had spiked in the last time step of a previous run (# 1319). Thanks to forum user Shencong for making us aware of the issue.

- Avoid warnings about deprecated numpy aliases (# 1273).

- Avoid a warning about an “ignored attribute shape” in some interactive Python consoles (# 1372).

- Check units for summed variables (# 1361). Thanks to Jan-Hendrik Schleimer for reporting this issue.

- Do not raise an error if synapses use restore instead of Synapses.connect (# 1359). Thanks to forum user SIbanez for reporting this issue.

- Fix indexing for sections in SpatialNeuron (# 1358). Thanks to Sebastian Schmitt for reporting this issue

- Better error messages for missing threshold definition (# 1363).

- Raise a useful error for `namespace` entries that start with an underscore instead of failing during compilation if the name clashes with built-in functions (# 1362). Thanks to Denis Alevi for reporting this issue.

- Consistently use include/library directory preferences (# 1353). The preferences can now be used to override the list of include/library directories, replacing the inconsistent behavior where they were either prepended (C++ standalone mode) or appended (Cython runtime mode) to the default list. Thanks to Denis Alevi for opening the discussion on this issue.

- Remove a warning about the difference between Python 2 and Python 3 semantics related to division (# 1351).

- Do not generate spurious `-.o` files when checking compiler compatibility (# 1348). For more details, see this blog post.

- Make `reset_to_defaults` work again, which was inadvertently broken in the Python 2 → 3 transition (# 1342). Thanks to Denis Alevi for reporting and fixing this issue.

- The commands to run and compile the code in C++ standalone mode can now be changed via a preference (# 1338). This can be useful to run/compile on clusters where jobs have to submitted with special commands. Thanks to Denis Alevi for contributing this feature.

### Backward-incompatible changes

- The `default_preferences` file that was part of the Brian installation has been removed, since it could lead to problems when working with development versions of Brian, and was overwritten with each update (# 1354). Users can still use a system-wide or per-directory preference file (see Preferences).

- The preferences codegen.cpp.include_dirs, codegen.cpp.library_dirs, and codegen.cpp.runtime_library_dirs now all replace the respective default values. Previously they where prepended (C++ standalone mode) or appended (Cython runtime mode). Users relying on a combination of the default values and their manually set values need to include the default value (e.g. `os.path.join(sys.prefix, 'include')`) manually.

### Infrastructure and documentation improvements

- Tagging a release will now automatically upload the release to PyPI via a GitHub Action. Versions are automatically determined with versioneer (# 1267) and include more detailed information when using a development version of Brian. See Which version of Brian am I using? for more details.

- The test suite has been moved to GitHub Actions for all operating systems (# 1298). Thanks to Rohith Varma Buddaraju for working on this.

- New Example: Jansen_Rit_1995_single_column (# 1347), contributed by Ruben Tikidji-Hamburyan.

- New Example: spike_based_homeostasis (# 1331), contributed by Sebastian Schmitt.

- New Example: COBAHH_approximated (# 1309), contributed by Sebastian Schmitt.

- Several new examples covering several Brian usage pattern, e.g. a minimal C++ standalone script, or demonstrations of running multiple simulations in parallel with Cython or C++ standalone, contributed by A. Ziaeemehr.

- Corrected units in Example: Kremer_et_al_2011_barrel_cortex (# 1355). Thanks to Adam Willats for contributing this fix.

- Most of Brian’s code base should now use a consistent string formatting style (# 1364), documented in the Coding conventions.

- Test reports will now show the project directory path for C++ standalone projects (# 1336). Thanks to Denis Alevi for contributing this feature.

- Fix the documentation for C++ compiler references (# 1323, # 1321). Thanks to Denis Alevi for fixing these issues.

- Examples are now listed in a deterministic order in the documentation (# 1312), and their title is now correctly formatted in the restructured text source (# 1311). Thanks to Felix C. Stegermann for contributing these fixes.

- Document how to plot model functions (e.g. time constants) in complex neuron models (# 1308). Contributed by Sebastian Schmitt.

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Rohith Varma Buddaraju (@rohithvarma3000)

- Denis Alevi (@denisalevi)

- Dingkun.Liu (@DingkunLiu)

- Ruben Tikidji-Hamburyan (@rat-h)

- Sebastian Schmitt (@schmitts)

- @ramapati166

- Jan Marker (@jangmarker)

- Kyle Johnsen (@kjohnsen)

- Abolfazl Ziaeemehr (@Ziaeemehr)

- Felix Benjamin Kern (@kernfel)

- Yann Zerlaut (@yzerlaut)

- Adam (@Adam-Antios)

- @ShanqMa

- Ljubica Cimeša (@LjubicaCimesa)

- @adididi

- VigneswaranC (@Vigneswaran-Chandrasekaran)

- Nunna Lakshmi Saranya (@18sarru)

- Friedemann Zenke (@fzenke)

- @Alexis-Melot

- Adam Willats (@awillats)

- Felix C. Stegerman (@obfusk)

- Eugen Skrebenkov (@shcecter)

- Maurizio DE PITTA (@mdepitta)

- Simo (@sivanni)

- Peter Quitta (@peschn)

- Étienne Mollier (@emollier)

- chaddy (@chaddy1004)

- @DePasquale99

- @albertalbesa

- Christian Behrens (@chbehrens)

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…):

- forum user Shencong

- forum user SIbanez

## Brian 2.4.1

This is a bugfix release with a number of small fixes and updates to the continuous integration testing.

### Selected improvements and bug fixes

- The `check_units()` decorator can now express that some arguments need to have the same units. This mechanism is now used to check the units of the `clip` function (# 1234). Thanks to Felix Kern for notifying us of this issue.

- Using `SpatialNeuron` with Cython no longer raises an unnecessary warning when the `scipy` library is not installed (# 1230).

- Raise an error for references to `N_incoming` or `N_outgoing` in calls to `Synapses.connect`. This use is ill-defined and led to compilation errors in previous versions (# 1227). Thanks to Denis Alevi for making us aware of this issue.

### Infrastructure and documentation improvements

- Brian no longer officially supports installation on 32bit operating systems. Installation via `pip` will probably still work, but we are no longer testing this configuration (# 1232).

- Automatic continuous integration tests for Windows now use the Microsoft Azure Pipeline infrastructure instead of Appveyor. This should speed up tests by running different configurations in parallel (# 1233).

- Fix an issue in the test suite that did not handle `NotImplementedError` correctly anymore after the changes introduced with # 1196.

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Denis Alevi (@denisalevi)

- SK (@akatav)

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…):

- Felix B. Kern

## Brian 2.4

This new release contains a large number of small improvements and bug fixes. We recommend all users of Brian 2 to upgrade. The biggest code change of this new version is that Brian is now Python-3 only (thanks to Ben Evans for working on this).

### Selected improvements and bug fixes

- Removing objects from networks no longer fails (# 1151). Thanks to Wilhelm Braun for reporting the issue.

- Point currents marked as `constant over dt` are now correctly handled (# 1160). Thanks to Andrew Brughera for reporting the issue.

- Elapsed and estimated remaining time are now formatted as hours/minutes/etc. in standalone mode as well (# 1162). Thanks to Rahul Kumar Gupta, Syed Osama Hussain, Bhuwan Chandra, and Vigneswaran Chandrasekaran for working on this issue as part of the GSoC 2020 application process.

- To prevent log files filling up the disk (# 1188), their file size is now limited to 10MB (configurable via the logging.file_log_max_size preference). Thanks to Rike-Benjamin Schuppner for contributing this feature.

- Add more complete support for operations on `VariableView` attributes. Previously, operations like `group.v**2` failed and required the workaround `group.v[:]**2` (# 1195)

- Fix a number of compatibility issues with newer versions of numpy and sympy, and document our policy on Compatibility and reproducibility.

- File locking (used to avoid problems when running multiple simulations in parallel) is now based on Benedikt Schmitt’s py-filelock package, which should hopefully make it more robust.

- String expressions in `Synapses.connect` are now checked for syntactic correctness before handing them over to the code generation process, improving error messages. Thanks to Denis Alevi for making us aware of this issue. (# 1224)

- Avoid duplicate messages in “chained” exceptions. Also introduces a new preference logging.display_brian_error_message to switch off the “Brian 2 encountered an unexpected error” message (# 1196).

- Brian’s unit system now correctly deals with matrix multiplication, including the `@` operator (# 1216). Thanks to @kjohnsen for reporting this issue.

- Avoid turning all integer numbers in equations into floating point values (# 1202). Thanks to Marco K. for making us aware of this issue.

- New attributes `Synapses.N_outgoing_pre` and `Synapses.N_incoming_post` to access the number of synapses per pre-/post-synaptic cell (see Accessing synaptic variables for details; # 1225)

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Ben Evans (@bdevans)

- Dan Goodman (@thesamovar)

- Denis Alevi (@denisalevi)

- Rike-Benjamin Schuppner (@Debilski)

- Syed Osama Hussain (@Syed-Osama-Hussain)

- VigneswaranC (@Vigneswaran-Chandrasekaran)

- Tushar (@smalltimer)

- Felix Hoffmann (@felix11h)

- Rahul Kumar Gupta (@rahuliitg)

- Dominik Spicher (@dspicher)

- @nfzd

- @Snow-Crash

- @cnjackhu

- @neurologic

- @kjohnsen

- Ashwin Viswanathan Kannan (@ashwin4ever)

- Bhuwan Chandra (@zeph1yr)

- Wilhelm Braun (@wilhelmbraun)

- @cortical-iv

- Eugen Skrebenkov (@shcecter)

- @Aman-A

- Felix Benjamin Kern (@kernfel)

- Francesco Battaglia (@fpbattaglia)

- Shivam Chitnis (@shivChitinous)

- Marco K. (@spokli)

- @jcmharry

- Friedemann Zenke (@fzenke)

- @Adam-Antios

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…):

- Andrew Brughera

- William Xavier

## Brian 2.3

This release contains the usual mix of bug fixes and new features (see below), but also makes some important changes to the Brian 2 code base to pave the way for the full Python 2 -> 3 transition (the source code is now directly compatible with Python 2 and Python 3, without the need for any translation at install time). Please note that this release will be the last release that supports Python 2, given that Python 2 reaches end-of-life in January 2020. Brian now also uses pytest as its testing framework, since the previously used `nose` package is not maintained anymore. Since brian2hears has been released as an independent package, using `brian2.hears` as a “bridge” to Brian 1’s `brian.hears` package is now deprecated.

Finally, the Brian project has adopted the “Contributor Covenant” Contributor Covenant Code of Conduct, pledging “to make participation in our community a harassment-free experience for everyone”.

### New features

- The `restore()` function can now also restore the state of the random number generator, allowing for exact reproducibility of stochastic simulations (# 1134)

- The functions `expm1()`, `log1p()`, and `exprel()` can now be used (# 1133)

- The system for calling random number generating functions has been generalized (see Functions with context-dependent return values), and a new `poisson` function for Poisson-distrubted random numbers has been added (# 1111)

- New versions of Visual Studio are now supported for standalone mode on Windows (# 1135)

### Selected improvements and bug fixes

- `run_regularly` operations are now included in the network, even if they are created after the parent object was added to the network (# 1009). Contributed by Vigneswaran Chandrasekaran.

- No longer incorrectly classify some equations as having “multiplicative noise” (# 968). Contributed by Vigneswaran Chandrasekaran.

- Brian is now compatible with Python 3.8 (# 1130), and doctests are compatible with numpy 1.17 (# 1120)

- Progress reports for repeated runs have been fixed (# 1116), thanks to Ronaldo Nunes for reporting the issue.

- `SpikeGeneratorGroup` now correctly works with `restore()` (# 1084), thanks to Tom Achache for reporting the issue.

- An indexing problem in `PopulationRateMonitor` has been fixed (# 1119).

- Handling of equations referring to `-inf` has been fixed (# 1061).

- Long simulations recording more than ~2 billion data points no longer crash with a segmentation fault (# 1136), thanks to Rike-Benjamin Schuppner for reporting the issue.

### Backward-incompatible changes

- The fix for `run_regularly` operations (# 1009, see above) entails a change in how objects are stored within `Network` objects. Previously, `Network.objects` stored a complete list of all objects, including objects such as `StateUpdater` that – often invisible to the user – are a part of major objects such as `NeuronGroup`. Now, `Network.objects` only stores the objects directly provided by the user (`NeuronGroup`, `Synapses`, `StateMonitor`, …), the dependent objects (`StateUpdater`, `Thresholder`, …) are taken into account at the time of the run. This might break code in some corner cases, e.g. when removing a `StateUpdater` from `Network.objects` via `Network.remove`.

- The `brian2.hears` interface to Brian 1’s `brian.hears` package has been deprecated.

### Infrastructure and documentation improvements

- The same code base is used on Python 2 and Python 3 (# 1073).

- The test framework uses `pytest` (# 1127).

- We have adapoted a Code of Conduct (# 1113), thanks to Tapasweni Pathak for the suggestion.

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Vigneswaran Chandrasekaran (@Vigneswaran-Chandrasekaran)

- Moritz Orth (@morth)

- Tristan Stöber (@tristanstoeber)

- @ulyssek

- Wilhelm Braun (@wilhelmbraun)

- @flomlo

- Rike-Benjamin Schuppner (@Debilski)

- @sdeiss

- Ben Evans (@bdevans)

- Tapasweni Pathak (@tapaswenipathak)

- @jonathanoesterle

- Richard C Gerkin (@rgerkin)

- Christian Behrens (@chbehrens)

- Romain Brette (@romainbrette)

- XiaoquinNUDT (@XiaoquinNUDT)

- Dylan Muir (@DylanMuir)

- Aleksandra Teska (@alTeska)

- Felix Z. Hoffmann (@felix11h)

- @baixiaotian63648995

- Carlos de la Torre (@c-torre)

- Sam Mathias (@sammosummo)

- @Marghepano

- Simon Brodeur (@sbrodeur)

- Alex Dimitrov (@adimitr)

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…):

- Ronaldo Nunes

- Tom Achache

## Brian 2.2.2.1

This is a bug-fix release that fixes several bugs and adds a few minor new features. We recommend all users of Brian 2 to upgrade.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

[Note that the original upload of this release was version 2.2.2, but due to a mistake in the released archive, it has been uploaded again as version 2.2.2.1]

### Selected improvements and bug fixes

- Fix an issue with the synapses generator syntax (# 1037).

- Fix an incorrect error when using a `SpikeGeneratorGroup` with a long period (# 1041). Thanks to Kévin Cuallado-Keltsch for reporting this issue.

- Improve the performance of `SpikeGeneratorGroup` by avoiding a conversion from time to integer time step (# 1043). This time step is now also available to user code as `t_in_timesteps`.

- Function definitions for weave/Cython/C++ standalone can now declare additional header files and libraries. They also support a new `sources` argument to use a function definition from an external file. See the Functions documentation for details.

- For convenience, single-neuron subgroups can now be created with a single index instead of with a slice (e.g. `neurongroup[3]` instead of `neurongroup[3:4]`).

- Fix an issue when `-inf` is used in an equation (# 1061).

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Felix Z. Hoffmann (@Felix11H)

- @wjx0914

- Kévin Cuallado-Keltsch (@kevincuallado)

- Romain Cazé (@rcaze)

- Daphne (@daphn3cor)

- Erik (@parenthetical-e)

- @RahulMaram

- Eghbal Hosseini (@eghbalhosseini)

- Martino Sorbaro (@martinosorb)

- Mihir Vaidya (@MihirVaidya94)

- @hellolingling

- Volodimir Slobodyanyuk (@vslobody)

- Peter Duggins (@psipeter)

## Brian 2.2.1

This is a bug-fix release that fixes a few minor bugs and incompatibilites with recent versions of the dependencies. We recommend all users of Brian 2 to upgrade.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Selected improvements and bug fixes

- Work around problems with the latest version of `py-cpuinfo` on Windows (# 990, # 1020) and no longer require it for Linux and OS X.

- Avoid warnings with newer versions of Cython (# 1030) and correctly build the Cython spike queue for Python 3.7 (# 1026), thanks to Fleur Zeldenrust and Ankur Sinha for reporting these issues.

- Fix error messages for `SyntaxError` exceptions in jupyter notebooks (# #964).

### Dependency and packaging changes

- Conda packages in conda-forge are now avaible for Python 3.7 (but no longer for Python 3.5).

- Linux and OS X no longer depend on the `py-cpuinfo` package.

- Source packages on pypi now require a recent Cython version for installation.

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Christopher (@Chris-Currin)

- Peter Duggins (@psipeter)

- Paola Suárez (@psrmx)

- Ankur Sinha (@sanjayankur31)

- @JingjinW

- Denis Alevi (@denisalevi)

- @lemonade117

- @wjx0914

- Sven Leach (@SvennoNito)

- svadams (@svadams)

- @ghaessig

- Varshith Sreeramdass (@varshiths)

## Brian 2.2

This releases fixes a number of important bugs and comes with a number of performance improvements. It also makes sure that simulation no longer give platform-dependent results for certain corner cases that involve the division of integers. These changes can break backwards-compatiblity in certain cases, see below. We recommend all users of Brian 2 to upgrade.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Selected improvements and bug fixes

- Divisions involving integers now use floating point division, independent of Python version and code generation target. The `//` operator can now used in equations and expressions to denote flooring division (# 984).

- Simulations can now use single precision instead of double precision floats in simulations (# 981, # 1004). This is mostly intended for use with GPU code generation targets.

- The `timestep`, introduced in version 2.1.3, was further optimized for performance, making the refractoriness calculation faster (# 996).

- The `lastupdate` variable is only automatically added to synaptic models when event-driven equations are used, reducing the memory and performance footprint of simple synaptic models (# 1003). Thanks to Denis Alevi for bringing this up.

- A `from brian2 import *` imported names unrelated to Brian, and overwrote some Python builtins such as `dir` (# 969). Now, fewer names are imported (but note that this still includes numpy and plotting tools: Importing Brian).

- The `exponential_euler` state updater is no longer failing for systems of equations with differential equations that have trivial, constant right-hand-sides (# 1010). Thanks to Peter Duggins for making us aware of this issue.

### Backward-incompatible changes

- Code that divided integers (e.g. `N/10`) with a C-based code generation target, or with the `numpy` target on Python 2, will now use floating point division instead of flooring division (i.e., Python 3 semantics). A warning will notify the user of this change, use either the flooring division operator (`N//10`), or the `int` function (`int(N/10)`) to make the expression unambiguous.

- Code that directly referred to the `lastupdate` variable in synaptic statements, without using any event-driven variables, now has to manually add `lastupdate : second` to the equations and update the variable at the end of `on_pre` and/or `on_post` with `lastupdate = t`.

- Code that relied on `from brian2 import *` also importing unrelated names such as `sympy`, now has to import such names explicitly.

### Documentation improvements

- Various small fixes and additions (e.g. installation instructions, available functions, fixes in examples)

- A new example, Izhikevich 2007, provided by Guillaume Dumas.

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Denis Alevi (@denisalevi)

- Thomas Nowotny (@tnowotny)

- @neworderofjamie

- Paul Brodersen (@paulbrodersen)

- @matrec4

- svadams (@svadams)

- XiaoquinNUDT (@XiaoquinNUDT)

- Peter Duggins (@psipeter)

- @nh17937

- Patrick Nave (@pnave95)

- @AI-pha

- Guillaume Dumas (@deep-introspection)

- @godelicbach

- @galharth

## Brian 2.1.3.1

This is a bug-fix release that fixes two bugs in the recent 2.1.3 release:

- Fix an inefficiency in the newly introduced `timestep` function when using the `numpy` target (# 965)

- Fix inefficiencies in the unit system that could lead to slow operations and high memory use (# 967). Thanks to Kaustab Pal for making us aware of the issue.

## Brian 2.1.3

This is a bug-fix release that fixes a number of important bugs (see below), but does not introduce any new features. We recommend all users of Brian 2 to upgrade.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Selected improvements and bug fixes

- The Cython cache on disk now uses significantly less space by deleting unnecessary source files (set the codegen.runtime.cython.delete_source_files preference to `False` if you want to keep these files for debugging). In addition, a warning will be given when the Cython or weave cache exceeds a configurable size (codegen.max_cache_dir_size). The `clear_cache` function is provided to delete files from the cache (# 914).

- The C++ standalone mode now respects the `profile` option and therefore no longer collects profiling information by default. This can speed up simulations in certain cases (# 935).

- The exact number of time steps that a neuron stays in the state of refractoriness after a spike could vary by up to one time step when the requested refractory time was a multiple of the simulation time step. With this fix, the number of time steps is ensured to be as expected by making use of a new `timestep` function that avoids floating point rounding issues (# 949, first reported by @zhouyanasd in issue # 943).

- When `restore()` was called twice for a network, spikes that were not yet delivered to their target were not restored correctly (# 938, reported by @zhouyanasd).

- `SpikeGeneratorGroup` now uses a more efficient method for sorting spike indices and times, leading to a much faster preparation time for groups that store many spikes (# 948).

- Fix a memory leak in `TimedArray` (# 923, reported by Wilhelm Braun).

- Fix an issue with summed variables targetting subgroups (# 925, reported by @AI-pha).

- Fix the use of `run_regularly` on subgroups (# 922, reported by @AI-pha).

- Improve performance for `SpatialNeuron` by removing redundant computations (# 910, thanks to Moritz Augustin for making us aware of the issue).

- Fix linked variables that link to scalar variables (# 916)

- Fix warnings for numpy 1.14 and avoid compilation issues when switching between versions of numpy (# 913)

- Fix problems when using logical operators in code generated for the numpy target which could lead to issues such as wrongly connected synapses (# 901, # 900).

### Backward-incompatible changes

- No longer allow `delay` as a variable name in a synaptic model to avoid ambiguity with respect to the synaptic delay. Also no longer allow access to the `delay` variable in synaptic code since there is no way to distinguish between pre- and post-synaptic delay (# 927, reported by Denis Alevi).

- Due to the changed handling of refractoriness (see bug fixes above), simulations that make use of refractoriness will possibly no longer give exactly the same results. The preference legacy.refractory_timing can be set to `True` to reinstate the previous behaviour.

### Infrastructure and documentation improvements

- From this version on, conda packages will be available on conda-forge. For a limited time, we will copy over packages to the `brian-team` channel as well.

- Conda packages are no longer tied to a specific numpy version (PR # 954)

- New example (Brunel & Wang, 2001) contributed by Teo Stocco and Alex Seeholzer.

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Teo Stocco (@zifeo)

- Dylan Muir (@DylanMuir)

- scarecrow (@zhouyanasd)

- @fuadfukhasyi

- Aditya Addepalli (@Dyex719)

- Kapil kumar (@kapilkd13)

- svadams (@svadams)

- Vafa Andalibi (@Vafa-Andalibi)

- Sven Leach (@SvennoNito)

- @matrec4

- @jarishna

- @AI-pha

- @xdzhangxuejun

- Denis Alevi (@denisalevi)

- Paul Pfeiffer (@pfeffer90)

- Romain Brette (@romainbrette)

- @hustyanghui

- Adrien F. Vincent (@afvincent)

- @ckemere

- @evearmstrong

- Paweł Kopeć (@pawelkopec)

- Moritz Augustin (@moritzaugustin)

- Bart (@louwers)

- @amarsdd

- @ttxtea

- Maria Cervera (@MariaCervera)

- ouyangxinrong (@longzhixin)

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…):

- Wilhelm Braun

## Brian 2.1.2

This is another bug fix release that fixes a major bug in `Equations`’ substitution mechanism (# 896). Thanks to Teo Stocco for reporting this issue.

## Brian 2.1.1

This is a bug fix release that re-activates parts of the caching mechanism for code generation that had been erroneously deactivated in the previous release.

## Brian 2.1

This release introduces two main new features: a new “GSL integration” mode for differential equation that offers to integrate equations with variable-timestep methods provided by the GNU Scientific Library, and caching for the run preparation phase that can significantly speed up simulations. It also comes with a newly written tutorial, as well as additional documentation and examples.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### New features

- New numerical integration methods with variable time-step integration, based on the GNU Scientific Library (see Numerical integration). Contributed by Charlee Fletterman, supported by 2017’s Google Summer of Code program.

- New caching mechanism for the code generation stage (application of numerical integration algorithms, analysis of equations and statements, etc.), reducing the preparation time before the actual run, in particular for simulations with multiple `run()` statements.

### Selected improvements and bug fixes

- Fix a rare problem in Cython code generation caused by missing type information (# 893)

- Fix warnings about improperly closed files on Python 3.6 (# 892; reported and fixed by Teo Stocco)

- Fix an error when using numpy integer types for synaptic indexing (# 888)

- Fix an error in numpy codegen target, triggered when assigning to a variable with an unfulfilled condition (# 887)

- Fix an error when repeatedly referring to subexpressions in multiline statements (# 880)

- Shorten long arrays in warning messages (# 874)

- Enable the use of `if` in the shorthand generator syntax for `Synapses.connect` (# 873)

- Fix the meaning of `i` and `j` in synapses connecting to/from other synapses (# 854)

### Backward-incompatible changes and deprecations

- In C++ standalone mode, information about the number of synapses and spikes will now only be displayed when built with `debug=True` (# 882).

- The `linear` state updater has been renamed to `exact` to avoid confusion (# 877). Users are encouraged to use `exact`, but the name `linear` is still available and does not raise any warning or error for now.

- The `independent` state updater has been marked as deprecated and might be removed in future versions.

### Infrastructure and documentation improvements

- A new, more advanced, tutorial “about managing the slightly more complicated tasks that crop up in research problems, rather than the toy examples we’ve been looking at so far.”

- Additional documentation on Custom events and Converting from integrated form to ODEs (including example code for typical synapse models).

- New example code reproducing published findings (Platkiewicz and Brette, 2011; Stimberg et al., 2018)

- Fixes to the sphinx documentation creation process, the documentation can be downloaded as a PDF once again (705 pages!)

- Conda packages now have support for numpy 1.13 (but support for numpy 1.10 and 1.11 has been removed)

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Charlee Fletterman (@CharleeSF)

- Dan Goodman (@thesamovar)

- Teo Stocco (@zifeo)

- @k47h4

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…):

- Chaofei Hong

- Lucas (“lucascdst”)

## Brian 2.0.2.1

Fixes a bug in the tutorials’ HMTL rendering on readthedocs.org (code blocks were not displayed). Thanks to Flora Bouchacourt for making us aware of this problem.

## Brian 2.0.2

### New features

- `molar` and `liter` (as well as `litre`, scaled versions of the former, and a few useful abbreviations such as `mM`) have been added as new units (# 574).

- A new module `brian2.units.constants` provides physical constants such as the Faraday constants or the gas constant (see Constants for details).

- `SpatialNeuron` now supports non-linear membrane currents (e.g. Goldman–Hodgkin–Katz equations) by linearizing them with respect to v.

- Multi-compartmental models can access the capacitive current via `Ic` in their equations (# 677)

- A new function `scheduling_summary()` that displays information about the scheduling of all objects (see Scheduling for details).

- Introduce a new preference to pass arguments to the `make`/`nmake` command in C++ standalone mode (devices.cpp_standalone.extra_make_args_unix for Linux/OS X and devices.cpp_standalone.extra_make_args_windows for Windows). For Linux/OS X, this enables parallel compilation by default.

- Anaconda packages for Brian 2 are now available for Python 3.6 (but Python 3.4 support has been removed).

### Selected improvements and bug fixes

- Work around low performance for certain C++ standalone simulations on Linux, due to a bug in glibc (see # 803). Thanks to Oleg Strikov (@xj8z) for debugging this issue and providing the workaround that is now in use.

- Make exact integration of `event-driven` synaptic variables use the `linear` numerical integration algorithm (instead of `independent`), fixing rare occasions where integration failed despite the equations being linear (# 801).

- Better error messages for incorrect unit definitions in equations.

- Various fixes for the internal representation of physical units and the unit registration system.

- Fix a bug in the assignment of state variables in subtrees of `SpatialNeuron` (# 822)

- Numpy target: fix an indexing error for a `SpikeMonitor` that records from a subgroup (# 824)

- Summed variables targeting the same post-synaptic variable now raise an error (previously, only the one executed last was taken into account, see # 766).

- Fix bugs in synapse generation affecting Cython (# 781) respectively numpy (# 835)

- C++ standalone simulations with many objects no longer fail on Windows (# 787)

### Backwards-incompatible changes

- `celsius` has been removed as a unit, because it was ambiguous in its relation to `kelvin` and gave wrong results when used as an absolute temperature (and not a temperature difference). For temperature differences, you can directly replace `celsius` by `kelvin`. To convert an absolute temperature in degree Celsius to Kelvin, add the `zero_celsius` constant from `brian2.units.constants` (# 817).

- State variables are no longer allowed to have names ending in `_pre` or `_post` to avoid confusion with references to pre- and post-synaptic variables in `Synapses` (# 818)

### Changes to default settings

- In C++ standalone mode, the `clean` argument now defaults to `False`, meaning that `make clean` will not be executed by default before building the simulation. This avoids recompiling all files for unchanged simulations that are executed repeatedly. To return to the previous behaviour, specify `clean=True` in the `device.build` call (or in `set_device` if your script does not have an explicit `device.build`).

### Contributions

Github code, documentation, and issue contributions (ordered by the number of contributions):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Thomas McColgan (@phreeza)

- Daan Sprenkels (@dsprenkels)

- Romain Brette (@romainbrette)

- Oleg Strikov (@xj8z)

- Charlee Fletterman (@CharleeSF)

- Meng Dong (@whenov)

- Denis Alevi (@denisalevi)

- Mihir Vaidya (@MihirVaidya94)

- Adam (@ffa)

- Sourav Singh (@souravsingh)

- Nick Hale (@nik849)

- Cody Greer (@Cody-G)

- Jean-Sébastien Dessureault (@jsdessureault)

- Michele Giugliano (@mgiugliano)

- Teo Stocco (@zifeo)

- Edward Betts (@EdwardBetts)

Other contributions outside of github (ordered alphabetically, apologies to anyone we forgot…):

- Christopher Nolan

- Regimantas Jurkus

- Shailesh Appukuttan

## Brian 2.0.1

This is a bug-fix release that fixes a number of important bugs (see below), but does not introduce any new features. We recommend all users of Brian 2 to upgrade.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Improvements and bug fixes

- Fix `PopulationRateMonitor` for recordings from subgroups (# 772)

- Fix `SpikeMonitor` for recordings from subgroups (# 777)

- Check that string expressions provided as the `rates` argument for `PoissonGroup` have correct units.

- Fix compilation errors when multiple run statements with different `report` arguments are used in C++ standalone mode.

- Several documentation updates and fixes

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Alex Seeholzer (@flinz)

- Meng Dong (@whenov)

Testing, suggestions and bug reports (ordered alphabetically, apologies to anyone we forgot…):

- Myung Seok Shim

- Pamela Hathway

## Brian 2.0 (changes since 1.4)

### Major new features

- Much more flexible model definitions. The behaviour of all model elements can now be defined by arbitrary equations specified in standard mathematical notation.

- Code generation as standard. Behind the scenes, Brian automatically generates and compiles C++ code to simulate your model, making it much faster.

- “Standalone mode”. In this mode, Brian generates a complete C++ project tree that implements your model. This can be then be compiled and run entirely independently of Brian. This leads to both highly efficient code, as well as making it much easier to run simulations on non-standard computational hardware, for example on robotics platforms.

- Multicompartmental modelling.

- Python 2 and 3 support.

### New features

- Installation should now be much easier, especially if using the Anaconda Python distribution. See Installation.

- Many improvements to `Synapses` which replaces the old `Connection` object in Brian 1. This includes: synapses that are triggered by non-spike events; synapses that target other synapses; huge speed improvements thanks to using code generation; new “generator syntax” when creating synapses is much more flexible and efficient. See Synapses.

- New model definitions allow for much more flexible refractoriness. See Refractoriness.

- `SpikeMonitor` and `StateMonitor` are now much more flexible, and cover a lot of what used to be covered by things like `MultiStateMonitor`, etc. See Recording during a simulation.

- Multiple event types. In addition to the default `spike` event, you can create arbitrary events, and have these trigger code blocks (like reset) or synaptic events. See Custom events.

- New units system allows arrays to have units. This eliminates the need for a lot of the special casing that was required in Brian 1. See Physical units.

- Indexing variable by condition, e.g. you might write `G.v['x>0']` to return all values of variable `v` in `NeuronGroup` `G` where the group’s variable `x>0`. See State variables.

- Correct numerical integration of stochastic differential equations. See Numerical integration.

- “Magic” `run()` system has been greatly simplified and is now much more transparent. In addition, if there is any ambiguity about what the user wants to run, an erorr will be raised rather than making a guess. This makes it much safer. In addition, there is now a `store()`/`restore()` mechanism that simplifies restarting simulations and managing separate training/testing runs. See Running a simulation.

- Changing an external variable between runs now works as expected, i.e. something like `tau=1*ms; run(100*ms); tau=5*ms; run(100*ms)`. In Brian 1 this would have used `tau=1*ms` for both runs. More generally, in Brian 2 there is now better control over namespaces. See Namespaces.

- New “shared” variables with a single value shared between all neurons. See Shared variables.

- New `Group.run_regularly` method for a codegen-compatible way of doing things that used to be done with `network_operation()` (which can still be used). See Regular operations.

- New system for handling externally defined functions. They have to specify which units they accept in their arguments, and what they return. In addition, you can easily specify the implementation of user-defined functions in different languages for code generation. See Functions.

- State variables can now be defined as integer or boolean values. See Equations.

- State variables can now be exported directly to Pandas data frame. See Storing state variables.

- New generalised “flags” system for giving additional information when defining models. See Flags.

- `TimedArray` now allows for 2D arrays with arbitrary indexing. See Timed arrays.

- Better support for using Brian in IPython/Jupyter. See, for example, `start_scope()`.

- New preferences system. See Preferences.

- Random number generation can now be made reliably reproducible. See Random numbers.

- New profiling option to see which parts of your simulation are taking the longest to run. See Profiling.

- New logging system allows for more precise control. See Logging.

- New ways of importing Brian for advanced Python users. See Importing Brian.

- Improved control over the order in which objects are updated during a run. See Custom progress reporting.

- Users can now easily define their own numerical integration methods. See State update.

- Support for parallel processing using the OpenMP version of standalone mode. Note that all Brian tests pass with this, but it is still considered to be experimental. See Multi-threading with OpenMP.

### Backwards incompatible changes

See Detailed Brian 1 to Brian 2 conversion notes.

### Behind the scenes changes

- All user models are now passed through the code generation system. This allows us to be much more flexible about introducing new target languages for generated code to make use of non-standard computational hardware. See Code generation.

- New standalone/device mode allows generation of a complete project tree that can be compiled and built independently of Brian and Python. This allows for even more flexible use of Brian on non-standard hardware. See Devices.

- All objects now have a unique name, used in code generation. This can also be used to access the object through the `Network` object.

### Contributions

Full list of all Brian 2 contributors, ordered by the time of their first contribution:

- Dan Goodman (@thesamovar)

- Marcel Stimberg (@mstimberg)

- Romain Brette (@romainbrette)

- Cyrille Rossant (@rossant)

- Victor Benichoux (@victorbenichoux)

- Pierre Yger (@yger)

- Werner Beroux (@wernight)

- Konrad Wartke (@Kwartke)

- Daniel Bliss (@dabliss)

- Jan-Hendrik Schleimer (@ttxtea)

- Moritz Augustin (@moritzaugustin)

- Romain Cazé (@rcaze)

- Dominik Krzemiński (@dokato)

- Martino Sorbaro (@martinosorb)

- Benjamin Evans (@bdevans)

## Brian 2.0 (changes since 2.0rc3)

### New features

- A new flag `constant over dt` can be applied to subexpressions to have them only evaluated once per timestep (see Models and neuron groups). This flag is mandatory for stateful subexpressions, e.g. expressions using `rand()` or `randn()`. (# 720, # 721)

### Improvements and bug fixes

- Fix `EventMonitor.values` and `SpikeMonitor.spike_trains` to always return sorted spike/event times (# 725).

- Respect the `active` attribute in C++ standalone mode (# 718).

- More consistent check of compatible time and dt values (# 730).

- Attempting to set a synaptic variable or to start a simulation with synapses without any preceding connect call now raises an error (# 737).

- Improve the performance of coordinate calculation for `Morphology` objects, which previously made plotting very slow for complex morphologies (# 741).

- Fix a bug in `SpatialNeuron` where it did not detect non-linear dependencies on v, introduced via point currents (# 743).

### Infrastructure and documentation improvements

- An interactive demo, tutorials, and examples can now be run in an interactive jupyter notebook on the mybinder platform, without any need for a local Brian installation (# 736). Thanks to Ben Evans for the idea and help with the implementation.

- A new extensive guide for converting Brian 1 simulations to Brian 2 user coming from Brian 1: Changes for Brian 1 users

- A re-organized User’s guide, with clearer indications which information is important for new Brian users.

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Benjamin Evans (@bdevans)

Testing, suggestions and bug reports (ordered alphabetically, apologies to anyone we forgot…):

- Chaofei Hong

- Daniel Bliss

- Jacopo Bono

- Ruben Tikidji-Hamburyan

## Brian 2.0rc3

This is another “release candidate” for Brian 2.0 that fixes a range of bugs and introduces better support for random numbers (see below). We are getting close to the final Brian 2.0 release, the remaining work will focus on bug fixes, and better error messages and documentation.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### New features

- Brian now comes with its own `seed()` function, allowing to seed the random number generator and thereby to make simulations reproducible. This function works for all code generation targets and in runtime and standalone mode. See Random numbers for details.

- Brian can now export/import state variables of a group or a full network to/from a pandas `DataFrame` and comes with a mechanism to extend this to other formats. Thanks to Dominik Krzemiński for this contribution (see # 306).

### Improvements and bug fixes

- Use a Mersenne-Twister pseudorandom number generator in C++ standalone mode, replacing the previously used low-quality random number generator from the C standard library (see # 222, # 671 and # 706).

- Fix a memory leak in code running with the weave code generation target, and a smaller memory leak related to units stored repetitively in the `UnitRegistry`.

- Fix a difference of one timestep in the number of simulated timesteps between runtime and standalone that could arise for very specific values of dt and t (see # 695).

- Fix standalone compilation failures with the most recent gcc version which defaults to C++14 mode (see # 701)

- Fix incorrect summation in synapses when using the `(summed)` flag and writing to pre-synaptic variables (see # 704)

- Make synaptic pathways work when connecting groups that define nested subexpressions, instead of failing with a cryptic error message (see # 707).

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dominik Krzemiński (@dokato)

- Dan Goodman (@thesamovar)

- Martino Sorbaro (@martinosorb)

Testing, suggestions and bug reports (ordered alphabetically, apologies to anyone we forgot…):

- Craig Henriquez

- Daniel Bliss

- David Higgins

- Gordon Erlebacher

- Max Gillett

- Moritz Augustin

- Sami Abdul-Wahid

## Brian 2.0rc1

This is a bug fix release that we release only about two weeks after the previous release because that release introduced a bug that could lead to wrong integration of stochastic differential equations. Note that standard neuronal noise models were not affected by this bug, it only concerned differential equations implementing a “random walk”. The release also fixes a few other issues reported by users, see below for more information.

### Improvements and bug fixes

- Fix a regression from 2.0b4: stochastic differential equations without any non-stochastic part (e.g. `dx/dt = xi/sqrt(ms)``) were not integrated correctly (see # 686).

- Repeatedly calling `restore()` (or `Network.restore`) no longer raises an error (see # 681).

- Fix an issue that made `PoissonInput` refuse to run after a change of dt (see # 684).

- If the `rates` argument of `PoissonGroup` is a string, it will now be evaluated at every time step instead of once at construction time. This makes time-dependent rate expressions work as expected (see # 660).

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

Testing, suggestions and bug reports (ordered alphabetically, apologies to anyone we forgot…):

- Cian O’Donnell

- Daniel Bliss

- Ibrahim Ozturk

- Olivia Gozel

## Brian 2.0rc

This is a release candidate for the final Brian 2.0 release, meaning that from now on we will focus on bug fixes and documentation, without introducing new major features or changing the syntax for the user. This release candidate itself does however change a few important syntax elements, see “Backwards-incompatible changes” below.

As always, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Major new features

- New “generator syntax” to efficiently generate synapses (e.g. one-to-one connections), see Creating synapses for more details.

- For synaptic connections with multiple synapses between a pair of neurons, the number of the synapse can now be stored in a variable, allowing its use in expressions and statements (see Creating synapses).

- `Synapses` can now target other `Synapses` objects, useful for some models of synaptic modulation.

- The `Morphology` object has been completely re-worked and several issues have been fixed. The new `Section` object allows to model a section as a series of truncated cones (see Creating a neuron morphology).

- Scripts with a single `run()` call, no longer need an explicit `device.build()` call to run with the C++ standalone device. A `set_device()` in the beginning is enough and will trigger the `build` call after the run (see Standalone code generation).

- All state variables within a `Network` can now be accessed by `Network.get_states` and `Network.set_states` and the `store()`/`restore()` mechanism can now store the full state of a simulation to disk.

- Stochastic differential equations with multiplicative noise can now be integrated using the Euler-Heun method (`heun`). Thanks to Jan-Hendrik Schleimer for this contribution.

- Error messages have been significantly improved: errors for unit mismatches are now much clearer and error messages triggered during the intialization phase point back to the line of code where the relevant object (e.g. a `NeuronGroup`) was created.

- `PopulationRateMonitor` now provides a `smooth_rate` method for a filtered version of the stored rates.

### Improvements and bug fixes

- In addition to the new synapse creation syntax, sparse probabilistic connections are now created much faster.

- The time for the initialization phase at the beginning of a `run()` has been significantly reduced.

- Multicompartmental simulations with a large number of compartments are now simulated more efficiently and are making better use of several processor cores when OpenMP is activated in C++ standalone mode. Thanks to Moritz Augustin for this contribution.

- Simulations will use compiler settings that optimize performance by default.

- Objects that have user-specified names are better supported for complex simulation scenarios (names no longer have to be unique at all times, but only across a network or across a standalone device).

- Various fixes for compatibility with recent versions of numpy and sympy

### Important backwards-incompatible changes

- The argument names in `Synapses.connect` have changed and the first argument can no longer be an array of indices. To connect based on indices, use `Synapses.connect(i=source_indices, j=target_indices)`. See Creating synapses and the documentation of `Synapses.connect` for more details.

- The actions triggered by pre-synaptic and post-synaptic spikes are now described by the `on_pre` and `on_post` keyword arguments (instead of `pre` and `post`).

- The `Morphology` object no longer allows to change attributes such as length and diameter after its creation. Complex morphologies should instead be created using the `Section` class, allowing for the specification of all details.

- `Morphology` objects that are defined with coordinates need to provide the start point (relative to the end point of the parent compartment) as the first coordinate. See Creating a neuron morphology for more details.

- For simulations using the C++ standalone mode, no longer call `Device.build` (if using a single `run()` call), or use `set_device()` with `build_on_run=False` (see Standalone code generation).

### Infrastructure improvements

- Our test suite is now also run on Mac OS-X (on the Travis CI platform).

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Moritz Augustin (@moritzaugustin)

- Jan-Hendrik Schleimer (@ttxtea)

- Romain Cazé (@rcaze)

- Konrad Wartke (@Kwartke)

- Romain Brette (@romainbrette)

Testing, suggestions and bug reports (ordered alphabetically, apologies to anyone we forgot…):

- Chaofei Hong

- Kees de Leeuw

- Luke Y Prince

- Myung Seok Shim

- Owen Mackwood

- Github users: @epaxon, @flinz, @mariomulansky, @martinosorb, @neuralyzer, @oleskiw, @prcastro, @sudoankit

## Brian 2.0b4

This is the fourth (and probably last) beta release for Brian 2.0. This release adds a few important new features and fixes a number of bugs so we recommend all users of Brian 2 to upgrade. If you are a user new to Brian, we also recommend to directly start with Brian 2 instead of using the stable release of Brian 1. Note that the new recommended way to install Brian 2 is to use the Anaconda distribution and to install the Brian 2 conda package (see Installation).

This is however still a Beta release, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Major new features

- In addition to the standard threshold/reset, groups can now define “custom events”. These can be recorded with the new `EventMonitor` (a generalization of `SpikeMonitor`) and `Synapses` can connect to these events instead of the standard spike event. See Custom events for more details.

- `SpikeMonitor` and `EventMonitor` can now also record state variable values at the time of spikes (or custom events), thereby offering the functionality of `StateSpikeMonitor` from Brian 1. See Recording variables at spike time for more details.

- The code generation modes that interact with C++ code (weave, Cython, and C++ standalone) can now be more easily configured to work with external libraries (compiler and linker options, header files, etc.). See the documentation of the `cpp_prefs` module for more details.

### Improvemements and bug fixes

- Cython simulations no longer interfere with each other when run in parallel (thanks to Daniel Bliss for reporting and fixing this).

- The C++ standalone now works with scalar delays and the spike queue implementation deals more efficiently with them in general.

- Dynamic arrays are now resized more efficiently, leading to faster monitors in runtime mode.

- The spikes generated by a `SpikeGeneratorGroup` can now be changed between runs using the `set_spikes` method.

- Multi-step state updaters now work correctly for non-autonomous differential equations

- `PoissonInput` now correctly works with multiple clocks (thanks to Daniel Bliss for reporting and fixing this)

- The `get_states` method now works for `StateMonitor`. This method provides a convenient way to access all the data stored in the monitor, e.g. in order to store it on disk.

- C++ compilation is now easier to get to work under Windows, see Installation for details.

### Important backwards-incompatible changes

- The `custom_operation` method has been renamed to `run_regularly` and can now be called without the need for storing its return value.

- `StateMonitor` will now by default record at the beginning of a time step instead of at the end. See Recording variables continuously for details.

- Scalar quantities now behave as python scalars with respect to in-place modifications (augmented assignments). This means that `x = 3*mV; y = x; y += 1*mV` will no longer increase the value of the variable `x` as well.

### Infrastructure improvements

- We now provide conda packages for Brian 2, making it very easy to install when using the Anaconda distribution (see Installation).

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Daniel Bliss (@dabliss)

- Romain Brette (@romainbrette)

Testing, suggestions and bug reports (ordered alphabetically, apologies to everyone we forgot…):

- Daniel Bliss

- Damien Drix

- Rainer Engelken

- Beatriz Herrera Figueredo

- Owen Mackwood

- Augustine Tan

- Ot de Wiljes

## Brian 2.0b3

This is the third beta release for Brian 2.0. This release does not add many new features but it fixes a number of important bugs so we recommend all users of Brian 2 to upgrade. If you are a user new to Brian, we also recommend to directly start with Brian 2 instead of using the stable release of Brian 1.

This is however still a Beta release, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Major new features

- A new `PoissonInput` class for efficient simulation of Poisson-distributed input events.

### Improvements

- The order of execution for `pre` and `post` statements happending in the same time step was not well defined (it fell back to the default alphabetical ordering, executing `post` before `pre`). It now explicitly specifies the `order` attribute so that `pre` gets executed before `post` (as in Brian 1). See the Synapses documentation for details.

- The default schedule that is used can now be set via a preference (core.network.default_schedule). New automatically generated scheduling slots relative to the explicitly defined ones can be used, e.g. `before_resets` or `after_synapses`. See Scheduling for details.

- The scipy package is no longer a dependency (note that weave for compiled C code under Python 2 is now available in a separate package). Note that multicompartmental models will still benefit from the scipy package if they are simulated in pure Python (i.e. with the `numpy` code generation target) – otherwise Brian 2 will fall back to a numpy-only solution which is significantly slower.

### Important bug fixes

- Fix `SpikeGeneratorGroup` which did not emit all the spikes under certain conditions for some code generation targets (# 429)

- Fix an incorrect update of pre-synaptic variables in synaptic statements for the `numpy` code generation target (# 435).

- Fix the possibility of an incorrect memory access when recording a subgroup with `SpikeMonitor` (# 454).

- Fix the storing of results on disk for C++ standalone on Windows – variables that had the same name when ignoring case (e.g. `i` and `I`) where overwriting each other (# 455).

### Infrastructure improvements

- Brian 2 now has a chat room on gitter: https://gitter.im/brian-team/brian2

- The sphinx documentation can now be built from the release archive file

- After a big cleanup, all files in the repository have now simple LF line endings (see https://help.github.com/articles/dealing-with-line-endings/ on how to configure your own machine properly if you want to contribute to Brian).

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Konrad Wartke (@kwartke)

Testing, suggestions and bug reports (ordered alphabetically, apologies to everyone we forgot…):

- Daniel Bliss

- Owen Mackwood

- Ankur Sinha

- Richard Tomsett

## Brian 2.0b2

This is the second beta release for Brian 2.0, we recommend all users of Brian 2 to upgrade. If you are a user new to Brian, we also recommend to directly start with Brian 2 instead of using the stable release of Brian 1.

This is however still a Beta release, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Major new features

- Multi-compartmental simulations can now be run using the Standalone code generation mode (this is not yet well-tested, though).

- The implementation of `TimedArray` now supports two-dimensional arrays, i.e. different input per neuron (or synapse, etc.), see Timed arrays for details.

- Previously, not setting a code generation target (using the codegen.target preference) would mean that the `numpy` target was used. Now, the default target is `auto`, which means that a compiled language (`weave` or `cython`) will be used if possible. See Computational methods and efficiency for details.

- The implementation of `SpikeGeneratorGroup` has been improved and it now supports a `period` argument to repeatedly generate a spike pattern.

### Improvements

- The selection of a numerical algorithm (if none has been specified by the user) has been simplified. See Numerical integration for details.

- Expressions that are shared among neurons/synapses are now updated only once instead of for every neuron/synapse which can lead to performance improvements.

- On Windows, The Microsoft Visual C compiler is now supported in the `cpp_standalone` mode, see the respective notes in the Installation and Computational methods and efficiency documents.

- Simulation runs (using the standard “runtime” device) now collect profiling information. See Profiling for details.

### Infrastructure and documentation improvements

- Tutorials for beginners in the form of ipython notebooks (currently only covering the basics of neurons and synapses) are now available.

- The Examples in the documentation now include the images they generated. Several examples have been adapted from Brian 1.

- The code is now automatically tested on Windows machines, using the appveyor service. This complements the Linux testing on travis.

- Using a version of a dependency (e.g. sympy) that we don’t support will now raise an error when you import `brian2` – see Dependency checks for more details.

- Test coverage for the `cpp_standalone` mode has been significantly increased.

### Important bug fixes

- The preparation time for complicated equations has been significantly reduced.

- The string representation of small physical quantities has been corrected (# 361)

- Linking variables from a group of size 1 now works correctly (# 383)

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Romain Brette (@romainbrette)

- Pierre Yger (@yger)

Testing, suggestions and bug reports (ordered alphabetically, apologies to everyone we forgot…):

- Conor Cox

- Gordon Erlebacher

- Konstantin Mergenthaler

## Brian 2.0beta

This is the first beta release for Brian 2.0 and the first version of Brian 2.0 we recommend for general use. From now on, we will try to keep changes that break existing code to a minimum. If you are a user new to Brian, we’d recommend to start with the Brian 2 beta instead of using the stable release of Brian 1.

This is however still a Beta release, please report bugs or suggestions to the github bug tracker (https://github.com/brian-team/brian2/issues) or to the brian-development mailing list (brian-development@googlegroups.com).

### Major new features

- New classes `Morphology` and `SpatialNeuron` for the simulation of Multicompartment models

- A temporary “bridge” for `brian.hears` that allows to use its Brian 1 version from Brian 2 (Brian Hears)

- Cython is now a new code generation target, therefore the performance benefits of compiled code are now also available to users running simulations under Python 3.x (where `scipy.weave` is not available)

- Networks can now store their current state and return to it at a later time, e.g. for simulating multiple trials starting from a fixed network state (Continuing/repeating simulations)

- C++ standalone mode: multiple processors are now supported via OpenMP (Multi-threading with OpenMP), although this code has not yet been well tested so may be inaccurate.

- C++ standalone mode: after a run, state variables and monitored values can be loaded from disk transparently. Most scripts therefore only need two additional lines to use standalone mode instead of Brian’s default runtime mode (Standalone code generation).

### Syntax changes

- The syntax and semantics of everything around simulation time steps, clocks, and multiple runs have been cleaned up, making `reinit` obsolete and also making it unnecessary for most users to explicitly generate `Clock` objects – instead, a `dt` keyword can be specified for objects such as `NeuronGroup` (Running a simulation)

- The `scalar` flag for parameters/subexpressions has been renamed to `shared`

- The “unit” for boolean variables has been renamed from `bool` to `boolean`

- C++ standalone: several keywords of `CPPStandaloneDevice.build` have been renamed

- The preferences are now accessible via `prefs` instead of `brian_prefs`

- The `runner` method has been renamed to `custom_operation`

### Improvements

- Variables can now be linked across `NeuronGroup`s (Linked variables)

- More flexible progress reporting system, progress reporting also works in the C++ standalone mode (Progress reporting)

- State variables can be declared as `integer` (Equation strings)

### Bug fixes

57 github issues have been closed since the alpha release, of which 26 had been labeled as bugs. We recommend all users of Brian 2 to upgrade.

### Contributions

Code and documentation contributions (ordered by the number of commits):

- Marcel Stimberg (@mstimberg)

- Dan Goodman (@thesamovar)

- Romain Brette (@romainbrette)

- Pierre Yger (@yger)

- Werner Beroux (@wernight)

Testing, suggestions and bug reports (ordered alphabetically, apologies to everyone we forgot…):

- Guillaume Bellec

- Victor Benichoux

- Laureline Logiaco

- Konstantin Mergenthaler

- Maurizio De Pitta

- Jan-Hendrick Schleimer

- Douglas Sterling

- Katharina Wilmes