Skip to content

MyoGen 0.10.0

Choose a tag to compare

@RaulSimpetru RaulSimpetru released this 01 Jun 05:10
· 7 commits to main since this release

MyoGen 0.10.0 is out! This is the first release with Python 3.13 and NumPy 2.x support, a new device-calibratable iEMG noise model, and optional GPU acceleration for SFAP computation. We also removed the elephant/viziphant dependency chain, making the core install lighter and easier to maintain.

pip install --upgrade myogen   # or: uv add myogen

Added

  • Device-calibratable iEMG noise model.
    Added a new myogen.utils.emg_noise module for generating colored intramuscular-EMG noise with parameters that can be calibrated from real recordings. Two new gallery examples demonstrate the workflow:

    • examples/01_basic/15_calibrate_noise_from_real.py
    • examples/01_basic/16_noise_parameter_sweep.py
  • Optional GPU acceleration for SFAP computation.
    Single-fiber action-potential and surface-EMG bioelectric computations can now run on NVIDIA GPUs via the new [gpu] optional extra using CuPy. A new use_gpu tri-state option — auto / on / off — selects the backend and falls back to NumPy when CuPy or a CUDA device is unavailable. The GPU-aware code paths prevent NumPy and CuPy arrays from being mixed accidentally.
    Contributed by @veylantis in #11.

  • Top-level simulator re-exports.
    ForceModelVectorized and the biomechanics classes are now importable directly from myogen.simulator.

  • Synaptic-delay control.
    Added connect_to_muscle(delay__ms=...) and an end-to-end synaptic_delay parameter for controlling conduction/synaptic delays through the spinal network.

  • Expanded regression test suite.
    Added tests covering unit safety, ForceModel/ForceModelVectorized parity, EMG accuracy, determinism, and NWB round-trips.

Changed

  • Python 3.13 support.
    requires-python is now widened to >=3.12,<3.14, a Python :: 3.13 classifier has been added, and the CI test and wheel matrices now cover Python 3.13.

  • NumPy 2.x support.
    With elephant removed, the previous numpy<2.0 pin is gone. The runtime requirement is now relaxed to numpy>=1.26, while the build system compiles the Cython extensions against NumPy 2.x. The compiled extensions were verified against both NumPy 2.x and NumPy 1.26.

  • Updated Linux wheel baseline.
    Linux wheels now target manylinux_2_28 instead of manylinux2014. This allows the SciPy build cap to be lifted, but it also means that EOL CentOS/RHEL 7 systems are no longer supported by the prebuilt Linux wheels.

  • ForceModelVectorized API alignment.
    Completed the contraction_time_range_factor rename and extracted shared helper functions so that ForceModel and ForceModelVectorized expose a more consistent interface.

  • Modernized typing.
    Replaced deprecated typing.Dict/List/Tuple/Callable annotations with PEP-585 builtin generics. The biomechanics __degrees argument was also renamed to __deg.

  • Packaging cleanup.
    The wheel now ships source files only, runtime dependencies are pinned more tightly, and the NEURON-home lookup helper was deduplicated.

  • CI and wheel builds.
    Wheels are now built for CPython 3.12 and 3.13 on Linux and macOS arm64. The macOS Intel build was dropped, and all GitHub Actions were updated to Node 24-compatible versions.

Removed

  • Removed the elephant and viziphant dependencies.
    Spike binning via elephant.conversion.BinnedSpikeTrain has been replaced by a dependency-free myogen.utils.bin_spike_trains helper. The replacement was verified to match the previous implementation across grid, edge, fractional, and sparse cases.

    elephant.statistics.isi in utils/helper.py has been replaced by numpy.diff, which is equivalent for sorted spike trains. The examples now compute firing rates, PSTHs, and rasters natively, with the previous viziphant raster replaced by a small matplotlib helper.

    The [elephant] optional extra and the elephant/viziphant dev/docs dependencies have therefore been removed. import myogen, the test suite, and the documentation build no longer require elephant.

Fixed

  • Surface EMG

    • Added exact Laplacian spatial filtering.
    • Corrected the FFT bin grid.
    • Improved handling of singular electrode inter-electrode distances.
    • Added RNG worker pre-generation for reproducible parallel draws.
    • Fixed an off-by-one error in the np.arange temporal-resampling grid.
  • Intramuscular EMG

    • Corrected shift_padding tail handling.
    • Corrected the shift_sfaps sign convention.
    • Added NumPy-2.0-safe scalar extraction.
  • RNG determinism

    • set_random_seed now resets per-cell ID counters.
    • The Hill durType=2 path is now seeded.
    • NWB exports are deterministic by default.
  • Other fixes

    • Group II afferent rectification is now applied per region instead of after summation.
    • Fixed a min_radial_dist unit mismatch in calc_sfaps. Contributed by @veylantis in #10.
    • Fixed a continuous_saver f-string bug that mangled a log message.
    • Replaced the removed np.trapz with scipy.integrate.trapezoid for NumPy 2.0 compatibility.
    • Corrected raster row offsets and PSTH right-edge binning in the examples.

New contributors

This release includes contributions from two first-time contributors — thank you both!

  • @veylantis contributed the calc_sfaps unit-mismatch fix in #10 and implemented the optional CuPy GPU acceleration for SFAP computation in #11.
  • @joaohbbittar suggested dropping the elephant dependency and relaxing the numpy<2.0 pin, which motivated two of this release’s headline changes: #15 and #16.

See everyone in the contributors list.

Full changelog: https://github.com/NsquaredLab/MyoGen/blob/main/CHANGELOG.md
Compare: v0.9.0...v0.10.0