Skip to content

Commit

Permalink
Fix nwbmatic for pynapple 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gviejo committed Oct 16, 2023
1 parent 37b0498 commit 16f2920
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
10 changes: 6 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nwbmatic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.1.0"
__version__ = "0.1.2"
from .misc import *
10 changes: 5 additions & 5 deletions nwbmatic/loader.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }]
Expand Down

0 comments on commit 16f2920

Please sign in to comment.