Skip to content

Commit 7a91f0d

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 45b32dc commit 7a91f0d

4 files changed

Lines changed: 42 additions & 98 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
- `neuron==8.2.7` now only installed automatically on Linux and macOS
3232
- Windows users must manually install NEURON before pip installing MyoGen
3333
- Combined dependency declaration for both Linux and macOS using `sys_platform` conditions
34-
- **Elephant Dependency**: Made elephant an optional dependency (PyPI compatibility)
35-
- Removed elephant from core dependencies (PyPI doesn't allow git dependencies)
36-
- Available as optional extra: `pip install myogen[elephant]`
37-
- Provides spike train conversion (`BinnedSpikeTrain`) and statistics (`isi`) for simulations
38-
- Used in EMG simulations, force modeling, and firing rate/CV analysis
39-
- Automatically included in docs and dev environments
34+
- **Elephant Dependency**: Added elephant from PyPI as required dependency
35+
- Elephant 1.1.1 included for spike train conversion and statistics
36+
- Provides `BinnedSpikeTrain` conversion and `isi` for EMG/force simulations
37+
- Graceful error handling if elephant import fails (development safety)
38+
- **NumPy Version**: Pinned to numpy <2.0 for elephant compatibility
39+
- Elephant 1.1.1 requires numpy <2.0
40+
- Ensures stable, tested dependency versions
4041
- **Sphinx Workflow**: Kept `setup_myogen` call in documentation build workflow
4142
- Required for editable installs used in CI/CD environments
4243
- Ensures NMODL mechanisms are compiled for documentation examples

README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,10 @@ MyoGen is designed for algorithm validation, hypothesis-driven research, and edu
4747
## From PyPI (recommended)
4848

4949
```bash
50-
# Basic installation
5150
pip install myogen
52-
53-
# With intramuscular EMG support (includes elephant)
54-
pip install myogen[elephant]
5551
```
5652

57-
NEURON mechanisms compile automatically during installation!
53+
NEURON mechanisms compile automatically during installation.
5854

5955
## From Source (for development)
6056

@@ -83,17 +79,6 @@ uv run poe setup_myogen
8379
pip install cupy-cuda12x
8480
```
8581

86-
**Spike train analysis** (required for most simulations):
87-
88-
```bash
89-
pip install myogen[elephant]
90-
# or
91-
pip install git+https://github.com/INM-6/elephant@389f53830d37290611af34e363d1d382a05e4d1e
92-
```
93-
94-
Elephant provides:
95-
- `BinnedSpikeTrain` conversion for EMG and force simulations
96-
- `isi` (inter-spike interval) statistics for firing rate and CV analysis
9782

9883
# Quick Start
9984

pyproject.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ requires-python = ">=3.12"
77
dependencies = [
88
"beartype>=0.21.0",
99
"cython>=3.1.3",
10+
"elephant>=1.1.1",
1011
"impi-rt>=2021.15.0 ; sys_platform == 'win32'",
1112
"matplotlib>=3.10.1",
1213
"mpi4py>=4.0.3",
@@ -15,7 +16,7 @@ dependencies = [
1516
#"neuron-nightly>=9.0a1.dev1492",
1617
"noise>=1.2.2",
1718
"numba>=0.61.2",
18-
"numpy>=1.26",
19+
"numpy>=1.26,<2.0",
1920
"optuna>=4.5.0",
2021
"pyqt6>=6.9.0",
2122
"quantities>=0.16.2",
@@ -34,19 +35,13 @@ dependencies = [
3435
invalid-syntax-in-forward-annotation = "ignore"
3536
possibly-unbound-import = "ignore"
3637

37-
[project.optional-dependencies]
38-
elephant = [
39-
"elephant @ git+https://github.com/INM-6/elephant@389f53830d37290611af34e363d1d382a05e4d1e",
40-
]
41-
4238
[dependency-groups]
4339
dev = [
4440
"pandas-stubs>=2.3.0.250703",
4541
"poethepoet>=0.37.0",
4642
"scipy-stubs>=1.16.1.0",
4743
]
4844
docs = [
49-
"elephant @ git+https://github.com/INM-6/elephant@389f53830d37290611af34e363d1d382a05e4d1e",
5045
"enum-tools[sphinx]>=0.12.0",
5146
"linkify-it-py>=2.0.3",
5247
"memory-profiler>=0.61.0",

0 commit comments

Comments
 (0)