What’s new?#
1.0.0 Release Notes#
Despite this version of hnn-core being marked as version 1.0.0, this software
package has been stable for several years and is actively being used by many
different scientists for ongoing research. We decided to release this as version 1.0.0
primarily to communicate that hnn-core is, and has been, ready for active use. It
should not be thought of as “still being built”. That said, we will still continue by
adding new features and making it easier to use than ever before!
To be clear, this means the versions go directly from 0.6.1 to 1.0.0, and there is
no version 0.7.0, etc. Please enjoy the numerous additions!
New Features#
Katharina Duecker has added an exciting, brand-new model,
duecker_ET_model, which includes new human-derived pyramidal cell and interneuron models (L2_inhibitoryandL5_inhibitory) along with new ion channel and synapse mechanisms (includingNMDA_gao2021andgabab_neymotin2016synapses, and channels from Hay et al. 2011 and Golomb et al. 2007). A preprint is available here, the final publication is pending, and the source code for the simulations in the paper is available here. Importantly, the model is still subject to change until final publication. You can easily include simulation of its optional ERP drives using the argumentadd_erp_drives=True. Merged in #1227 with additional updates by Katharina Duecker, Nick Tolley, and Austin E. Soplata in #1345, #1358, and #1363.HNN-Core now supports NEURON 9 (up to 9.0.2, inclusive) and Python up to 3.14 (inclusive). Please note that due to the removal of legacy units in NEURON 9.0, ALL simulations starting with this HNN-Core version will be quantitatively different! However, your simulations should still be qualitatively similar, and the numerical differences will likely be negligible. As an example, this should be equivalent to changing your calcium current reversal potential (
E_Ca) from a value of 134.02 to 134.54, or similar magnitude. If your findings are robust to initial conditions and seeds, then you should have nothing to worry about. By Austin E. Soplata and Claude in #1230.Note: If you want exact bit-perfect reproduction of your simulations from before this change, please install the earlier stable version using
pip install "hnn-core[all]==0.6.1". The prior stable version (v0.6.1) will always force usage of NEURON 8 along with the legacy units. If you run into issues with updating your code, simulations, or reproducibility, then please reach out to us on our Github Discussions page.
MPI parallelism in
hnn-corecan now be installed entirely throughpip(oruv)! On MacOS and Linux (including Windows WSL),pip install "hnn-core[parallel]"(or, alternatively,pip install "hnn-core[all]") now installs thempi4pyandopenmpiPyPI packages automatically. See our Installation Guide for details.MPIBackendcan automatically locate and use the MPI library provided by theopenmpipackage, without the need to set any environment variables yourself.MPIBackendalso has two new arguments for advanced users (such as on HPC systems):autoload_mpi_libraryto disable thisopenmpipippackage behavior, andmpi_lib_pathif you want to explicitly provide a path to a custom MPI library file that you want NEURON to use. This means you can usevenvoruvto installhnn-corewith MPI support without needing any Anaconda packages at all. This is backwards-compatible, and olderconda-based MPI installs will still work. By Austin E. Soplata and Claude in #1377 (thanks to Mainak Jas for the tip!)For Optimization, users can now specify their own custom objective function in two different ways:
Passing
obj_fun='custom'toOptimizer(). If passing the string'custom', then users can provide a custom function by passingloss_fun=my_functiontoOptimizer.fit(). The only restrictions on this function are that it must accept both a singleDipoleobject andobj_fun_kwargs, similar to other objective functions. More details are available in the descriptions forOptimizerandfit().Passing their own function (or callable) directly via
obj_fun=<callable>toOptimizer. If users want to use an objective function without the restrictions of the first way (above), then they can write their own function similar to the existing code inoptimization/objective_functions.pyand pass that function toOptimizer(... obj_fun=<callable>). Note that this function must accept all the same arguments as the other objective functions inoptimization/objective_functions.pyand run a simulation.
By Vaishnavi Baghel, Nick Tolley, and Austin E. Soplata in #1271.
(Beta feature)
plot_dipole()can now show overlay arrows marking the onset times of evoked drives on dipole plots, similar to “Original HNN”, via the new argumentsshow_drive_arrows,arrow_width,arrow_height, andnet. This feature is in beta, may still have bugs, is currently disabled in the GUI, and only works for evoked drives. By Sourav Rajvi in #1354, #1387, and #1395.Cells can now use synaptic mechanisms other than NEURON’s
Exp2Syn, which can be specified using new, optional parameter keys of the form<cell_type>_<receptor>_mechname(e.g.L2Pyr_nmda_mechname). This allows custom synaptic mechanisms (such as those used in the new Duecker model) to be used, by Austin E. Soplata in #1229. You can also set parameters specific to your custom mechanisms using HNN-Core, as long as those parameters are properly recognized by NEURON. This still relies on the old “legacy params” interface, so if you are interested in using this, please reach out to us on our Github Discussions page.GUI buttons for saving simulated Networks or simulated dipole output data have been overhauled. In the GUI Simulation tab, each of the “Save Network and Drives” and “Save Simulation Output” buttons now have their own respective dropdowns for which simulation you want to save. This also adds the functionality to save PRIOR simulated networks from the GUI, which was not possible before! By Dylan Daniels in #1399.
Deprecations#
(Breaking change)
BatchSimulatenow expects theset_paramscallback to accept arguments in the order(net, param_values)instead of(param_values, net), aligning it with the order used by theOptimizerclass, by Rahul Tripathi in #1208, fixing #1203. This was their first PR, thanks Rahul!Please note that all simulations produced from this
hnn_coreversion and going forward will be slightly numerically different than those of version v0.6.1 and prior. See note above about NEURON 9.0 support.The
hnn-core-allAnaconda (orconda) package has been pulled from distribution, and will no longer be developed. (Note: this is different from thepip install "hnn-core[all]"package which will always be supported.) Starting with this version,pipanduvwill be the recommended ways to installhnn-core. Users who have previously installed thecondapackage usingconda install hnn-core-all -c jonescompneurolab -c conda-forge
are strongly recommended to remove the
condapackage and instead update to the latesthnn-corepackage using pip. If you installed using the instructions in our Installation Guide, you can do this upgrade with the following commands in your Terminal / Anaconda Prompt:conda activate hnn-core-env conda remove hnn-core-all pip install "hnn-core[all]"
If you have any questions or concerns about updating from the discontinued
condapackage, reach out to us on our Github Discussions page.Example scripts are no longer included in the
hnn-corerepository or on our API website (the website you are reading this on). All of the formerexamples/scripts have been migrated to polished and updated Jupyter notebooks on our Textbook website, such as here. All references to them in these release notes now link to their corresponding Textbook notebooks. This also removes our use ofsphinx-gallery, Binder, etc. By Austin E. Soplata in #1347.
Upcoming Deprecations#
There is now a new, preferred way for you to add the “canonical” ERP drives to your Neymotin 2020 network: Users are strongly advised to begin using the new argument:
# use this new argument `add_erp_drives` neymotin_2020_model(add_erp_drives=True)
INSTEAD OF either
# deprecated neymotin_2020_model(add_drives_from_params=True)
or
# deprecated net = neymotin_2020_model() add_erp_drives_to_jones_model(net)
Both the argument
neymotin_2020_model(add_drives_from_params=True)and the functionadd_erp_drives_to_jones_model()will eventually be deprecated and have been marked as such.The reasoning for this was that the two deprecated ways to add these drives were slightly different (seed values were different), and that
add_drives_from_params’s final values required reading a lot of code. You can see all parameters for the canonical drives easily here.The only exception to using the new
neymotin_2020_model(add_erp_drives=True)argument is if you are still usinglegacy_mode=True. If you still needlegacy_mode, then you must continue usingadd_drives_from_params, thoughlegacy_modeis planned to be deprecated as well in the future.This same argument has been added to
jones_2009_model(add_erp_drives=True)for backwards compatibility, though we recommend users switch fromjones_2009_model()toneymotin_2020_model().Relatedly, the new
duecker_ET_modelalso has an argument of the same name (duecker_ET_model(add_erp_drives=True)) for adding its canonical ERP drives, however be advised that its ERP drives are very different than that ofneymotin_2020_model, and you can read about them at the Duecker preprint here. By Austin E. Soplata and Sourav Rajvi in #1340.Network.set_cell_positionshas been renamed toNetwork.update_cell_positions. Now, if you want to change where the cell positions are to new values, useNetwork.update_cell_positions, and if you instead want to reset the cell positions back to where they were before anyNetwork.update_cell_positionscalls, you can useNetwork._reset_to_original_cell_positions. By Katharina Duecker, Nick Tolley, and Austin E. Soplata in #1227.The
postprocargument ofsimulate_dipole()is now documented as deprecated. Please explicitly use thesmooth()andscale()methods after your simulation instead, by Katharina Duecker in #1343.
Public API Changes#
simulate_dipole()now accepts abaseline_correctionboolean argument (defaultTrue), which controls whether the baseline correction appropriate for theNetwork’s model is applied to the dipole after simulation, by Katharina Duecker and Austin E. Soplata in #1343. If you have always used the default behavior, then you do not need to take any action. The new flag is also supported by users ofsimulate_dipolesuch asBatchSimulate.duecker_ET_modelis now available viafrom hnn_core import duecker_ET_model(see “New Features” above).pip install "hnn-core[parallel]"orpip install "hnn-core[all]"now install MPI support on Mac, Linux, and Windows-WSL automatically (see “New Features” above).The
dask[distributed]package can now be installed usingpip install "hnn-core[dask]"for use withJoblibBackend’s dask backend, by M Yaswanth Reddy in #1248. It will also be installed withpip install "hnn-core[all]".plot_spikes_raster()now supports a new argumentgid_ranges, allowing users to specify that they want the spike trains of specific GIDs to be plotted, by Katharina Duecker in #1356.Many API changes introduced in #1227:
Spike output saved to
*.txtfiles should now always be sorted in time, even if MPI was used in the simulation.For developers, there is a new
Makefilereciperegenerate-duecker-test-data. This needs to be run by developers whenever there are any changes to either the network or drive parameters of our “canonical” Duecker model, in order to update the “ground truth” data that is used in testing.Networkobjects now have a newmodel_variantattribute that is handled automatically throughout JSON files, etc. This is currently only used for discriminating Duecker-models from non-Duecker models (i.e. Neymotin 2020, etc.), but will be a key part of supporting other models in our future repertoire.Cell.create_tonic_biasis now demoted to a private functionCell._create_tonic_bias, since it is what is used to actually create the biases in NEURON at simulation. Users who want to introduce a new bias to the network should continue to useNetwork.add_tonic_bias.CellResponsenow accepts a new argumentcell_type_metadata, in case you want to provide your own custom metadata for your own custom celltypes. This is not recommended for general use, and is instead mostly used automatically whenCellResponseobjects are created after simulations. If you do decide to pass your owncell_type_metadata, see the top ofnetwork_models.pyfor an example that uses the default (Neymotin) network.CellResponsenow has new methodsrate_over_time()and the relatedplot_firing_rate_time().rate_over_timeis similar tomean_ratesbut with a different API, and allows you to calculate firing rates for specific cells (or cell types) but using only a sliding window of time instead of only measuring across a single time segment. You can visualize its output with the new associatedplot_firing_rate_time.The Duecker model has introduced new celltypes in
cells_default.py, includingpyramidal_humanL5ET,pyramidal_humanL23, andhuman_gen_interneuron.Optimizernow has a new objective function nameddipole_rmse_corr, which calculates the “correlation-weighted RMSE” between dipoles, penalizing solutions with low correlation. Seedipole.py’s_rmse_corr()for details on the calculation.There are now several new MOD files available for use, all of which are used in the new Duecker model, such as
mod/NMDA_gao2021.mod, etc. You can thus view the exact source code of the model mechanisms used in the new Duecker model, many of which are adapted from (Hay et al., 2011) (see the MOD files for publication references).If you are creating raw
Networkobjects from scratch (instead of using the recommendedneymotin_2020_modelorduecker_ET_modelfunctions), and if you pass either a custompos_dictorcell_typesargument, you MUST pass your own version of the other argument. This is a small part of our plan to gradually reduce the amount of hardcoding of specific celltypes. Relatedly, if you do pass a custompos_dict, then related variables likeinplane_distancewill be recalculated automatically based on your positions, instead of being hardcoded to constant values.(Upcoming deprecation)
Network.set_cell_positionshas been renamed toNetwork.update_cell_positions. Now, if you want to change where the cell positions are to new values, useNetwork.update_cell_positions, and if you instead want to reset the cell positions back to where they were before anyNetwork.update_cell_positionscalls, you can useNetwork._reset_to_original_cell_positions.Network.add_tonic_biasnow accepts a new argumentgid, which allows several different ways for you to specify which exact GIDs (or cells) you want a particular bias to connect to. See documentation hereadd_tonic_bias().Network.plot_cellsnow accepts new argumentscolorsandmarkers, where you can map colors/markers to specific cell types.CMA-ES optimization will now save (or overwrite) a
cma_checkpoint.pklfile every 10th iteration of your optimization, in order to not lose your progress if it crashes. We plan to add this functionality to other optimization algorithms soon.plot_spikes_rasternow accepts more arguments that correspond to Matplotlib variables includingxticks,yticks,xlabel,ylabel, andtitle. Internally, its color handling, sizing, and scaling have all been improved.
Bug Fixes#
The notorious
MPITimeouterrors should now be a thing of the past and no longer happen! Document and remove problematic MPI Timeouts (while keeping code intact), and implement a new tempfile-based mechanism for transmitting MPI data from child processes back to rank 0 child process then parent process, by Camilo Diaz in #1312 and #1315.User-facing deprecation notices now emit
FutureWarninginstead ofDeprecationWarning, making them visible under Python’s default warning filters, by William Kang in #1339. This was their first PR, thanks William!Loading external drives in the GUI now extends the simulation duration when needed, preserving configured drive and tonic-bias stop times, by William Kang in #1348.
The
RMSEandCorrcomparison text on GUI dipole comparison plots is no longer drawn over the evoked drive arrows, and now stays at the bottom right of the plot, by Sourav Rajvi in #1378, fixing #1374.Camilo Diaz did considerable work in fixing our long-standing
MPI Timeoutissues and implementing a permanent solution that uses tempfiles instead of relying on standard input/output/error streams in #1312. Thanks Camilo!Reading in older Network JSON files (created before the
v0initial voltage value was introduced into theNetworkobjects in #1185) no longer incorrectly initializes all of their membrane voltages to -65 mV, and instead uses each section’s correct initial voltage. Thanks to Anna Cattani for finding this bug, which was fixed by Austin E. Soplata in #1327. This means that most simulations that are run usinghnn-core==0.6.1end up being slightly different than the plots shown in our Textbook website, but this is now fixed.Network model functions such as
neymotin_2020_model()once again accept theirparamsargument as astrorPathfilename (which was accidentally removed in #1227), and all ways of passingparamsare now tested, by Austin E. Soplata in #1352.plot_spikes_raster()no longer raises an error when one of the cell types does not spike, by Katharina Duecker in #1356.Optimizernow ensures that the keys ofinitial_paramsandconstraintsare in the same order, which previously could cause the CMA-ES solver to raise an error, by Katharina Duecker in #1359.Interactive plotting buttons in the GUI have been re-enabled by correctly detecting interactive notebook backends, by Tushar Jamdade in #1273, fixing #1125.
Errors that occur when running a simulation in the GUI are now printed at the top of the log window (with their tracebacks) instead of the bottom, by Dev Agarwal in #1264. This was their first PR, thanks Dev!
When a user loads a Network file in the GUI that has custom global synaptic gains, the GUI now displays those custom global gains (“smartly”) instead of resetting them to their default values, by Austin E. Soplata in #1183.
Fixed a failure to remove spectrogram colorbars in the GUI due to changes in Matplotlib 3.11, in by Austin E. Soplata and Claude in #1320.
Fixed caret coloring and pixel shifting when opening or closing the GUI log window, by Dylan Daniels in #1318.
Fixed stray scrollbars appearing on empty GUI dropdowns in Safari, by Sourav Rajvi in #1360, fixing #1321. This was their first PR, thanks Sourav!
Fixed broken behavior with “simulation data” / “experimental data” visualization dropdown bug, and refactor some related code, by Sourav Rajvi in #1394, fixing #1389.
Fixed crash from when
add_spike_train_driveuses spikes that are not sorted, by Austin E. Soplata in #1400, identified by Sourav Rajvi.
Miscellaneous Changelog#
For the published stable
1.0.0version, all user-facing dependencies now have maximum version caps, in order to prevent future dependency updates from breaking this release. Additionally,notebookis now a base dependency, so that anyone installinghnn-corecan easily run our Textbook’s Jupyter notebooks using the standardjupyter notebook <file.ipynb>command, in #1385, fixing #1384.Cell metadata is now used around the codebase much more cleanly. Additionally, each cell type’s
cell_metadatanow includes a defaultcolorandmarker, which are used by our visualization functions (e.g. spike raster and histogram plots) instead of hardcoded values, by Chetan Kandpal in #1269.Improvements to some visualization documentation, by Arnesh Banerjee in #1332. This was their first PR, thanks Arnesh!
Easier optimization custom function usage by Vaishnavi Baghel in #1271.
Improve y-axis labels (depth units) and ticks of LFP and CSD plotting, by Shivansh Bhageria in #1191. This was their first PR, thanks Shivansh!
The GUI’s data management has been completely overhauled. Simulation data and loaded experimental data are now kept separate and managed through a single, centralized data store object instead of being passed around between many functions, by Camilo Diaz in #1328.
os.pathusage throughout the codebase has been migrated topathlib, by Satvik Saluja in #1311.The Network fixtures used in our tests have been expanded and consolidated so that all network models can be tested consistently, including the new Duecker model, by Satvik Saluja and Austin E. Soplata in #1257.
test_viz.pyhas been refactored into smaller, more focused tests, by Camilo Diaz in #1350.Added “progressive” installation tests to our CI, which check that the minimal (no
extras), then[opt], then[gui]installations each work before running the full test suite, in #1304.Miscellaneous CI, documentation, testing/development config, and website maintenance in #1305, #1310, #1326, #1333, #1342, #1344, #1351, #1361, #1365, #1368, and #1372.
People who contributed to this release:#
0.6.1 Patch Release Notes#
This is an emergency patch release to fix an install misconfiguration (see #1302).
Recent changes to Optimizer from the new CMA optimization solver require joblib to
be installed for any Optimization to be run. Since joblib is a required dependency of
scikit-learn, installing with pip install "hnn-core[opt]" is sufficient, even
though [opt] installs some, but not all, of HNN-Core’s [parallel] install extras,
which are joblib and psutil.
Relatedly, since the GUI can now support optimization, its installation now requires
the [opt] packages to be installed as well. This has been fixed.
For the greater release notes that document what has been added since 0.5.0, including important upcoming deprecations, see our Release Notes for 0.6.0 here.
0.6.0 Release Notes#
Important Deprecations#
jones_2009_modelhas been renamed toneymotin_2020_modelto better reflect its provenance. From now on,neymotin_2020_modelis the recommended “default” model we will be documenting and using going forward. However, for backwards compatibility,jones_2009_modelwill still be retained as a simple “wrapper function” aroundneymotin_2020_model, the latter being otherwise identical to the oldjones_2009_modelbehavior. We recommend you update your scripts to useneymotin_2020_model, butjones_2009_modelwill still continue to work.IMPORTANT: For the default model
neymotin_2020_model(renamed fromjones_2009_model, see above), in the NEXT release (i.e. 0.7.0), some parameters will be slightly changed, which will cause your simulations to produce slightly different output. Again, this is only expected in the next major release, not this one. This is necessary in order to fix certain parameters (e.g. synaptic delays) which are slightly different than their values in the “Original HNN” code. Using the new parameters, simulation results are expected to only be quantitatively different, but not qualitatively different, and these changes are not expected to change the significance of simulation results.
New Features#
When installing
hnn-corethroughpip, there is now an easy way to install all extra dependencies (excluding development packages):pip install "hnn-core[all]". This installs the necessary dependencies for the GUI, Optimization, and parallelism (excluding MPI itself, which you can find how to install at our Installation Guide).Major visual refresh and polishing of the GUI by Dylan Daniels in #1243.
Nick Tolley has added Optimization support for both the “Covariance matrix adaptation evolutionary strategy” (CMA-ES) solver and correlation-coefficient as an objective function, in #1221 and #1286! CMA-ES is a very powerful optimization option which can simulate multiple samples in a single epoch, and may possibly become the default optimization solver in the future.
The GUI now includes an Optimization tab that can run optimization against any parameter in the
Network’s drives, using any of the available built-in solvers or objective functions, including the new CMA-ES solver (see above). By Austin E. Soplata and Nick Tolley in #1190.
Bug Fixes#
Accessibility of all HNN websites (excluding auto-generated Jupyter notebook output) has been fixed to prevent basic accessibility errors, by Joyce Gao and Austin E. Soplata in several PRs including #1280, #1293, https://github.com/jonescompneurolab/textbook/pull/153 , and https://github.com/GitHub-at-Brown/hnn-front-website/pull/56 .
The COBYLA Optimization solver now returns the
Networkwith the best-performing parameters instead of simply returning the parameters of the final iteration that was run, by Carolina Fernandez Pujol, Nick Tolley, and Austin E. Soplata in #1240.GUI dataset dropdowns have been fixed so that they show what is displayed in the plot, by Tushar Jamdade in #1223.
When loading a network using the GUI, sometimes there would arise a
KeyErrordue to a lack ofn_trialsvalue. This has been fixed by Tushar Jamdade in #1216.Read-in of Network JSON files with custom
cell_typesorpos_dictentries has been fixed in #1195.
Public API Changes#
jones_2009_model, the main function to spawn the default model, has been replaced withneymotin_2020_model(see note above in ‘Important Deprecations’).jones_2009_modelwill still continue to work, but users should migrate to the new name for the function. Done in #1290.simulate_dipolenow has averboseflag to control how much output is printed, by Anna Cattani in #1228. This was their first PR, thanks Anna!Sectioncan now consume anv0argument in order to set the initial voltage of the membrane potential for that section. Merged in #1185, adapted from work by Katharina Duecker.BatchSimulateis now properly documented via our public API, thanks to M Yaswanth Reddy in #1218.
People who contributed to this release:#
Changelog#
Where possible, all remaining imports have been moved to the top of source files, by Percival Villalva in #1285.
In the GUI, when comparing two datasets, both the RMSE and the correlation values are now displayed on the plot instead of just the RMSE, by Nick Tolley and Austin E. Soplata in #1298.
Javascript and CSS files in the repository are now included in the Python packaging, in #1292.
Enable MacOS Intel-CPU runners in CI, by Vaishnavi Baghel in #1287.
Update and re-enable Codecov usage in CI, by Vaishnavi Baghel in #1272. This was their first PR, thanks Vaishnavi!
We have removed the Gitter badge on our repository’s homepage (in #1270) in order to push people towards the Github Discussions page.
Test coverage of Hamming smoothing via
hnn_core.utils.smooth_waveformhas been improved, by Satvik Saluja in #1266.The
issue-metricsGithub Action workflow has been removed (in #1279) entirely in favor of https://github.com/jonescompneurolab/hnn-tracking/pull/1 .Fix testing of
mesh_shapeto include all available network models, by Satvik Saluja in #1268. This was their first PR, thanks Satvik!Improve UX of GUI’s “Delete all drives” button and small refactors of GUI codebase. By Muhammad Ahmad Amin in #1245. This was their first PR, thanks Muhammad!
In the GUI, when simulating multiple trials and plotting the spectrogram, use the averaged Time-Frequency-Representation of the dipoles for spectrogram calculation instead of only the first dipole, by M Yaswanth Reddy in #1233. This was their first PR, thanks Yaswanth!
The repository’s AI policy has been clarified in #1224.
Issue templates are now used in the
hnn_corerepository.In the GUI, new simulations are now auto-renamed. This fixes an annoying issue with the GUI where every time a user wanted to run a new simulation, they had to go back to the Simulation tab and manually change the simulation name. Now, whenever they run a new simulation without changing the name manually, the new simulation will use the old name, but with a reasonable number appended. By Tushar Jamdade in #1213.
Add support for printing a welcome message that asks the user to fill out the HNN survey, which is printed to the standard output after (and only after) the first time the
hnn_coremodule is imported. Whether or not the message is displayed is determined by the presence of a new file created in the module after first run. by Karthikeya Kodlai in #1158. This was their first PR, thanks Karthikeya!Add progressive minimal install and test to Github Actions, by Tushar Jamdade in #1214. This was their first PR, thanks Tushar!
0.5.0 Release Notes#
New Features#
You can now provide custom spike trains as inputs into your simulation; see the description of
add_spike_train_drive()below in the Public API Changes section.
Deprecations#
Similar to NEURON, we have dropped support for Python 3.8. We have also added support for Python 3.13.
Bug Fixes#
Synaptic
gainandthresholdvalues are now loaded correctly when reading in aNetworkJSON file, instead of being overridden with default values, by George Dang and Austin E. Soplata in #918.
Public API Changes#
Synaptic gains can now be set and retrieved for different “global” connection types (excitatory-to-excitatory, excitatory-to-inhibitory, inhibitory-to-excitatory, and inhibitory-to-inhibitory) using
set_global_synaptic_gains()(formerly calledNetwork.update_weights) andget_global_synaptic_gains(). The GUI now includes widgets for modifying synaptic gains in the Connectivity interface, both on a “global” level and on an individual level. The additive combination of global and individual gains is also always shown in the GUI. Importantly, all of the synaptic gain getters and setters across both the GUI and API do not change or reflect the gains of drives. They only change or reflect non-drive connections.add_connection()now accepts optionalthresholdandgainarguments for setting connection-specific firing thresholds and synaptic gain values.Optimizernow accepts user-defined initial weights in the form of optional argumentinitial_paramsand allows the user to set the number of trials by passingn_trialstofit(), by Carolina Fernandez Pujol in #1057.The
cell_typesattribute and initializer argument ofNetworkhas significantly changed. Previously,Network.cell_typeswas a dictionary where keys were cell-type names and values wereCellinstances of that cell-type to be used as templates for building the Network. Now, the structure of dictionary is different:Network.cell_typesis a dictionary where keys are cell-type names and values are child-dictionaries. The child-dictionaries of each cell-type have the following keys:cell_objectandcell_metadata. The value ofNetwork.cell_types[<cell_type>]["cell_object"]is theCellinstance for that cell-type, similar to before. The value ofNetwork.cell_types[<cell_type>]["cell_metadata"]is a new dictionary containing several key-values pairs that describe different aspects of the cell type, described below:morpho_type: eitherbasketorpyramidalelectro_type: eitherinhibitoryorexcitatorylayer: either2or5measure_dipole: either True or Falsereference: optional
You can find a working version of
Network.cell_typesfor the default Jones 2009 model here as an example: jonescompneurolab/hnn-core . The author for this was Chetan Kandpal in #1099. Others who helped with design were Dylan Daniels, Katharina Duecker, Austin E. Soplata, and Nick Tolley.The newer Network object and file input/output module,
hnn_io, is now published as part of the Public API. The recommended way to write aNetworkobject iswrite_network_configuration(), and the recommended way to read the same isread_network_configuration(). By Austin E. Soplata in #1108.Networknow has support for calculating a “layer dictionary”layer_dictattribute whose layers can be mapped as desired to an object’scell_typesattribute. This mapping can then be used to make a more flexible position dictionarypos_dictattribute of the object. This also adds support for optionalpos_dictandcell_typesarguments to theNetworkconstructor. This also begins the process of moving some model-specific celltype-usage fromnetwork.pytonetwork_models.py. By Chetan Kandpal in #1095.Networknow has a new type of available “external drive”, the “spike train” drive, which you can add usingadd_spike_train_drive(). This new drive can take in spike data in various formats (see its docstring), including spikes generated by previous HNN simulations, and then “replay” the spike trains as inputs into the current simulation. This offers a large degree of control over both the data of the spike trains and how you want to connect them to your simulation. There is a new example script here which illustrates its use. By Maira Usman in #1064.
People who contributed to this release:#
Changelog#
Add methods
set_global_synaptic_gains()andget_global_synaptic_gains()to modify and retrieve synaptic gains for different cell type connections in the network. Add GUI support for modifying synaptic gains with interactive widgets in the connectivity interface, for both individual connections and “global” connections (for example, “excitatory-to-excitatory”). Addgainandthresholdparameters toadd_connection()to allow connection-specific control of synaptic gains and firing thresholds. There is also now a warning displayed when a user loads aNetworkJSON file that has inconsistent synaptic gains, since bothset_global_synaptic_gains()andget_global_synaptic_gains()assume that gains are uniformly equal within each “global” connection type. By George Dang and Austin E. Soplata in #918.Enhance the optimization workflow for more reliable parameter fitting. This includes adding support for user-defined initial weights. For optimal results, we now recommend setting
initial_paramsto hand-tuned values since they often provide a good starting fit. The default objective function (_rmse_evoked()) now averages results over 3 dipoles rather than simulating a single dipole, with the option to control this behavior by setting then_trialsparameter infit(). To capture the model’s average behavior, it is recommended to setn_trials> 1, as usingn_trials=1may identify parameters that work well for one simulation run but perform poorly on average. The optimization example has also been enhanced with improved markdown and updated contents to better illustrate best practices. By Carolina Fernandez Pujol in #1057.Tiny bugfix for the #1099 to enable backwards-compatibility, by Austin E. Soplata in #1119.
Major upgrade to celltype metadata and
cell_typesinNetwork, see the description above in Public API Changes for details, By Chetan Kandpal in #1099.Added
hnn_ioto the Public API by Austin E. Soplata in #1108.Some time allowances for “MPI Timeout” errors were doubled. The infamous “MPI Timeout Error” should occur less frequently now, though this is only a temporary, incomplete solution to #774. By Austin E. Soplata in #1102.
Reduction of old “short name vs long name” usage (Chetan Chunk 1.5), By Chetan Kandpal in #1103.
Add support for
Networkto calculate a more flexible “layer dictionary” that can be used to construct yourNetwork’spos_dict, and add its use in our existingnetwork_models.py. This is the first in a series of code changes meant to allow for more flexible cell types to be used. By Chetan Kandpal in #1095.Introduce new “spike_train” drive to
Networkby Maira Usman in #1064.Various development-process and documentation changes by Austin E. Soplata in #1081, #1086, #1090, #1083, #1069, #1107, #1100, #1114, and #1126.
Drop Python 3.8 support, add Python 3.13 support by Austin E. Soplata in #1070.
0.4.3 Patch Notes#
This is an emergency patch release to fix a dependency issue.
Bug Fixes#
NEURON version support is restricted to versions 7.7 through 8.2.7 (including those versions). Going forward, the maximum NEURON version supported will be set explicitly in our install configuration, so that new, incompatible versions of NEURON are not used before testing. by Austin E. Soplata in #1153.
People who contributed to this release:#
0.4.2 Patch Notes#
Version 0.4.2 is a patch release that fixes two important bugs: one affecting LFP and CSD output (#1062) and another preventing users from upgrading to the recently released NEURON 8.2.7 (#1058), which also enables use of HNN-Core with Python 3.13. This also includes other, smaller bug fixes and changes.
If you have been using HNN-Core to simulate LFP or CSD output, we strongly recommend you update to this version.
We have also recently overhauled our HNN Frontpage and our new HNN Textbook website, so check them out!
New Features#
We now provide
condapackages that offer significantly easier installation of HNN-Core, including an option with all features included (including MPI!). See our Installation Guide for how to install them.We now support Python 3.13, in addition to previously supported Python versions.
Upcoming Deprecations#
In the next minor release (0.5.x), we will be dropping Python 3.8 support for two reasons:
It has reached “end-of-life” and is no longer supported, including NOT receiving any future security upgrades (see https://devguide.python.org/versions/).
NEURON 8.2.7 has dropped support for Python 3.8.
If you expect that you will still require hnn_core using Python 3.8, please reach out to us on our Github Discussions page. We will likely be able to continue supporting your use-case.
Bug Fixes#
Major bugfix: Cell positions were previously starting at origin (incorrect) instead of origin + their
pos_dictlocations (correct). This has been fixed. This change should not affect results from dipole or single-cell output, but will affect results from LFP or CSD output. Identified and fixed by Katharina Duecker in #1062.hnn_core/viz.py::plot_spikes_raster()now correctly titles the plot according to if dipoles are overlaid or not, by Dylan Daniels in #1074.Update
hnn_core/mod/vecevent.modto a newer version from NEURON’s source code, enabling use of NEURON’s latest version (8.2.7) and Python’s latest stable version (3.13). The prior version of this file would not correctly compile on Windows using NEURON 8.2.7. By Austin E. Soplata in #1058.Fix test breakage caused by upstream dependency change in
scipy.optimize, by Austin E. Soplata in #1076.
Development Workflow Changes#
hnn_corecode now follows the defaultruffcode formatting style, and all new contributions are expected to follow this style as well. Fortunately, there is a single command that developers need to run which automatically format their code appropriately (make format-overwrite), see the new Quality Control section of our Contributing Guide for details.Updates to Linkcheck Workflow frequency so it only runs on every merge to
masterand on the 1st and 15th of every month, by Maira Usman in #1043 (new contributor!!!).Concurrency in Github Actions is now utilized: if you push a new commit to your existing PR branch while prior workflows are still running, the prior workflows are canceled (#1015).
You can now build and deploy new package distributions of
hnn_coredirectly from Github to Pypi and TestPypi by pushed any new tag that begins withv(#1073 and #1077). Documentation for how to make a release has not been updated yet, but will be soon.When a developer needs to update parameters of the “default model” used in HNN, there is now both documentation and commands to help guide them. See the new “Making changes to the default network” section of our Contributing Guide (#1068).
API Changes#
:class:
~hnn_core.CellResponsenow requires acell_type_namesargument, whereas before the argument was optional (#970).hnn_core/optimization/optimized_evoked.py::optimized_evokednow enforces a minimum number of iterations, twelve (12). This is a temporary, possibly permanent, fix introduced in #1076.
People who contributed to this release (in alphabetical order of family name):#
Changelog#
Fix tiny typo in
pipMPI install documentation, by Austin E. Soplata in #1072. (he’s also responsible for the original typo…)Update the Linux path of our Unix unit tests to use
condafor its MPI installation, NOT system packages. This makes our unit tests consistent with our recently-changed recommended installation pathways forpipMPI on Linux. By Austin E. Soplata in #1071.Tiny docstring update to
jones_2009_modelthat the “model” is from the Jones 2009 paper, but the “implementation” is from Neymotin 2020. Citations for both papers are included in the docstring. By Austin E. Soplata in #1056.Added support for “regeneration” of both required hierarchical JSON network files alongside documentation, by Austin E. Soplata in #1068.
Enable automated package release building and deployment via Github Actions to Pypi and TestPypi, by Austin E. Soplata in #1073 and hotfix in #1077.
Version downgraded from 0.5.0dev0 to 0.4.2.devX in preparation for this release (no PR).
Fix test breakage caused by upstream dependency change in
scipy.optimize, by Austin E. Soplata in #1076.hnn_core/viz.py::plot_spikes_raster()now correctly titles the plot according to if dipoles are overlaid or not, by Dylan Daniels in #1074.Update
hnn_core/mod/vecevent.modto a newer version from NEURON’s source code, enabling use of NEURON’s latest version (8.2.7) and Python’s latest stable version (3.13), by Austin E. Soplata in #1058.Introduce concurrency controls to Github Actions, by Maira Usman in #1015.
Major bugfix: Cell positions were previously starting at origin (incorrect) instead of origin + their
pos_dictlocations (correct). This has been fixed. This change should not affect results from dipole or single-cell output, but will affect results from LFP or CSD output. Identified and fixed by Katharina Duecker in #1062.Updates to Linkcheck Workflow frequency so it only runs on every merge to
masterand on the 1st and 15th of every month, by Maira Usman in #1043 (new contributor!!!).Miscellaneous link updates/fixes needed due to our overhaul of our HNN Frontpage and our new HNN Textbook website, by Austin E. Soplata in #1055, #1059, #1063, and #1067.
Add support for
ruff format, merge changes taken from running it, and require its use for new code contributions, by Austin E. Soplata in #934.Add
condapackage installation instructions, by Austin E. Soplata in #1051.Add and update “Cloud” usage instructions on install page to redirect to our new Textbook website, by Austin E. Soplata in #1046 and #1048.
Remove hardcoding of celltypes in :class:
~hnn_core.CellResponseand addrename_cell(), by Mohamed W. ElSayed in #702 and #970.
0.4.1 Patch Notes#
Version 0.4.1 is a bug-fixing patch release for version 0.4. This includes changes to importing of
BatchSimulatedue to previously-undetected install/import issues (#1034), configuration of packaging metadata format (same PR), and elimination of a discrepancy in our method of cleaning local compiled files that led to architecture-specific files being included in the Pypi 0.4 release, which caused simulations on some platforms to fail (#1035). The public Pypi version has already been updated to 0.4.1.
0.4 Release Notes#
v0.4 represents a major milestone in development of hnn_core and the HNN ecosystem as a whole. v0.4 includes over two years of active development work by many people (>800 commits!), and brings with it many new and exciting features, including significant improvements to robustness, testing, and bug-fixing.
New Features#
hnn_corenow includes a fully-tested and robust GUI of its own. Thehnn_coreGUI 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 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 usinghnn-guiin your terminal/command prompt window.The
BatchSimulateclass: 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. Note that currently, only itslokybackend is supported, and the"hnn-core[parallel]"dependencies must be installed for it to be used.Significant improvements to the API, documentation, and pedagogical examples especially for Optimization, among others.
Calcium concentration can now be recorded: recorded calcium concentration from either the soma, or all sections, are enabled by setting
record_catosomaorallinsimulate_dipole(). Recordings are accessed throughca.There is now a new class
NetworkPlotterwhich can be used to visualize an entire network in 3D, including firing animations; see our example of how to use it here.There is now a new function
plot_drive_strength()for illustrating the absolute or relative amount of strength that a particular drive provides to different cell types.A very large amount of polishing, bug fixes, general improvements, etc.
Deprecations#
The new Python 3.13 is not supported by
hnn_coreat this time, due to NEURON’s current lack of support for it. This will change in the near future. We still support 3.8 through 3.12 (inclusively).
Upcoming Deprecations#
Both
plot_laminar_lfp()andplot_dipole()will have theirtminandtmaxarguments removed in the future. Please set the x-axis limits using methods called directly on the existingmatplotlibobjects, or usingmatplotlib.pyplot.xlim.Network’s argument oflegacy_modefor importing old param files will be removed in the future.add_tonic_bias()’s argument ofcell_type, along with setting the argumentamplitudeto a single float, will be removed in the future. Instead, set theamplitudeargument to a dictionary as described in the docstring.simulate_dipole()’s argument ofpostprocfor post-processing will be removed in the future. Instead, use explicit smoothing and scaling viaDipolemethods.
API Changes#
New argument to
Networkinitialization: you can now setmesh_shapeto easily make a grid of different sizes ofNetworks.Cellinitialization argumenttopologyhas had both its name changed tocell_treeand its data type significantly changed; see the API docs ofCellfor details.jones_2009_model()and other built-in Network Models includinglaw_2021_model()andcalcium_model()all accept the aforementionedmesh_shapeargument likeNetwork.The API for optimization has changed significantly. Instead of running the function
optimize_evokedobtained usingfrom hnn_core.optimization import optimize_evoked, you should use the newOptimizerclass and its methods; see our example of evoked-response optimization here.plot_spikes_hist()now accepts more arguments, includinginvert_spike_types,color, and any**kwargs_histwhich can be applied tomatplotlib.axes.Axes.hist. See the docstring for details.plot_spikes_raster()now accepts many more arguments, includingcell_types,colors,show_legend,marker_size,dpl, andoverlay_dipoles. See the docstring for details.plot_cell_morphology()now accepts more arguments, includingcolorand several arguments related to its position and viewing window, includingpos,xlim,ylim, andzlim. See the docstring for details.plot_laminar_csd()now accepts more arguments, includingvmin,vmax,sink, andinterpolation. See the docstring for details.MPIBackendnow accepts many more arguments, includinguse_hwthreading_if_found,sensible_default_cores,override_hwthreading_option, andoverride_oversubscribe_option. See the docstring for details; the ability to customize it has been greatly increased.read_params()now accepts a new argumentfile_contentswhich lets you pass in network configuration contents using a string.
People who contributed to this release (in alphabetical order of family name):#
PRs merged (API)#
Add ability to manually define colors in spike histogram plots, by Nick Tolley in #640
Connection
'src_gids'and'target_gids'are now stored as set objects instead of lists, by Ryan Thorpe in #642write()andread_spikes()now support hdf5 format for read/write Cell response object, by Rajat Partani in #644 (Note: this work was later reverted in #654)Add ability to customize plot colors for each cell section in
plot_morphology(), by Nick Tolley in #646write()andread_dipoles()now support hdf5 format for read/write Dipole object, by Rajat Partani in #648Added
NetworkPlotterto visualize and animate network simulations, by Nick Tolley in #649Add ability to optimize parameters associated with evoked drives and plot convergence. User can constrain parameter ranges and specify solver, by Carolina Fernandez Pujol in #652
CellResponse()no longer supports reading and writing to hdf5, by Rajat Partani and Nick Tolley, in #654Add ability to optimize parameters associated with rhythmic drives, by Carolina Fernandez Pujol in #673
Add initial support for
Networkread and write of hdf5 files by George Dang in #704 (Note: this work was later obviated by #756)Add ability to specify number of cells in
Network, by Nick Tolley in #705Added kwargs options to
plot_spikes_histfor adjusting the histogram plots of spiking activity, by Abdul Samad Siddiqui in #732Updated
plot_spikes_rasterlogic to include all neurons in network model. Removed GUI exclusion from build, by Abdul Samad Siddiqui in #754Add initial work on hierarchical json format in place of hdf5, by George Dang in #763
network.add_tonic_bias()cell-specific tonic bias can now be provided using the argument amplitude innetwork.add_tonic_bias(), by Camilo Diaz in #766plot_lfp(),plot_dipole(),plot_spikes_hist(), andplot_spikes_raster()now plotted from 0 to tstop. Inputs tmin and tmax are deprecated, by Katharina Duecker in #769Add function
convert_to_json()to convert legacy param and json files to new json format, by George Dang in #772Add
BatchSimulateclass for batch simulation capability, by Abdul Samad Siddiqui in #782Recorded calcium concentration from the soma, as well as all sections, are enabled by setting
record_catosomaorallinsimulate_dipole(). Recordings are accessed throughca, by Katharina Duecker in #804Added features to
plot_csd(): to set color of sinks and sources, range of the colormap, and interpolation method to smoothen CSD plot, by Katharina Duecker in #815Refactor and improve documentation for
BatchSimulate, including a tutorial by Abdul Samad Siddiqui in #830 and #857Add argument to change colors of
plot_spikes_raster, shortened line lengths to prevent overlap, and added an argument for custom cell types, by George Dang in #895Add method to
Networkto modify synaptic gains, by Nick Tolley and George Dang in #897Add
spike_times_by_type()to get cell spiking times organized by cell type, by Mainak Jas in #916Add option to apply a tonic bias to any compartment of the cell, and option to add multiple biases per simulation and cell
hnn_core.network.add_tonic_bias(), by Katharina Duecker in #922Add plots to show relative and absolute external drive strength, by Dikshant Jha in #987
Make re-generation of our testing network usable and explicit, by Austin E. Soplata in #988
Improvements to raster plotting, by Dylan Daniels in #1017 and #1018
PRs merged (Bug fixes and corrections)#
Objective function called by
optimize_evoked()now returns a scalar instead of tuple, by Ryan Thorpe in #670Fix error message for drive addition, by Tianqi Cheng in #681
Fix GUI plotting bug due to deprecation of matplotlib color cycling method, by George Dang in #695
Typo fix, by George Dang in #707
Fix GUI dipole plot scale and smooth factors, by Camilo Diaz in #730
Fix file upload widget, by Camilo Diaz in #736
Fix bug in
pick_connection()where connections are returned for cases when there should be no valid matches, by George Dang in #739Fix GUI figure annotation overlap in multiple sub-plots, by Camilo Diaz in #741
Various CI updates and fixes, by George Dang in #758
Fix GUI load data button size, by Camilo Diaz in #775
Fix typos, by George Dang in #777
Fix CI Linux conda bug, by Camilo Diaz in #794
Fix loading of drives in the GUI: drives are now overwritten instead of updated, by Mainak Jas in #795
Use
np.isin()in place ofnp.in1d()to address numpy deprecation, by Nick Tolley in #799Fix unit tests for Python 3.11 and 3.12, by Camilo Diaz in #800
Fix README badge URL, by Camilo Diaz in #802
Fix NEURON download link, by Camilo Diaz in #803
Fix clearance of drive connections by network config read, by George Dang in #807
Fixes for Binder notebook usage, by Mainak Jas in #809, #820, and #822
Fix drive seeding so that event times are unique across multiple trials, by Nick Tolley in #810
Fix bug in
clear_drives()where network object are not accurately updated, by Nick Tolley in #812Fix bug in
add_poisson_drive()where an error is thrown when passing a float for rate_constant whencell_specific=False, by Dylan Daniels in #814Fix bug in
add_poisson_drive()where an error is thrown when passing an int for rate_constant whencell_specific=True, by Dylan Daniels in #818Fix homepage links, by Dylan Daniels in #819
Fix GUI simulations dropdown, by Camilo Diaz in #825 and #827
Fix argument pass during conversion of network config file to
Network, by George Dang in #834Fix GUI visualization, by Camilo Diaz in #836
Fix GUI probability assignment, by George Dang in #844
Fix GUI unnecessary display call, by George Dang in #845
Fix GUI drive sorting, by George Dang in #851
Fix persistent linkcheck failure, by George Dang in #854
Fix GUI MPI test, by George Dang in #868
Fix GUI over-plotting of loaded data where the app stalled and did not plot RMSE, by George Dang in #869
Fix GUI MPI cores, by George Dang in #871
Fix GUI output log, by George Dang in #873
Fix MPIBackend platform logic, by George Dang in #876
Fix scaling and smoothing of loaded data dipoles to the GUI, by George Dang in #892
Fix minor GUI glitches, by George Dang in #899
Fix GUI synapses properties rendering, by George Dang in #913
Fix accidental removal of second axis object in GUI by Austin E. Soplata in #929
Fix statistical Poisson drive tests that were failing stochastically by Austin E. Soplata in #978
Copy template for monthly metrics workflow, in the hope it will fix the unsuccessful runs by Austin E. Soplata in #983
Hotfix of MPI install on MacOS CI runners by Austin E. Soplata in #994
Fix MPI test failures probably due to incomplete Network destruction by Austin E. Soplata in #1010
PRs merged (GUI changes)#
Add RMSE calculation and plotting to GUI, by Huzi Cheng in #636
Update GUI to use ipywidgets v8.0.0+ API, by George Dang in #696
Add GUI visualization testing, by Abdul Samad Siddiqui in #726
Add pre defined plot sets for simulated data in GUI, by Camilo Diaz in #746
Add GUI widget to enable/disable synchronous input in simulations, by Camilo Diaz in #750
Add GUI widgets to save simulation as csv and updated the file upload to support csv data, by Camilo Diaz in #753
Refactor GUI tests, by George Dang in #765
Refactor GUI import of
_read_dipole_textfunction, by George Dang in #771Add GUI feature to include Tonic input drives in simulations, by Camilo Diaz #773
Add GUI feature to read and modify cell parameters, by Camilo Diaz in #806
Refactor GUI
read_network_configuration, by George Dang in #833Change the configuration/parameter file format support of the GUI. Loading of connectivity and drives use a new multi-level json structure that mirrors the structure of the Network object. Flat parameter and json configuration files are no longer supported by the GUI, by George Dang in #837
GUI load confirmation message, by George Dang in #846
Differentiate L5/L2 Pyr geometry options in GUI, by Nick Tolley in #848
Updated the GUI load drive widget to be able to load tonic biases from a network configuration file. George Dang in #852
Update GUI initialization of network, by George Dang in #853
Update GUI color, by Nick Tolley in #855
Added “No. Drive Cells” input widget to the GUI and changed the “Synchronous Input” checkbox to “Cell-Specific” to align with the API George Dang in #861
Add GUI export of configurations, George Dang in #862
Add screenshot of GUI to README, George Dang in #865 and #866
Add button to delete a single drive on GUI drive windows, by George Dang in #890
Add post-processing for GUI figures, by George Dang in #893
Add minimum spectral frequency widget to GUI for adjusting spectrogram frequency axis, by George Dang in #894
Update GUI to display “L2/3”, by Austin E. Soplata in #904
Update PSD plot in GUI to use plot config provided frequencies instead of hard-coded values, by Dylan Daniels in #914
Flip drives in input histogram based on position in GUI by Dylan Daniels in #923
Add GUI widget to adjust default smoothing value, by Dylan Daniels in #924
Change Morlet cycles divisor for better alpha spectral plotting by Austin E. Soplata in #928
Add GUI log error message if spectral arguments are invalid by Austin E. Soplata in #944
Move GUI log messages to bottom of output by George Dang in #946
Add GUI frequency default visualization parameters and many other smaller visual changes by Dylan Daniels in #952
Capture printed messages to logger in GUI by Dylan Daniels in #956
Correctly set layer-specific dipole axes limits in GUI, by Dylan Daniels in #1022
Improve spike raster plot by overlaying dipoles, by Dylan Daniels in #1026
PRs merged (Other)#
Add Github Discussions installation template, by Mainak Jas in #630
Replace NEURON functions like
define_shape()anddistance()with Python equivalent, by Rajat Partani in #661Cleaned up internal logic in
CellResponse, by Nick Tolley in #647Add section for JOSS to Readme, by Ryan Thorpe in #677
Update minimum supported version of Python to 3.8, by Ryan Thorpe in #678
Add support for
codespellchecking, by Yaroslav Halchenko in #692Add citation info to repository, by Ryan Thorpe in #700
Add dependency groups to setup.py and update CI workflows to reference dependency groups, by George Dang in #703
Rename io to hnn_io, by George Dang in #727
Expand gitignore to virtual environment directories, by Abdul Samad Siddiqui in #740
Add check for invalid Axes object in
plot_cells()function, by Abdul Samad Siddiqui in #744Refactor pick connection tests, by George Dang in #745
Add governance structure and similar changes, by Dylan Daniels in #785
Add issue metrics Github Action #790 and associated cron job #793, by Nick Tolley
Remove nbsphinx and pandoc usage, by Nick Tolley in #813
Remove nulled drives during convert to hierarchical json function, by George Dang in #821
Speedup optimization tests, by Nick Tolley in #839
Add GSoC 2024 acknowledgement, by Abdul Samad Siddiqui in #874
Remove deprecated
distutilsimport, by George Dang in #880Refactor
Network’s__eq__equivalency function, by George Dang in #902Add automatic spectrogram frequency range reversal, by Abdul Samad Siddiqui in #903
Flip drives in input histogram based on position, by Dylan Daniels in #905
Change default smoothing for dipoles to be 0 (only in GUI), by George Dang in #920
Add support for parallelizing tests by Austin E. Soplata in #932
Replace
flake8linting withruff checklinting by Austin E. Soplata in #961Add
Makefilecleanup of arm64-generated files by Austin E. Soplata in #964Change Sphinx theme, fixing javascript bugs with code-website, and fix some small typos by Austin E. Soplata in #971
Replace most ReStructured Text of code-website with Markdown by Austin E. Soplata in #973
Add install and run of
codespellto local testing by Austin E. Soplata in #977Separate Installation to its own page, also other small authoring changes by Austin E. Soplata in #980
Update Sphinx
versions.jsonlink to point todevversion, by Austin E. Soplata in #991Add docstring to
_add_cell_type_biasby Shehroz Kashif in #1001
0.3#
Changelog#
Add option to select drives using argument ‘which_drives’ in
optimize_evoked(), by Mohamed A. Sherif in #478Changed
conn_seeddefault toNone(from3) inadd_connection(), by Mattan Pelah in #492.Add interface to modify attributes of sections in
modify_section(), by Nick Tolley in #481Add ability to target specific sections when adding drives or connections, by Nick Tolley in #419
Runtime output messages now specify the trial with which each simulation time checkpoint belongs too, by Ryan Thorpe in #546.
Add warning if network drives are not loaded, by Orsolya Beatrix Kolozsvari in #516
Add ability to record voltages and synaptic currents from all sections in
CellResponse, by Nick Tolley in #502.Add ability to return unweighted RMSE for each optimization iteration in
optimize_evoked(), by Kaisu Lankinen in #610.
Bug#
Fix bugs in drives API to enable: rate constant argument as float; evoked drive with connection probability, by Nick Tolley in #458
Allow regular strings as filenames in
write()by Mainak Jas in #456.Fix to make network output independent of the order in which drives are added to the network by making the seed of the random process generating spike times in drives use the offset of the gid with respect to the first gid in the population by Mainak Jas in #462.
Negative
event_seedis no longer allowed by Mainak Jas in #462.Evoked drive optimization no longer assigns a default timing sigma value to a drive if it is not already specified, by Ryan Thorpe in #446.
Subsets of trials can be indexed when using
plot_spikes_raster()andplot_spikes_hist(), by Nick Tolley in #472.Add option to plot the averaged dipole in
plot_dipole()whendplis a list of dipoles, by Huzi Cheng in #475.Fix bug where
plot_morphology()did not accurately reflect the shape of the cell being simulated, by Nick Tolley in #481Fix bug where
pick_connection()did not return an empty list when searching non existing connections, by Nick Tolley in #515Fix bug in
MPIBackendthat caused an MPI runtime error (RuntimeError: MPI simulation failed. Return code: 143), when running a simulation with an oversubscribed MPI session on a reduced network, by Ryan Thorpe in #545.Fix bug where
pick_connection()failed when searching for connections with a list of cell types, by Nick Tolley in #559Fix bug where
add_evoked_drive()failed when adding a drive with just NMDA weights, by Nick Tolley in #611Fix bug where
read_params()failed to create a network when legacy mode is False, by Nick Tolley in #614Fix bug where
plot_dipole()failed to check the instance type of Dipole, by Rajat Partani in #606
API#
Optimization of the evoked drives can be conducted on any
Networktemplate model by passing aNetworkinstance directly intooptimize_evoked(). Simulations run during optimization can now consist of multiple trials over which the simulated dipole is averaged, by Ryan Thorpe in #446.plot_dipole()now supports separate visualizations of different layers, by Huzi Cheng in #479.Current source density (CSD) can now be calculated with
calculate_csd2d()and plotted withplot_csd(). The method for plotting local field potential (LFP) is now found atplot_lfp(), by Steven Brandt and Ryan Thorpe in #517.Recorded voltages/currents from the soma, as well as all sections, are enabled by setting either
record_vsecorrecord_isecto'all'or'soma'insimulate_dipole(). Recordings are now accessed throughvsecandisec, by Nick Tolley in #502.legacy_mode is now set to False by default in all for all
Networkobjects, by Nick Tolley and Ryan Thorpe in #619.
People who contributed to this release (in alphabetical order):#
0.2#
Notable Changes#
Local field potentials can now be recorded during simulations Example
Ability to optimize parameters to reproduce event related potentials from real data Example
Published models using HNN were added and can be loaded via dedicated functions
Several improvements enabling easy modification of connectivity and cell properties Example
Improved visualization including spectral analysis, connectivity, and cell morphology
Changelog#
Store all connectivity information under
connectivitybefore building the network, by Nick Tolley in #276Add new function
plot_cell_morphology()to visualize cell morphology, by Mainak Jas in #319Compute dipole component in z-direction automatically from cell morphology instead of hard coding, by Mainak Jas in #327
Store
Cellinstances inNetwork’scellsattribute by Ryan Thorpe in #321Add probability argument to
add_connection(). Connectivity patterns can also be visualized withplot_connectivity_matrix(), by Nick Tolley in #318Add function to visualize connections originating from individual cells
plot_cell_connectivity(), by Nick Tolley in #339Add method for calculating extracellular potentials using electrode arrays
add_electrode_array()that are stored undernet.rec_arrayas a dictionary ofExtracellularArraycontainers, by Mainak Jas, Nick Tolley and Christopher Bailey in #329Add function to visualize extracellular potentials from laminar array simulations, by Christopher Bailey in #329
Previously published models can now be loaded via
law_2021_model()andjones_2009_model(), by Nick Tolley in #348Add ability to interactivity explore connections in
plot_cell_connectivity()by Mainak Jas in #376Add
calcium_model()with a distance dependent calcium channel conductivity, by Nick Tolley and Sarah Pugliese in #348Each drive spike train sampled through an independent process corresponds to a single artificial drive cell, the number of which users can set when adding drives with
n_drive_cellsandcell_specific, by Ryan Thorpe in #383Add
pick_connection()to query the indices of specific connections inconnectivity, by Nick Tolley in #367Drives in
external_drivesno longer contain a'conn'key and theconnectivitylist contains more items when adding drives from a param file or when in legacy mode, by Ryan Thorpe, Mainak Jas, and Nick Tolley in #369Add
optimize_evoked()to optimize the timing and weights of driving inputs for simulating evoked responses, by Blake Caldwell and Mainak Jas in #77Add method for setting in-plane cell distances and layer separation in the network
set_cell_positions(), by Christopher Bailey in #370External drives API now accepts probability argument for targeting subsets of cells, by Nick Tolley in #416
Bug#
Remove rounding error caused by repositioning of NEURON cell sections, by Mainak Jas and Ryan Thorpe in #314
Fix issue where common drives use the same parameters for all cell types, by Nick Tolley in #350
Fix bug where depth of L5 and L2 cells were swapped, by Christopher Bailey in #352
Fix bug where
average_dipoles()failed when there were less than two dipoles in the input dipole list, by Kenneth Loi in #368Fix bug where
read_spikes()wasn’t returning aCellResponseinstance with updated spike types, by Ryan Thorpe in #382Dipole.timesandCell_response.timesnow reflect the actual integration points instead of the intended times, by Mainak Jas in #397Fix overlapping non-cell-specific drive gid assignment over different ranks in
MPIBackend, by Ryan Thorpe and Mainak Jas in #399Allow
read_dipoles()to read dipole from a file with only two columns (timesanddata), by Mainak Jas in #421
API#
New API for defining cell-cell connections. Custom connections can be added with
add_connection(), by Nick Tolley in #276Remove
L2Pyr,L5Pyr,L2Basket, andL5Basketclasses in favor of instantiation through functions and a more consistentCellclass by Mainak Jas in #322Remove parameter
distributioninadd_bursty_drive(). The distribution is now Gaussian by default, by Mainak Jas in #330New API for accessing and modifying
Cellattributes (e.g., synapse and biophysics parameters) as cells are now instantiated from template cells specified in aNetworkinstance’scell_typesattribute by Ryan Thorpe in #321New API for network creation. The default network is now created with
net = jones_2009_model(params), by Nick Tolley in #318Replace parameter
Twithtstopinadd_tonic_bias()andcreate_tonic_bias()to be more consistent with other functions and improve readability, by Kenneth Loi in #354Deprecated
postprocargument insimulate_dipole(), whereby user should explicitly smooth and scale resulting dipoles, by Christopher Bailey in #372Number of drive cells and their connectivity can now be specified through the
n_drive_cellsandcell_specificarguments inNetwork.add_xxx_drive()methods, replacing use ofrepeatsandsync_within_trial, by Ryan Thorpe in #383Simulation end time and integration time have to be specified now with
tstopanddtinsimulate_dipole(), by Mainak Jas in #397CellResponse.reset()method is not supported any more, by Mainak Jas in #397Target cell types and their connections are created for each drive according to the synaptic weight and delay dictionaries assigned in
Network.add_xxx_drive(), by Ryan Thorpe in #369Cell objects can no longer be accessed from
Networkas thecellsattribute has been removed, by Ryan Thorpe in #436
People who contributed to this release (in alphabetical order):#
0.1#
Changelog#
Add ability to simulate multiple trials in parallel using joblibs, by Mainak Jas in #44
Rhythmic inputs can now be turned off by setting their conductance weights to 0 instead of setting their start times to exceed the simulation stop time, by Ryan Thorpe in #105
Reader for parameter files, by Blake Caldwell in #80
Add plotting of voltage at soma to inspect firing pattern of cells, by Mainak Jas in #86
Add ability to simulate a single trial in parallel across cores using MPI, by Blake Caldwell in #79
Modify
plot_dipole()to accept both lists and individual instances of Dipole object, by Nick Tolley in #145Update
plot_hist_inputtoplot_spikes_hist()which can plot histogram of spikes for any cell type, by Nick Tolley in #157Add function to compute mean spike rates with user specified calculation type, by Nick Tolley and Mainak Jas in #155
Add ability to record somatic voltages from all cells, by Nick Tolley in #190
Add ability to instantiate external feed event times of a network prior to building it, by Christopher Bailey in #191
Add ability to record somatic currents from all cells, by Nick Tolley in #199
Add option to turn off dipole postprocessing, by Carmen Kohl in #188
Add ability to add tonic inputs to cell types with
add_tonic_bias(), by Mainak Jas in #209Modify
plot_spikes_raster()to display individual cells, by Nick Tolley in #231Add
copy()method for cloning aNetworkinstance, by Christopher Bailey in #221Add methods for creating input drives and biases to network:
add_evoked_drive(),add_poisson_drive(),add_bursty_drive()andadd_tonic_bias(), by Christopher Bailey in #221Add functions for plotting power spectral density (
plot_psd()) and Morlet time-frequency representations (plot_tfr_morlet()), by Christopher Bailey in #264Add y-label units (nAm) to all visualization functions involving dipole moments, by Christopher Bailey in #264
Add Savitzky-Golay filtering method
savgol_filter()toDipole; copied frommne-pythonsavgol_filter(), by Christopher Bailey in #264
Bug#
Fix missing autapses in network construction, by Mainak Jas in #50
Fix rhythmic input feed, by Ryan Thorpe in #98
Fix bug introduced into rhythmic input feed and add test, by Christopher Bailey in #102
Fix bug in amplitude of delay (for connection between L2 Basket and Gaussian feed) being passed incorrectly, by Mainak Jas in #146
Connections now cannot be removed by setting the weights to 0., by Mainak Jas and Ryan Thorpe in #162
MPI and Joblib backends now apply jitter across multiple trials identically, by Ryan Thorpe in #171
Fix bug in Poisson input where the first spike was being missed after the start time, by Mainak Jas in #204
Fix bug in network to add empty spike when empty file is read in, by Samika Kanekar and Ryan Thorpe in #207
API#
Make a context manager for Network class, by Mainak Jas and Blake Caldwell in #86
Create Spikes class, add write methods and read functions for Spikes and Dipole classes, by Ryan Thorpe in #96
Only specify
n_jobswhen instantiating the JoblibBackend, by Blake Caldwell in #79Make a context manager for parallel backends (JoblibBackend, MPIBackend), by Blake Caldwell in #79
Add
average_dipoles()function, by Blake Caldwell in #156New API for defining external drives and biases to network. By default, a
Networkis created without drives, which are added using class methods. The argumentadd_drives_from_paramscontrols this behavior, by Christopher Bailey in #221Examples apply random state seeds that reproduce the output of HNN GUI documentation, by Christopher Bailey in #221
Force conversion to nAm (from fAm) for output of
simulate_dipole()regardless ofpostproc-argument, which now only controls parameter file-based smoothing and scaling, by Christopher Bailey in #264