Skip to content

Commit 44203cb

Browse files
authored
Merge pull request #1061 from int-brain-lab/develop
Release 3.4.2
2 parents 78e82df + ac0b614 commit 44203cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1580
-1345
lines changed

.github/workflows/ibllib_ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
- name: Install deps
3636
run: |
3737
python -m pip install --upgrade pip
38-
python -m pip install flake8 pytest flake8-docstrings
38+
python -m pip install flake8 ruff flake8-docstrings
3939
pip install -r requirements.txt
4040
pip install -e .
41-
- name: Flake8
41+
- name: Flake8 & ruff
4242
run: |
43-
python -m flake8
43+
python -m ruff check .
4444
python -m flake8 --select D --ignore E ibllib/qc/camera.py ibllib/qc/task_metrics.py
4545
- name: Brainbox tests
4646
run: |

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## [3.4.2] 2025-11-24
10+
11+
### Fixed
12+
- public method to create insertions in `ibllib.ephys.spikes`
13+
-
14+
### Added
15+
- CI now uses ruff instead of flake8 to enforce linting
916

1017
## [3.4.1] 2025-07-02
1118

@@ -14,7 +21,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1421
- SpikeSortingLoader takes into account revisions
1522
- There is a specific test for `spikeinterface` CI in our integration tests
1623

17-
1824
## Release Note 3.4.0
1925

2026
### features

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,17 @@ The library is currently 2 main modules:
1717
**Python Module**: Python 3.10 or higher, Python 3.12 recommended
1818

1919
## Installation, documentation and examples
20-
https://docs.internationalbrainlab.org
2120

21+
Installation: https://docs.internationalbrainlab.org/02_installation.html
22+
Documentation and examples: https://docs.internationalbrainlab.org
2223

2324
## Contribution and development practices
24-
See https://int-brain-lab.github.io/iblenv/07_contribution.html
25+
See https://docs.internationalbrainlab.org/09_contribution.html
2526

2627
We use Semantic Versioning.
2728

2829
Before committing to your branch:
29-
- check formating `flake8`
30+
- check formating `ruff check`
3031
- run tests `python -m unittest discover`
3132

3233
Pull request to `develop` or `main`.
33-
34-
35-
## Matlab Library
36-
The Matlab library has moved to its own repository here: https://github.com/int-brain-lab/ibllib-matlab/

brainbox/behavior/dlc.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,20 @@ def insert_idx(array, values):
4444
return idx
4545

4646

47+
def valid_feature(x: str):
48+
if x.endswith('_x') or x.endswith('_y') or x.endswith('_likelihood'):
49+
return True
50+
return False
51+
52+
4753
def likelihood_threshold(dlc, threshold=0.9):
48-
"""
49-
Set dlc points with likelihood less than threshold to nan.
54+
"""Set dlc points with likelihood less than threshold to nan.
5055
51-
FIXME Add unit test.
5256
:param dlc: dlc pqt object
5357
:param threshold: likelihood threshold
5458
:return:
5559
"""
56-
features = np.unique(['_'.join(x.split('_')[:-1]) for x in dlc.keys()])
60+
features = np.unique(['_'.join(x.split('_')[:-1]) for x in dlc.keys() if valid_feature(x)])
5761
for feat in features:
5862
nan_fill = dlc[f'{feat}_likelihood'] < threshold
5963
dlc.loc[nan_fill, (f'{feat}_x', f'{feat}_y')] = np.nan
@@ -268,7 +272,7 @@ def plot_trace_on_frame(frame, dlc_df, cam):
268272
# Threshold the dlc traces
269273
dlc_df = likelihood_threshold(dlc_df)
270274
# Features without tube
271-
features = np.unique(['_'.join(x.split('_')[:-1]) for x in dlc_df.keys() if 'tube' not in x])
275+
features = np.unique(['_'.join(x.split('_')[:-1]) for x in dlc_df.keys() if valid_feature(x) and 'tube' not in x])
272276
# Normalize the number of points across cameras
273277
dlc_df_norm = pd.DataFrame()
274278
for feat in features:

brainbox/examples/raster_depths.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)