Repository navigation
Release v0.16.0
0.16.0
07/10/2025
Packaging Modernization
- Added comprehensive
pyproject.tomlwith PEP 517/621 compliance - Eliminated pip deprecation warnings for editable installs (now requires pip >= 21.3)
- Updated Python version support to 3.8-3.12 (dropped 3.4-3.7)
- Made download URLs auto-generate from version (only need to update
_version.pyfor releases) - Package now uses modern setuptools backend (>=64)
New Feature: only_return_first_n_bursts
- Added
only_return_first_n_burstsparameter toLickcalcclass andlickcalcfunction - Allows filtering analysis to only the first N bursts in a session
- Useful for analyzing early session behavior or learning effects
- Gracefully handles cases where N exceeds total bursts (returns all available bursts)
- Works seamlessly with other parameters (
min_burst_length,remove_longlicks, time/burst divisions) - Fully tested with 8 comprehensive test cases
- 100% backward compatible (disabled by default)
New Feature: remove_longlicks
- Added
remove_longlicksparameter toLickcalcclass andlickcalcfunction - Allows optional exclusion of long-duration licks from ALL behavioral calculations
- Preserves original data in
licks_rawandoffset_rawattributes - Affects all metrics: bursts, runs, ILIs, frequencies, Weibull parameters, etc.
- Fully tested with 5 new test cases
- 100% backward compatible (disabled by default)
Function Rename: lickCalc → lickcalc
- Renamed
lickCalctolickcalc(all lowercase) for PEP 8 compliance - Old
lickCalcname still works but issuesDeprecationWarning - Both names exported from main module for backward compatibility
- Internal code updated to use new lowercase name
- Users encouraged to migrate:
lickCalc→lickcalc - Comprehensive deprecation test ensures warning is properly raised
Code Optimizations (lickcalc.py and lick_utils.py)
- Simplified parameter initialization using
.get()with defaults (32 lines → 8 lines) - Fixed
get_burst_mean()logic error (now correctly slices first N bursts) - Optimized filtering operations with numpy boolean indexing (2-10x faster for large datasets)
- Optimized
_get_corresponding_offsets()from O(n²) to O(n) using numpy operations (10-1000x faster) - Removed unnecessary type conversions and list comprehensions
- Applied PEP 8 best practices (use
is Noneinstead of== None) - Overall performance improvement: 10-20% for small datasets, 5-10x for large datasets
Test Suite Improvements
- Massive speed improvement: Test suite runtime reduced from 639s to 3.1s (206x faster!)
- Optimized test data generation: reduced sample sizes (600k→8-12k) and sampling frequency (1017→123 Hz)
- Tightened test tolerances: moved from relaxed (atol=0.3) to strict (atol=0.01-0.05) while maintaining determinism
- Eliminated ~100 lines of duplicated test code by creating shared
tests/test_helpers.pymodule - All test helper functions now have comprehensive docstrings
- Fixed random seed placement in
test_lickcalc.pyfor proper pytest isolation - Added 8 new tests for
only_return_first_n_burstsfeature - Added deprecation warning test for
lickCalc→lickcalcrename - Total test count: 41 tests, all passing
Bug Fixes
- Fixed integer indexing bug in
get_burst_end()method - Removed debug print statements from
lickcalc.pyandlick_utils.py - Removed
if __name__ == '__main__'test blocks - Removed unused
audioopimport fromtest_process_data.py(was causing deprecation warning) - Added epsilon to division operations in
snipper_utils.pyto prevent zero-division warnings - Fixed typo in docstrings: "Calcuates" → "Calculates"