|
1 | 1 | # Changelog |
2 | 2 |
|
| 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 | + |
3 | 68 | ## Version 2.7.1 |
4 | 69 |
|
5 | 70 | **Release Date:** October 2025 |
|
0 commit comments