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

[Bug]: Cannot add "bounds" attribute to SpatialSeries/data #1992

Open
3 tasks done
rly opened this issue Nov 15, 2024 · 0 comments
Open
3 tasks done

[Bug]: Cannot add "bounds" attribute to SpatialSeries/data #1992

rly opened this issue Nov 15, 2024 · 0 comments

Comments

@rly
Copy link
Contributor

rly commented Nov 15, 2024

What happened?

In NeurodataWithoutBorders/nwb-schema#567 (pending NWB schema 2.8.0), we added a new optional "bounds" field to "SpatialSeries/data". It turns out that the current version of PyNWB / HDMF does not support writing (and probably also validating) additional attributes to untyped datasets like "data". I am surprised that we have not encountered this before.

This line in HDMF's ObjectMapper https://github.com/hdmf-dev/hdmf/blob/26d584cc0a3e0985d0e053ab9eeaf5bf8849cd31/src/hdmf/build/objectmapper.py#L1107
does not add new attributes from the new spec.

The issue appears to be due to resolution of the spec. I will open a ticket in HDMF.

While we resolve this in HDMF, I propose we revert the addition of "bounds" to "SpatialSeries/data" to unblock the other schema/pynwb issues.

Steps to Reproduce

import numpy as np

from pynwb.behavior import SpatialSeries
from pynwb.testing import AcquisitionH5IOMixin, TestCase


class TestSpatialSeriesIO(AcquisitionH5IOMixin, TestCase):

    def setUpContainer(self):
        """ Return the test TimeSeries to read/write """
        return SpatialSeries(
            name='test_sS',
            data=np.ones((3, 2)),
            data__bounds=[(-1,1),(-1,1),(-1,1)],
            reference_frame='reference_frame',
            timestamps=[1., 2., 3.]
        )

Traceback

# data__bounds is not written

Operating System

macOS

Python Executable

Conda

Python Version

3.11

Package Versions

No response

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant