From 16f2920d66151c06ee7e9cadec393f4abecf1907 Mon Sep 17 00:00:00 2001 From: gviejo Date: Mon, 16 Oct 2023 14:27:37 -0400 Subject: [PATCH] Fix nwbmatic for pynapple 0.4 --- main.py | 10 ++++++---- nwbmatic/__init__.py | 2 +- nwbmatic/loader.py | 10 +++++----- pyproject.toml | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/main.py b/main.py index 3c631e4..5862792 100644 --- a/main.py +++ b/main.py @@ -5,13 +5,15 @@ import nwbmatic as ntm import os, sys, shutil import pynapple as nap +import numpy as np +import matplotlib.pyplot as plt DATA_DIRECTORY = "your/path/to/A2929-200711" -try: - shutil.rmtree(os.path.join(DATA_DIRECTORY, "pynapplenwb"), ignore_errors=True) -except: - pass +# try: +# shutil.rmtree(os.path.join(DATA_DIRECTORY, "pynapplenwb"), ignore_errors=True) +# except: +# pass # LOADING DATA diff --git a/nwbmatic/__init__.py b/nwbmatic/__init__.py index 3b7065e..5c58b1d 100755 --- a/nwbmatic/__init__.py +++ b/nwbmatic/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.1.0" +__version__ = "0.1.2" from .misc import * diff --git a/nwbmatic/loader.py b/nwbmatic/loader.py index 262f437..1fa7ff2 100644 --- a/nwbmatic/loader.py +++ b/nwbmatic/loader.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # @Author: gviejo # @Date: 2022-01-02 23:30:51 -# @Last Modified by: Guillaume Viejo -# @Last Modified time: 2023-06-07 12:18:37 +# @Last Modified by: gviejo +# @Last Modified time: 2023-10-16 12:29:13 """ BaseLoader is the general class for loading session with pynapple. @@ -229,10 +229,10 @@ def _make_position( position = self.load_default_csv(parameters.loc[i, "csv"]) if alignment.lower() == "local": - start_epoch = nap.format_timestamps( + start_epoch = nap.TsIndex.format_timestamps( epochs.loc[int(parameters.loc[i, "epoch"]), "start"], time_units ) - end_epoch = nap.format_timestamps( + end_epoch = nap.TsIndex.format_timestamps( epochs.loc[int(parameters.loc[i, "epoch"]), "end"], time_units ) timestamps = ( @@ -268,7 +268,7 @@ def _make_position( # start_epoch = format_timestamp( # epochs.loc[parameters.loc[f, "epoch"], "start"], time_units # ) - start_epoch = nap.format_timestamps( + start_epoch = nap.TsIndex.format_timestamps( epochs.loc[int(parameters.loc[i, "epoch"]), "start"], time_units ) timestamps = start_epoch + ttl.index.values diff --git a/pyproject.toml b/pyproject.toml index 867e2f7..52f9a82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "nwbmatic" -version = "0.1.0" +version = "0.1.2" description = "NWB creator from various data streams" readme = "README.md" authors = [{ name = "Guillaume Viejo", email = "guillaume.viejo@gmail.com" }]