Skip to content
Snippets Groups Projects
Commit b02af029 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Created overridable method that makes accessor from np.ndarray

parent 6b7cdc2e
No related branches found
No related tags found
No related merge requests found
......@@ -156,13 +156,17 @@ class PipelineTrace(OrderedDict):
if self.enforce_accessors:
raise NoAccessorsFoundError(f'Pipeline trace expects data accessor type')
else:
acc = InMemoryDataAccessor(value)
acc = self.make_accessor(value)
if not self.allow_overwrite and key in self.keys():
raise KeyAlreadyExists(f'key {key} already exists in pipeline trace')
self.timer.__setitem__(key, self.tfunc() - self.last_time)
self.last_time = self.tfunc()
return super().__setitem__(key, acc)
@staticmethod
def make_accessor(data):
return InMemoryDataAccessor(data)
def append(self, tr, skip_first=True):
new_tr = self.copy()
for k, v in tr.items():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment