Skip to content

Commit 0fd8469

Browse files
committed
Release version 2.7.3
This is a bug fix release that resolves critical issues with bm.for_loop and improves CI stability. Key fixes: - Fixed jit parameter handling in bm.for_loop - Fixed zero-length scan error when using jit=False - Enhanced progress_bar parameter to support ProgressBar instances - Removed unused parameters (remat, unroll_kwargs) - Fixed CI Tkinter issues on Windows Python 3.13 Version: 2.7.3 Release Date: December 2024
1 parent 62646fd commit 0fd8469

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

brainpy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# limitations under the License.
1515
# ==============================================================================
1616

17-
__version__ = "2.7.2"
18-
__version_info__ = (2, 7, 2)
17+
__version__ = "2.7.3"
18+
__version_info__ = (2, 7, 3)
1919

2020

2121
from brainpy import _errors as errors

changelog.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
11
# Changelog
22

3+
## Version 2.7.3
4+
5+
**Release Date:** December 2024
6+
7+
This is a bug fix release that resolves critical issues with `bm.for_loop` and improves CI stability.
8+
9+
### Bug Fixes
10+
11+
#### `bm.for_loop` jit Parameter Fix
12+
- **Fixed**: The `jit` parameter in `bm.for_loop` was accepted but never used - passing `jit=False` had no effect
13+
- **Implementation**: When `jit=False`, the call is now properly wrapped in `jax.disable_jit()` context manager
14+
- **Impact**: Users can now debug code with `jit=False` to see actual values instead of JIT-compiled traces
15+
16+
#### Zero-Length Scan Fix
17+
- **Fixed**: `ValueError: zero-length scan is not supported in disable_jit() mode` when using `jit=False` with zero-length inputs
18+
- **Implementation**: Automatically falls back to JIT mode for zero-length inputs with a warning
19+
- **Impact**: Prevents crashes when `DSRunner.run(duration)` results in 0 time steps (e.g., `duration=0.5, dt=1.0`)
20+
21+
#### Progress Bar Enhancement
22+
- **Enhanced**: `progress_bar` parameter in `bm.for_loop()` and `bm.scan()` now supports advanced customization
23+
- **New Features**:
24+
- Accept `ProgressBar` instances for fine-grained control (freq, desc, count parameters)
25+
- Accept integers as shorthand for frequency (e.g., `progress_bar=10` means update every 10 iterations)
26+
- Full backward compatibility with existing `progress_bar=True/False` usage
27+
- **Export**: Added `bm.ProgressBar` for easy access (`from brainpy.math import ProgressBar`)
28+
- **Impact**: Aligns with brainstate API and enables better progress tracking customization
29+
30+
#### Parameter Cleanup
31+
- **Removed**: Unused parameters `remat` and `unroll_kwargs` from `bm.for_loop()`
32+
- **Backward Compatibility**: `remat` parameter kept in `LoopOverTime.__init__()` with deprecation warning
33+
- **Fixes**: Resolved TypeErrors in `DSRunner` and `LoopOverTime` that used these parameters
34+
35+
#### CI Improvements
36+
- **Fixed**: TclError on Windows Python 3.13 CI due to missing Tcl/Tk configuration
37+
- **Implementation**: Set `MPLBACKEND=Agg` environment variable in GitHub Actions workflow
38+
- **Impact**: Matplotlib tests now run successfully on all platforms (Linux, macOS, Windows)
39+
40+
### Code Quality
41+
- Added comprehensive test coverage for all fixes
42+
- Updated API documentation to reflect new functionality
43+
- All 38 tests in `test_controls.py` pass
44+
45+
### Files Modified
46+
- `brainpy/__init__.py`: Updated version to 2.7.3
47+
- `brainpy/math/object_transform/controls.py`: Fixed jit handling, zero-length scan, progress_bar enhancement
48+
- `brainpy/math/object_transform/__init__.py`: Exported ProgressBar
49+
- `brainpy/runners.py`: Fixed unroll_kwargs usage with functools.partial
50+
- `brainpy/transform.py`: Added remat deprecation warning in LoopOverTime
51+
- `brainpy/math/object_transform/tests/test_controls.py`: Added 11 new test cases
52+
- `docs_classic/apis/brainpy.math.oo_transform.rst`: Added ProgressBar to documentation
53+
- `.github/workflows/CI.yml`: Added MPLBACKEND=Agg for all test jobs
54+
55+
### Commits
56+
- `fa2f67c6`: Fix bm.for_loop jit parameter handling and remove unused parameters
57+
- `1c70d4ae`: Enhance progress_bar parameter to support ProgressBar instances
58+
- `100ddc17`: Fix runners.py to use functools.partial instead of removed unroll_kwargs
59+
- `dde8f99b`: Fix LoopOverTime to remove remat parameter from for_loop call
60+
- `6b410aa8`: Fix zero-length scan error when using jit=False
61+
- `2c838cac`: Set MPLBACKEND=Agg in CI to fix Tkinter issues on Windows
62+
63+
### Breaking Changes
64+
None. All changes are backward compatible or involve previously non-functional parameters.
65+
66+
---
67+
368
## Version 2.7.1
469

570
**Release Date:** October 2025

0 commit comments

Comments
 (0)