From 60f104c511fd109ea1bcc82fcad63b01e20b1fc0 Mon Sep 17 00:00:00 2001 From: Guillaume Viejo Date: Thu, 18 Apr 2024 12:58:41 -0400 Subject: [PATCH 1/2] Fixing repr of iset --- pynapple/core/interval_set.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/pynapple/core/interval_set.py b/pynapple/core/interval_set.py index 4e350163..f35721be 100644 --- a/pynapple/core/interval_set.py +++ b/pynapple/core/interval_set.py @@ -170,7 +170,7 @@ def __init__(self, start, end=None, time_units="s", **kwargs): self.nap_class = self.__class__.__name__ def __repr__(self): - headers = ["start", "end"] + headers = [" " * 6, "start", "end"] bottom = "shape: {}, time unit: sec.".format(self.shape) rows = _get_terminal_size()[1] @@ -182,17 +182,27 @@ def __repr__(self): warnings.simplefilter("ignore") return ( tabulate( - self.values[0:n_rows], + np.hstack( + (self.index[0:n_rows][:, None], self.values[0:n_rows]) + ), headers=headers, - showindex=self.index[0:n_rows], tablefmt="plain", + colalign=("left", "center", "center"), ) - + "\n\n...\n" + + "\n" + + " " * 10 + + "..." + tabulate( - self.values[-n_rows:], - headers=[" " * 5, " " * 3], # To align properly the columns - showindex=self.index[-n_rows:], + np.hstack( + (self.index[-n_rows:][:, None], self.values[-n_rows:]) + ), + headers=[ + " " * 6, + " " * 5, + " " * 3, + ], # To align properly the columns tablefmt="plain", + colalign=("left", "center", "center"), ) + "\n" + bottom From 6246811dc35eff5324f4b84318dc49303e0f84e5 Mon Sep 17 00:00:00 2001 From: Guillaume Viejo Date: Thu, 18 Apr 2024 13:05:20 -0400 Subject: [PATCH 2/2] Bumping version 0.6.4 --- docs/HISTORY.md | 6 ++++++ pynapple/__init__.py | 2 +- pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/HISTORY.md b/docs/HISTORY.md index 03f6fe38..47f37a51 100644 --- a/docs/HISTORY.md +++ b/docs/HISTORY.md @@ -9,6 +9,12 @@ 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.4 (2024-04-18) +------------------ + +- Fixing IntervalSet `__repr__`. Tabulate conflict with numpy 1.26. + + 0.6.3 (2024-04-17) ------------------ diff --git a/pynapple/__init__.py b/pynapple/__init__.py index cace4e24..49d17880 100644 --- a/pynapple/__init__.py +++ b/pynapple/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.6.3" +__version__ = "0.6.4" from .core import IntervalSet, Ts, Tsd, TsdFrame, TsdTensor, TsGroup, TsIndex, config from .io import * from .process import * diff --git a/pyproject.toml b/pyproject.toml index 22ffc59c..0bd2d464 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pynapple" -version = "0.6.3" +version = "0.6.4" description = "PYthon Neural Analysis Package Pour Laboratoires d’Excellence" readme = "README.md" authors = [{ name = "Guillaume Viejo", email = "guillaume.viejo@gmail.com" }] diff --git a/setup.py b/setup.py index bd8c4614..ef3bb829 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ test_suite='tests', tests_require=test_requirements, url='https://github.com/pynapple-org/pynapple', - version='v0.6.3', + version='v0.6.4', zip_safe=False, long_description_content_type='text/markdown', download_url='https://github.com/pynapple-org/pynapple/archive/refs/tags/v0.6.0.tar.gz'