Changelog¶
Version 0.5.2¶
Key Updates:
Added tree path methods for retrieving ordered node sequences in tree graphs. These methods enable path distance calculations between any two nodes by returning the path length. See the tutorial for details.
Refactored path distance calculations in
Section,Point, andSegmentto use the new tree path methods.Updated dependency versions:
neuron >= 9.0.1; removednumpy < 2.0.0constraint.Minor Updates:
Added
pairwise_synaptic_distances()function to the morphometric analysis module. This function uses the new path methods to calculate pairwise distances between synapses, which can be used for analyses such as synaptic clustering.Added
Section.get_location_coordinates()method returning 3D coordinates at a normalized position along a section. AddedSynapse.xyzproperty derived from this, that enables synapse visualization on morphology plots.Added
Node.is_rootcached property (with cache invalidation on parent changes). Replacesnode.parent is Nonechecks for more explicit root identification.Added
Section.domain_rootproperty: traverses toward the root and returns the shallowest ancestor still belonging to the same domain. Replaces thewithin_domainparameter pattern.Updated default parameters in the code generator to use the independent variable from the AST.
Removed
hasattrchecks in parameter setter (replaced with EAFP-stylesetattr).
Version 0.5.1¶
This release includes several minor bug fixes and improvements to MOD file parsing and conversion. It addresses issues #6 and #7.
Minor Updates:
Fixed an issue where the power operator (
^) was not recognized when parsing MOD files.Added a heuristic to the MOD file reader that moves misplaced assigned variables from PARAMETER to ASSIGNED blocks (e.g.,
v (mV)commonly found in PARAMETER blocks).Updated the Jaxley template to properly access calcium concentration for Ca-dependent channels.
Modified code generators to fall back to default parameters in procedure calls, primarily for Jaxley-compatible code generation (e.g.,
compute_kinetic_variables(v)instead ofcompute_kinetic_variables()).
Version 0.5.0¶
Key Updates:
Updated the project license and added SPDX identifiers. See README and LICENSE for details.
Revised the tree-sorting algorithm to achieve deterministic indexing based solely on topology. Removed
_sort_childrenfromSectionTreeandPointTree; both now use the inheritedTreesorting. Sorting is based only on subtree bifurcation counts; domain information is no longer used.Added support for user-defined domain names and colors. Added a header to SWC files mapping types to names and colors. Refactored domain methods into clearer steps (add, update, extend).
Added per-synapse seeds to spike-generation functions to enable reproducible simulations.
Flattened
model.populationby removing sorting by synapse type. Replaced auto-generated names such asAMPA_0with user-defined population names.Reorganized how simulation stimuli are stored and referenced. Each protocol now has its own subfolder with a
config.jsonplus three CSV files (recordings.csv,iclamps.csv, andsynapses.csv). Added automatic handling of legacy stimuli formats.Minor Updates:
Points now require
domain_nameanddomain_color; sections and segments derive these from their first point. When domain attributes are updated, changes propagate to their points (e.g.,domain.colorupdatespoint.domain_colorfor each point in the domain).Moved domain creation to a dedicated factory function
create_domains; domains now belong toModel, notSectionTree.Renamed
domain_idxtoidx_within_domaininSection.Ensured deterministic ordering of synapses within populations (sorted by section index and location).
Fixed “phantom synapses” via a new
_clear_syn()method that fully removes NEURON instances.Added a power distribution function for channel distribution models.
Replaced MSE with
max_erroras the metric for distribution fitting. Enforcedlow_val < high_valfor step distributions.
download_example_datanow fetches version-specific examples instead of always using the latest.Enhanced
PathManagerto support the updated stimuli directory structure.
Version 0.4.6¶
This release resolves issues with fitting step-like distributions, introduces a workaround for channels with KINETIC blocks, adds prerun functionality for simulation stabilization, and further modularizes the model class implementation.
Key Updates:
Enhanced the
fit_distributionmethod to support multiple candidate distribution types (polynomial and step functions by default), enabling accurate fitting of step-like distributions (e.g., for Ca2+ channels).Implemented a workaround for MOD files containing a KINETIC block by introducing a
FallbackChannelclass. When a KINETIC block is detected, aFallbackChannelinstance is created as a placeholder, allowing simulations to run. The fallback channel does not support typical visualization or standardization features, but it enables modification of thegbarparameter.Added a
preruncontext manager for simulation stabilization, allowing users to run a pre-simulation period before the main simulation. For example, usemodel.run(duration=300, prerun_time=100)to stabilize the model for a period of 100 ms before running the main simulation for 300 ms.Refactored the
Modelclass by introducingIOMixinandSimulationMixinclasses, separating file I/O operations as well as simulation and stimulus management from the core model functionality. This modular approach improves code maintainability while preserving a flat model interface.Minor Updates:
Updated the
path_to_dataproperty ofPathManagerto ensure it returns the correct parent directory ofpath_to_model.Updated
vecstim.modin the default MOD files for compatibility with Windows.
Version 0.4.5¶
This release introduces refined validation protocols, improvements in morphology reduction, and updates to the NMODL-to-Jaxley conversion template, along with several minor enhancements and bug fixes.
Key Updates:
Enhanced the time constant protocol by adopting a double exponential function for improved fitting precision.
Added a new analysis function for calculating the sag ratio, enabling better characterization of neuronal responses.
Updated the (plain) Jaxley template.
Improved iteration over dataframes using the
itertuplesmethod for better performance and type safety.Minor Updates:
Enhanced the
download_example_datafunction to include templates and default MOD files.Added a tutorial for converting MOD files to Jaxley-compatible classes.
Improved parameter fitting when reducing morphologies by properly escaping cases where the mechanism is not in the domain (or if an equilibrium potential is not set for the domain).
Improved the logic to ensure the domains in a subtree have the same mechanisms when reducing morphologies.
Fixed minor issues with exporting distributions in reduced models.
Known Issues:
Polynomial fitting fails to accurately represent step-like distributions when reducing morphologies (fixed in version 0.4.6).
Version 0.4.4¶
This release addresses a bug introduced in version 0.4.3, where vectorized inputs to some distribution functions caused errors during parameter distribution using the
model.distributemethod. The issue has been addressed by reverting to the non-vectorized implementation, as the performance impact is minimal.
Version 0.4.3¶
This release improves performance and resolves several bugs.
Updates:
Fixed a bug where population loading ignored synapse types.
Enhanced parameter distribution performance by introducing cached properties for path distances:
section.path_distance_to_rootandsection.path_distance_within_domain.Resolved issues with re-segmentation involving stimuli and recordings. The
model.set_segmentationmethod now correctly updates segments, preserving existing stimuli and recordings by temporarily exporting and reloading their configurations.Renamed “Test” model to “Toy” model and refined its morphologies.
Version 0.4.2¶
This release fixes a bug introduced in version 0.4.1 where segments were not properly updated in the
set_segmentationmethod.
Version 0.4.1¶
This release addresses minor bugs and improves the separation of NEURON-specific code from core classes.
Key Updates:
New
NeuronSectionandNeuronSegmentsubclasses encapsulating NEURON-specific functionality and separating it from the baseSectionandSegmentclasses.Proper
CVodehandling anddtupdates during simulation initialization.Minor Updates:
Enhanced the
PythonCodeGeneratorclass to handle MOD file procedures with no parameters, defaulting to ‘v’.
Version 0.4.0¶
This release enhances cross-platform compatibility and introduces a redesigned data structure for recording multiple variables, such as voltage and ion channel currents.
Key Updates:
Redesigned data structure for recordings with support for multiple variables. The
model.recordingsattribute now uses a nested dictionary to store variable names (e.g., ‘v’, ‘i_Na’) and their corresponding segment values. To record a variable, use themodel.add_recordingmethod, which now acceptsvarargument.Improved cross-platform compatibility with resolved installation and MOD file compilation issues on Windows.
Minor Updates:
Renamed the ‘membrane’ subpackage and folder to ‘biophys’, along with updated methods for exporting and importing biophysical properties, such as
model.export_biophysandmodel.load_biophys.Renamed the
model.export_stimuli_configmethod tomodel.export_stimuli.Added a
current_availableattribute to each Mechanism to indicate whether the current through the channel can be recorded.
Version 0.3.1¶
This release includes a minor update to resolve issues encountered during the distribution upload process to PyPI.
Version 0.3.0¶
This release focuses on extending and reorganizing examples, and addressing minor bugs.
Key Updates:
Reorganized example notebooks and a new example model (Hay 2011).
Utility function for downloading examples from the repository.
Default MOD files and templates included in the distribution.
Minor Updates:
Replaced the prefix for standard channels.
Fixed the issue with parsing MOD files without TITLE.
Updated the standard CaDyn MOD file.
Improved SWC-to-domain mapping, resolving domains mismatched during export to NEURON.
Refined the template for exporting models to plain NEURON code.
Removed Jupyter from the dependencies.
Version 0.2.0¶
This release reintroduces morphology reduction functionality and provides the capability to export models in plain Python NEURON code.
Key Updates:
Morphology reduction subpackage for simplifying dendritic trees (based on
neuron_reduce, Amsalem et al., 2020).New functionality for fitting resultant distributions in reduced models with a polynomial (for easy I/O and post-reduction modifications).
New
model_iomodule for exporting models in plain NEURON code using a Jinja2 template.Minor Updates:
Updated the
lambda_ffunction to align with NEURON’s implementation.Added
domain_idxto sections when adding a section to a domain.Changed sorting algorithm to maintain SWC order by default when building morphological graphs, with an option to sort each node’s children by subtree size (smallest first).
Fixed a bug that caused failures in selecting synaptic locations.
Added an option to modify
nsegper section.Added
node._treereference to each node in the tree graph.
Version 0.1.0¶
This release marks a step forward in modularizing DendroTweaks, separating the core functionalities into a standalone Python library that integrates with the web-based app. The codebase is now more coherent and robust, with improved handling of neuronal morphology, ion channel kinetics, and model validation.
Key Updates:
New morphology subpackage for SWC file processing and model representation.
Improved MOD-to-Python converter
Improved modular I/O for morphologies, membrane mechanisms, and stimuli