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]: v2.1.0 ElectrodeTable cols #1497

Closed
3 tasks done
CodyCBakerPhD opened this issue Jul 7, 2022 · 3 comments · May be fixed by #1539
Closed
3 tasks done

[Bug]: v2.1.0 ElectrodeTable cols #1497

CodyCBakerPhD opened this issue Jul 7, 2022 · 3 comments · May be fixed by #1539
Labels
category: bug errors in the code or code behavior

Comments

@CodyCBakerPhD
Copy link
Collaborator

What happened?

Just ran across this in the NWBInspector CI.

Steps to Reproduce

from pynwb.file import ElectrodeTable

table = ElectrodeTable(
    name="electrodes",  # default name when building through nwbfile
)
table.add_row(
    x=1.0,
    location="unknown",
    group=ElectrodeGroup(name="test_group", description="", device=Device(name="test_device"), location="unknown"),
    group_name="test_group",
)

Traceback

Traceback (most recent call last):

  File "C:\Users\Raven\AppData\Local\Temp\ipykernel_18220\3595234109.py", line 6, in <cell line: 6>
    table.add_row(

  File "C:\Users\Raven\.conda\envs\nwbinspector\lib\site-packages\hdmf\utils.py", line 593, in func_call
    return func(args[0], **pargs)

  File "C:\Users\Raven\.conda\envs\nwbinspector\lib\site-packages\hdmf\common\table.py", line 595, in add_row
    raise ValueError(

ValueError: row data keys don't match available columns
you supplied 1 extra keys: {'x'}
and were missing 0 keys: set()

Operating System

Windows

Python Executable

Python

Python Version

3.9

Package Versions

environment_for_issue.txt

Code of Conduct

@CodyCBakerPhD CodyCBakerPhD added the category: bug errors in the code or code behavior label Jul 7, 2022
@CodyCBakerPhD
Copy link
Collaborator Author

Or is this now intended behavior, and you're supposed to add such things as columns only (not by-row?)

@rly
Copy link
Contributor

rly commented Jul 7, 2022

This is a bug and not intended behavior. I'll take a look.

@rly
Copy link
Contributor

rly commented Jul 8, 2022

As an aside, because currently ElectrodeTable is not its own neurodata_type (yet), in PyNWB, ElectrodeTable is not its own class and is not meant to be initialized on its own. But I can see how that is not obvious. And since we plan to make ElectrodeTable its own class, this behavior will need to work anyway.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants