Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resetting data and timestamps on TimeSeries #1752

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/pynwb/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def __init__(self, **kwargs):
setattr(self, key, val)

data = args_to_process['data']
self.fields['data'] = data
self.data = data
if isinstance(data, TimeSeries):
data.__add_link('data_link', self)

Expand All @@ -177,7 +177,7 @@ def __init__(self, **kwargs):
raise ValueError('Specifying rate and timestamps is not supported.')
if self.starting_time is not None:
raise ValueError('Specifying starting_time and timestamps is not supported.')
self.fields['timestamps'] = timestamps
self.timestamps = timestamps
self.timestamps_unit = self.__time_unit
self.interval = 1
if isinstance(timestamps, TimeSeries):
Expand Down Expand Up @@ -252,6 +252,10 @@ def data(self):
else:
return self.fields['data']

@data.setter
def data(self, val):
self.fields['data'] = val

@property
def data_link(self):
return self.__get_links('data_link')
Expand All @@ -265,6 +269,10 @@ def timestamps(self):
else:
return self.fields['timestamps']

@timestamps.setter
def timestamps(self, val):
self.fields['timestamps'] = val

@property
def timestamp_link(self):
return self.__get_links('timestamp_link')
Expand Down