Skip to content

Commit f05027e

Browse files
authored
Temporarily revert fix for SpatialSeries.bounds (#1996)
1 parent ab9dd9c commit f05027e

File tree

5 files changed

+4
-15
lines changed

5 files changed

+4
-15
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Enhancements and minor changes
66
- Added support for NWB schema 2.8.0:
7-
- Fixed support for `data__bounds` field to `SpatialSeries` to set optional boundary range (min, max) for each dimension of data. Removed `SpatialSeries.bounds` field that was not functional. @rly [#1907](https://github.com/NeurodataWithoutBorders/pynwb/pull/1907)
7+
- Removed `SpatialSeries.bounds` field that was not functional. This will be fixed in a future release. @rly [#1907](https://github.com/NeurodataWithoutBorders/pynwb/pull/1907),
88

99
## PyNWB 2.8.3 (Upcoming)
1010

docs/gallery/domain/plot_behavior.py

-4
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,13 @@
105105
#
106106
# For position data ``reference_frame`` indicates the zero-position, e.g.
107107
# the 0,0 point might be the bottom-left corner of an enclosure, as viewed from the tracking camera.
108-
# In :py:class:`~pynwb.behavior.SpatialSeries`, the ``data__bounds`` field allows the user to set
109-
# the boundary range, i.e., (min, max), for each dimension of ``data``. The units are the same as in ``data``.
110-
# This field does not enforce a boundary on the dataset itself.
111108

112109
timestamps = np.linspace(0, 50) / 200
113110

114111
position_spatial_series = SpatialSeries(
115112
name="SpatialSeries",
116113
description="Position (x, y) in an open field.",
117114
data=position_data,
118-
data__bounds=[(0,50), (0,50)],
119115
timestamps=timestamps,
120116
reference_frame="(0,0) is bottom left corner",
121117
)

src/pynwb/behavior.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ class SpatialSeries(TimeSeries):
2020
tracking camera. The unit of data will indicate how to interpret SpatialSeries values.
2121
"""
2222

23-
__nwbfields__ = ('data__bounds', 'reference_frame',)
23+
__nwbfields__ = ('reference_frame',)
2424

2525
@docval(*get_docval(TimeSeries.__init__, 'name'), # required
2626
{'name': 'data', 'type': ('array_data', 'data', TimeSeries), 'shape': ((None, ), (None, None)), # required
2727
'doc': ('The data values. Can be 1D or 2D. The first dimension must be time. If 2D, there can be 1, 2, '
2828
'or 3 columns, which represent x, y, and z.')},
29-
{'name': 'data__bounds', 'type': ('data', 'array_data'), 'shape': ((1, 2), (2, 2), (3, 2)), 'default': None,
30-
'doc': 'The boundary range (min, max) for each dimension of data.'},
3129
{'name': 'reference_frame', 'type': str,
3230
'doc': 'description defining what the zero-position is', 'default': None},
3331
{'name': 'unit', 'type': str, 'doc': 'The base unit of measurement (should be SI unit)',
@@ -38,8 +36,8 @@ def __init__(self, **kwargs):
3836
"""
3937
Create a SpatialSeries TimeSeries dataset
4038
"""
41-
name, data, data__bounds, reference_frame, unit = popargs(
42-
'name', 'data', 'data__bounds', 'reference_frame', 'unit', kwargs
39+
name, data, reference_frame, unit = popargs(
40+
'name', 'data', 'reference_frame', 'unit', kwargs
4341
)
4442
super().__init__(name, data, unit, **kwargs)
4543

@@ -51,7 +49,6 @@ def __init__(self, **kwargs):
5149
"The second dimension should have length <= 3 to represent at most x, y, z." %
5250
(name, str(data_shape)))
5351

54-
self.data__bounds = data__bounds
5552
self.reference_frame = reference_frame
5653

5754
@staticmethod

tests/integration/hdf5/test_behavior.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def setUpContainer(self):
1111
return SpatialSeries(
1212
name='test_sS',
1313
data=np.ones((3, 2)),
14-
data__bounds=[(-1,1),(-1,1),(-1,1)],
1514
reference_frame='reference_frame',
1615
timestamps=[1., 2., 3.]
1716
)

tests/unit/test_behavior.py

-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ def test_init(self):
1212
sS = SpatialSeries(
1313
name='test_sS',
1414
data=np.ones((3, 2)),
15-
data__bounds=[(-1,1),(-1,1),(-1,1)],
1615
reference_frame='reference_frame',
1716
timestamps=[1., 2., 3.]
1817
)
1918
self.assertEqual(sS.name, 'test_sS')
2019
self.assertEqual(sS.unit, 'meters')
21-
self.assertEqual(sS.data__bounds, [(-1,1),(-1,1),(-1,1)])
2220
self.assertEqual(sS.reference_frame, 'reference_frame')
2321

2422
def test_init_minimum(self):
@@ -27,7 +25,6 @@ def test_init_minimum(self):
2725
data=np.ones((3, 2)),
2826
timestamps=[1., 2., 3.]
2927
)
30-
assert sS.bounds is None
3128
assert sS.reference_frame is None
3229

3330
def test_set_unit(self):

0 commit comments

Comments
 (0)