Skip to content

Commit 5f0b2c0

Browse files
authored
maint: patch: v0.4 (#1034)
This is an emergency patch due to several issues that our tests did not catch. This will become the new v0.4 release commit. This commit does two things: 1. Reverts `BatchSimulate` from a top-level import to how it was imported previously, which now requires manual import, as shown in its example. I've added relevant instructions in the example that indicates it requires some extra dependencies to function. 2. Adds a line in `setup.py` which is required for `setup.py` use (but not `pyproject.toml`) that indicates to the relevant Python Packaging repository that the README is in markdown format. I've also be re-writing the "How to make a release" guide a bunch, including reversing the order of instructings for `twine` uploading vs testing the distributable. It turns out that the reason `BatchSimulate` was not added to the existing API documentation is related to a "blind spot" in our tests: neither our units tests nor documentation tests actually test a "minimal install" of simply: `pip install hnn_core` *without* including various extras. It turns that doing the above command in a fresh environment of the previous master branch is actually broken: this is due to `BatchSimulate`'s import dependence on `joblib`, which is only included in the `[parallel]` dependencies. Because I recently added `BatchSimulate` as a top-level import, but all of our tests automatically install the `joblib` dependency, this was not caught. I apologize for the error, and I will make a future PR that adds additional steps to our unit tests that *progressively* install the dependencies of minimal and, later, extra dependencies of hnn-core, before proceeding to the existing unit tests. Normally, it would be best to propagate this change as a "patch" release such as v0.4.1, but we currently do not follow Semantic Versioning, and furthermore it has yet to be tested if our documentation systems works with Semantic Versioning indexing (or how it can be made to be). This is another change we should make soon in the future. Depending on the tests and more install testing, this will likely become the new v0.4 release commit because the Python-packaged version had not yet been pushed to Pypi (immutable), while other metadata (such as the documentation and git tags) are mutable.
1 parent 9e14b99 commit 5f0b2c0

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

doc/api.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Simulation (:py:mod:`hnn_core`):
2424
Cell
2525
CellResponse
2626
pick_connection
27-
BatchSimulate
2827

2928
Network Models (:py:mod:`hnn_core`):
3029
------------------------------------
@@ -101,7 +100,6 @@ Parallel backends (:py:mod:`hnn_core.parallel_backends`):
101100
MPIBackend
102101
JoblibBackend
103102

104-
105103
Input and Output:
106104
-----------------
107105

doc/whats_new.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ v0.4 represents a major milestone in development of `hnn_core` and the HNN ecosy
1313

1414
- `hnn_core` now includes a fully-tested and robust GUI of its own. The `hnn_core` GUI was present as a prototype in v0.3, but it is now ready for production. New features and visual improvements will still be coming to it in the future, such as the ability to use optimization. See our new [Install page](https://jonescompneurolab.github.io/hnn-core/dev/install.html) for ways to install it, and we have already begun incorporating it into a new, fresh series of tutorials for our upcoming revamp of the HNN website. If you have installed it, you can start the GUI using `hnn-gui` in your terminal/command prompt window.
1515

16-
- The `BatchSimulate` class: Thanks to [Abdul Samad Siddiqui][] and Google Summer of Code 2024, there is now the capability to run "batches" of simulations across multiple parameter sets, enabling easy analysis and simulation of behavior across parameter sweeps. See our [example for more details](https://jonescompneurolab.github.io/hnn-core/dev/auto_examples/howto/plot_batch_simulate.html#sphx-glr-auto-examples-howto-plot-batch-simulate-py). Note that currently, only its `loky` backend is supported.
16+
- The `BatchSimulate` class: Thanks to [Abdul Samad Siddiqui][] and Google Summer of Code 2024, there is now the capability to run "batches" of simulations across multiple parameter sets, enabling easy analysis and simulation of behavior across parameter sweeps. See our [example for more details](https://jonescompneurolab.github.io/hnn-core/dev/auto_examples/howto/plot_batch_simulate.html#sphx-glr-auto-examples-howto-plot-batch-simulate-py). Note that currently, only its `loky` backend is supported, and the `"hnn-core[parallel]"` dependencies must be installed for it to be used.
1717

1818
- Significant improvements to the API, documentation, and pedagogical examples [especially for Optimization](https://jonescompneurolab.github.io/hnn-core/stable/auto_examples/howto/optimize_evoked.html#sphx-glr-auto-examples-howto-optimize-evoked-py), among others.
1919

@@ -129,8 +129,10 @@ v0.4 represents a major milestone in development of `hnn_core` and the HNN ecosy
129129
- Add function {func}`~hnn_core.params.convert_to_json` to convert legacy param and json
130130
files to new json format, by [George Dang][] in {gh}`772`
131131

132-
- Add {class}`~hnn_core.BatchSimulate` for batch simulation capability, by [Abdul Samad
133-
Siddiqui][] in {gh}`782`
132+
- Add
133+
[`BatchSimulate`](https://jonescompneurolab.github.io/hnn-core/dev/auto_examples/howto/plot_batch_simulate.html#sphx-glr-auto-examples-howto-plot-batch-simulate-py)
134+
class for batch simulation capability, by [Abdul Samad Siddiqui][]
135+
in {gh}`782`
134136

135137
- Recorded calcium concentration from the soma, as well as all sections, are enabled by
136138
setting `record_ca` to `soma` or `all` in {func}`~hnn_core.simulate_dipole`.
@@ -141,8 +143,9 @@ v0.4 represents a major milestone in development of `hnn_core` and the HNN ecosy
141143
colormap, and interpolation method to smoothen CSD plot, by [Katharina Duecker][] in
142144
{gh}`815`
143145

144-
- Refactor and improve documentation for {class}`~hnn_core.BatchSimulate`, by [Abdul
145-
Samad Siddiqui][] in {gh}`830` and {gh}`857`
146+
- Refactor and improve documentation for
147+
[`BatchSimulate`](https://jonescompneurolab.github.io/hnn-core/dev/auto_examples/howto/plot_batch_simulate.html#sphx-glr-auto-examples-howto-plot-batch-simulate-py), by [Abdul Samad Siddiqui][]
148+
in {gh}`830` and {gh}`857`
146149

147150
- Add argument to change colors of `plot_spikes_raster`, shortened line lengths to
148151
prevent overlap, and added an argument for custom cell types, by [George Dang][] in

examples/howto/plot_batch_simulate.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
for comprehensive analysis.
99
"""
1010

11+
###############################################################################
12+
# Note that batch simulation requires you to install HNN-core with Joblib
13+
# parallel support, which you can do by installing it with
14+
# ``pip install "hnn_core[parallel]"``
15+
16+
1117
# Authors: Abdul Samad Siddiqui <[email protected]>
1218
# Nick Tolley <[email protected]>
1319
# Ryan Thorpe <[email protected]>
@@ -21,7 +27,7 @@
2127
import matplotlib.pyplot as plt
2228
import numpy as np
2329

24-
from hnn_core import BatchSimulate
30+
from hnn_core.batch_simulate import BatchSimulate
2531
from hnn_core import jones_2009_model
2632

2733
# The number of cores may need modifying depending on your current machine.

hnn_core/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
from .cell_response import CellResponse, read_spikes
77
from .cells_default import pyramidal, basket
88
from .parallel_backends import MPIBackend, JoblibBackend
9-
from .batch_simulate import BatchSimulate
109

1110
__version__ = '0.4'

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def run(self):
9797
version=version,
9898
download_url=DOWNLOAD_URL,
9999
long_description=open('README.md').read(),
100+
long_description_content_type='text/markdown',
100101
classifiers=[
101102
'Intended Audience :: Science/Research',
102103
'Intended Audience :: Developers',

0 commit comments

Comments
 (0)