Skip to content

Commit

Permalink
Merge pull request #231 from pynapple-org/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
gviejo authored Feb 23, 2024
2 parents dcf71da + 5115264 commit f441ec5
Show file tree
Hide file tree
Showing 31 changed files with 2,322 additions and 1,224 deletions.
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,32 @@ pynapple is a light-weight python library for neurophysiological data analysis.
------------------------------------------------------------------------

New release :fire:
---------------
Starting with 0.4, pynapple rely on the [numpy array container](https://numpy.org/doc/stable/user/basics.dispatch.html) approach instead of Pandas. Pynapple builtin functions will remain the same except for functions inherited from Pandas. Typically this line of code in `pynapple<=0.3.6` :
------------------

### pynapple >= 0.6

Starting with 0.6, [`IntervalSet`](https://pynapple-org.github.io/pynapple/reference/core/interval_set/) objects are behaving as immutable numpy ndarray. Before 0.6, you could select an interval within an `IntervalSet` object with:

```python
new_intervalset = intervalset.loc[[0]] # Selecting first interval
```

With pynapple>=0.6, the slicing is similar to numpy and it returns an `IntervalSet`

```python
new_intervalset = intervalset[0]
```

See the [documentation](https://pynapple-org.github.io/pynapple/reference/core/interval_set/) for more details.


### pynapple >= 0.4

Starting with 0.4, pynapple rely on the [numpy array container](https://numpy.org/doc/stable/user/basics.dispatch.html) approach instead of Pandas for the time series. Pynapple builtin functions will remain the same except for functions inherited from Pandas. Typically this line of code in `pynapple<=0.3.6` :
```python
meantsd = tsdframe.mean(1)
```
is now:
is now :
```python
meantsd = np.mean(tsdframe, 1)
```
Expand Down
8 changes: 8 additions & 0 deletions docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ In 2018, Francesco started neuroseries, a Python package built on Pandas. It was
In 2021, Guillaume and other trainees in Adrien's lab decided to fork from neuroseries and started *pynapple*. The core of pynapple is largely built upon neuroseries. Some of the original changes to TSToolbox made by Luke were included in this package, especially the *time_support* property of all ts/tsd objects.


0.6.0 (coming)
------------------

- 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)
------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/tutorial_HD_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def smoothAngularTuningCurves(tuning_curves, sigma=2):
np.transpose(p_feature.restrict(ep).values),
aspect="auto",
interpolation="bilinear",
extent=[ep["start"].values[0], ep["end"].values[0], 0, 2 * np.pi],
extent=[ep["start"][0], ep["end"][0], 0, 2 * np.pi],
origin="lower",
cmap="viridis",
)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/tutorial_pynapple_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
# Multiple operations are available for IntervalSet. For example, IntervalSet can be merged. See the full documentation of the class [here](https://peyrachelab.github.io/pynapple/core.interval_set/#pynapple.core.interval_set.IntervalSet.intersect) for a list of all the functions that can be used to manipulate IntervalSets.


epoch1 = nap.IntervalSet(start=[0], end=[10]) # no time units passed. Default is us.
epoch1 = nap.IntervalSet(start=0, end=10) # no time units passed. Default is us.
epoch2 = nap.IntervalSet(start=[5, 30], end=[20, 45])

epoch = epoch1.union(epoch2)
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/tutorial_pynapple_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
ts2_time_array = ts2.as_units("s").index.values

binsize = 0.1 # second
cc12, xt = nap.cross_correlogram(
cc12, xt = nap.process.correlograms.cross_correlogram(
t1=ts1_time_array, t2=ts2_time_array, binsize=binsize, windowsize=1 # second
)

Expand Down Expand Up @@ -152,7 +152,7 @@
# To check the accuracy of the tuning curves, we will display the spikes aligned to the features with the function `value_from` which assign to each spikes the corresponding feature value for neuron 0.

tcurves2d, binsxy = nap.compute_2d_tuning_curves(
group=ts_group, feature=features, nb_bins=10
group=ts_group, features=features, nb_bins=10
)

ts_to_features = ts_group[1].value_from(features)
Expand Down Expand Up @@ -203,7 +203,7 @@

tcurves2d, binsxy = nap.compute_2d_tuning_curves(
group=ts_group,
feature=features,
features=features,
nb_bins=10,
ep=epoch,
minmax=(-1.0, 1.0, -1.0, 1.0),
Expand Down
22 changes: 20 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,28 @@ Community

To ask any questions or get support for using pynapple, please consider joining our slack. Please send an email to thepynapple[at]gmail[dot]com to receive an invitation link.

New release :fire:
New releases :fire:
------------------

Starting with 0.4, pynapple rely on the [numpy array container](https://numpy.org/doc/stable/user/basics.dispatch.html) approach instead of Pandas. Pynapple builtin functions will remain the same except for functions inherited from Pandas. Typically this line of code in `pynapple<=0.3.6` :
### pynapple >= 0.6

Starting with 0.6, [`IntervalSet`](https://pynapple-org.github.io/pynapple/reference/core/interval_set/) objects are behaving as immutable numpy ndarray. Before 0.6, you could select an interval within an `IntervalSet` object with:

```python
new_intervalset = intervalset.loc[[0]] # Selecting first interval
```

With pynapple>=0.6, the slicing is similar to numpy and it returns an `IntervalSet`

```python
new_intervalset = intervalset[0]
```

See the [documentation](https://pynapple-org.github.io/pynapple/reference/core/interval_set/) for more details.

### pynapple >= 0.4

Starting with 0.4, pynapple rely on the [numpy array container](https://numpy.org/doc/stable/user/basics.dispatch.html) approach instead of Pandas for the time series. Pynapple builtin functions will remain the same except for functions inherited from Pandas. Typically this line of code in `pynapple<=0.3.6` :
```python
meantsd = tsdframe.mean(1)
```
Expand Down
4 changes: 2 additions & 2 deletions pynapple/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.5.1"
from .core import *
__version__ = "0.6.0"
from .core import IntervalSet, Ts, Tsd, TsdFrame, TsdTensor, TsGroup, TsIndex, config
from .io import *
from .process import *
1 change: 1 addition & 0 deletions pynapple/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from . import config
from .interval_set import IntervalSet
from .time_index import TsIndex
from .time_series import Ts, Tsd, TsdFrame, TsdTensor
Expand Down
5 changes: 0 additions & 5 deletions pynapple/core/_jitted_functions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# -*- coding: utf-8 -*-
# @Author: guillaume
# @Date: 2022-10-31 16:44:31
# @Last Modified by: Guillaume Viejo
# @Last Modified time: 2024-01-25 16:43:34
import numpy as np
from numba import jit, njit, prange

Expand Down
Loading

0 comments on commit f441ec5

Please sign in to comment.