Source code for allensdk.internal.mouse_connectivity.interval_unionize.unionize_record
from six import iteritems
[docs]class Unionize(object):
'''Abstract base class for unionize records.
'''
def __init__(self, *args, **kwargs):
raise NotImplementedError()
[docs] def calculate(self, *args, **kwargs):
raise NotImplementedError()
[docs] def propagate(self, ancestor, copy_all, *args, **kwargs):
raise NotImplementedError()
[docs] def output(self, *args, **kwargs):
raise NotImplementedError()
[docs] def slice_arrays(self, low, high, data_arrays):
'''Extract a slice from several aligned arrays
Parameters
----------
low : int
start of slice, inclusive
high : int
end of slice, exclusive
data_arrays : dict
keys are varieties of data. values are sorted, flattened
data arrays
'''
return {k: v[low:high] for k, v in iteritems(data_arrays)}