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 · 1 comment
Open
3 tasks done

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

rly opened this issue Nov 15, 2024 · 1 comment
Assignees
Labels
category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users
Milestone

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

@stephprince
Copy link
Contributor

I think reverting the addition of "bounds" to "SpatialSeries/data" makes sense until we can resolve this issue in HDMF and support writing additional attributes for untyped datasets.

@rly rly added the category: bug errors in the code or code behavior label Nov 19, 2024
@rly rly self-assigned this Nov 19, 2024
@rly rly added the priority: medium non-critical problem and/or affecting only a small set of NWB users label Nov 19, 2024
@rly rly added this to the Future milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users
Projects
None yet
Development

No branches or pull requests

2 participants