Skip to content

Commit

Permalink
Update builders.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored Nov 15, 2024
1 parent 26d584c commit cbebbb4
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/hdmf/build/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from datetime import datetime, date

import numpy as np
from h5py import RegionReference

from ..utils import docval, getargs, get_docval

Expand Down Expand Up @@ -320,11 +319,10 @@ def values(self):

class DatasetBuilder(BaseBuilder):
OBJECT_REF_TYPE = 'object'
REGION_REF_TYPE = 'region'

@docval({'name': 'name', 'type': str, 'doc': 'The name of the dataset.'},
{'name': 'data',
'type': ('array_data', 'scalar_data', 'data', 'DatasetBuilder', 'RegionBuilder', Iterable, datetime, date),
'type': ('array_data', 'scalar_data', 'data', 'DatasetBuilder', Iterable, datetime, date),
'doc': 'The data in this dataset.', 'default': None},
{'name': 'dtype', 'type': (type, np.dtype, str, list),
'doc': 'The datatype of this dataset.', 'default': None},
Expand Down Expand Up @@ -430,19 +428,3 @@ def builder(self):
"""The target builder object."""
return self['builder']


class RegionBuilder(ReferenceBuilder):

@docval({'name': 'region', 'type': (slice, tuple, list, RegionReference),
'doc': 'The region, i.e. slice or indices, into the target dataset.'},
{'name': 'builder', 'type': DatasetBuilder, 'doc': 'The dataset this region reference applies to.'})
def __init__(self, **kwargs):
"""Create a builder object for a region reference."""
region, builder = getargs('region', 'builder', kwargs)
super().__init__(builder)
self['region'] = region

@property
def region(self):
"""The selected region of the target dataset."""
return self['region']

0 comments on commit cbebbb4

Please sign in to comment.