# New release: Brian 2.8

**URL:** <https://brian.discourse.group/t/new-release-brian-2-8/1353>\
**Category:** Announcements\
**Tags:** release\
**Created:** [20 December 2024 13:30 UTC](https://brian.discourse.group/t/new-release-brian-2-8/1353 "2024-12-20T13:30:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [20 December 2024 13:30 UTC](https://brian.discourse.group/t/new-release-brian-2-8/1353/1 "2024-12-20T13:30:05Z")

</div>

We are happy to announce the Brian 2.8 release 🚀 . This release fixes a number of small bugs and improves our release infrastructure. In addition, it includes an important performance improvement for random number generation in C++ standalone mode, which significantly speeds up everything that needs randomness (e.g. `PoissonGroup`). It also comes with the _Diehl & Cook (2015)_ model in the [documentation](https://brian2.readthedocs.io/en/2.8.0/examples/frompapers.Diehl_Cook_2015.html), contributed by @bjourne (thanks!).

Brian 2 can be installed with pip from the [pypi repository](https://pypi.org/project/Brian2/), and via several other means (some of them might take a while to catch up to the latest release). See the [installation instructions](https://brian2.readthedocs.io/en/2.8.0/introduction/install.html), and the badges in the [README file](https://github.com/brian-team/brian2?tab=readme-ov-file#brian2t) for more details.

Thanks to everyone who contributed 🤝!

---

<div class="post-metadata">

**Author:** ![DavidKing2020](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Post date:** [20 December 2024 22:39 UTC](https://brian.discourse.group/t/new-release-brian-2-8/1353/2 "2024-12-20T22:39:48Z")

</div>

Hi @mstimberg , regarding to the following new feature:

" `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"

Is this intended to solve the problem of large number of files in cpp\_standalone mode when running with run\_args with many samples?

In the older verion, I invoke the delete command at the very end when the entire simulation is done. Does it mean we need to use the command within the run\_arg loop to leverage this new feature , e.g. as the following?

```
  for tau_value in (np.arange(10)+1)*5*ms:
       device.run(run_args={group.tau: tau_value})
       device.detele(force=True)

```

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [2 January 2025 16:11 UTC](https://brian.discourse.group/t/new-release-brian-2-8/1353/3 "2025-01-02T16:11:54Z")

</div>

Hi @DavidKing2020. Even before introducing this feature, you could have deleted everything except for the code after every run with `device.delete(code=False, directory=False)`. Previously, this would have leave _arrays_ used for the `run_args` features on the disk. In your example above, this is not an issue, since `tau_value` is a single value and never written to disk. But if you use something like

```python
old_weights = initial_weights
for input_stimulus in stimuli:
   device.run(input_neurons.rates: input_stimulus, synapses.w: old_weights)
   old_weights = synapses.w[:] # store previous weights

```

then `input_neurons.rates` and `synapses.w` would be initialized via arrays from disk at every iteration. These arrays would have been previously kept around, except if you did `force=True`. But forcing the full deletion of the output directory is not something you’d want before the very end of all your simulations – if will delete the compiled code as well, and you’d have to run `device.build` again before you can do a `device.run`. With the latest version, you can now add `device.delete(code=False, directory=False)` to the end of the loop body (after extracting all the values you are interested in) and it will prevent that the disk space used by the output directory increases with every run.

Hope that makes things a bit clearer?

---

<div class="post-metadata">

**Author:** ![DavidKing2020](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Post date:** [2 January 2025 23:58 UTC](https://brian.discourse.group/t/new-release-brian-2-8/1353/4 "2025-01-02T23:58:31Z")

</div>

Thanks @mstimberg . That’s quite clear!
