diff --git a/docs/HISTORY.md b/docs/HISTORY.md index 83299fe7..5ed8642f 100644 --- a/docs/HISTORY.md +++ b/docs/HISTORY.md @@ -14,6 +14,7 @@ In 2021, Guillaume and other trainees in Adrien's lab decided to fork from neuro - Refactoring `IntervalSet` to pure numpy ndarray. - Implementing new chain of inheritance for time series with abstract base class. `base_class.Base` holds the temporal methods for all time series and `Ts`. `time_series.BaseTsd` inherit `Base` and implements the common methods for `Tsd`, `TsdFrame` and `Tsd`. +- Automatic conversion to numpy ndarray for all objects that are numpy-like (typically jax). 0.5.1 (2024-01-29) diff --git a/pynapple/core/_jitted_functions.py b/pynapple/core/_jitted_functions.py index 7ef8f966..f7815765 100644 --- a/pynapple/core/_jitted_functions.py +++ b/pynapple/core/_jitted_functions.py @@ -886,9 +886,9 @@ def jitcontinuous_perievent( left = np.minimum(windowsize[0], t_pos - start_t[k, 0]) right = np.minimum(windowsize[1], maxt - t_pos - 1) center = windowsize[0] + 1 - new_data_array[ - center - left - 1 : center + right, cnt_i - ] = data_array[t_pos - left : t_pos + right + 1] + new_data_array[center - left - 1 : center + right, cnt_i] = ( + data_array[t_pos - left : t_pos + right + 1] + ) t -= 1 i += 1 diff --git a/pynapple/core/time_series.py b/pynapple/core/time_series.py index ee3ee9c0..3c39f148 100644 --- a/pynapple/core/time_series.py +++ b/pynapple/core/time_series.py @@ -14,6 +14,7 @@ Most of the same functions are available through all classes. Objects behaves like numpy.ndarray. Slicing can be done the same way for example `tsd[0:10]` returns the first 10 rows. Similarly, you can call any numpy functions like `np.mean(tsd, 1)`. """ + import abc import importlib import os diff --git a/pynapple/core/ts_group.py b/pynapple/core/ts_group.py index 4a321125..bd1a62f3 100644 --- a/pynapple/core/ts_group.py +++ b/pynapple/core/ts_group.py @@ -4,7 +4,6 @@ """ - import os import warnings from collections import UserDict diff --git a/pyproject.toml b/pyproject.toml index d452afbf..08e570f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ repository = "https://github.com/pynapple-org/pynapple" ########################################################################## [project.optional-dependencies] dev = [ - "black>=24.1.0", # Code formatter + "black>=24.2.0", # Code formatter "isort", # Import sorter "pip-tools", # Dependency management "pytest", # Testing framework