Skip to content

Commit

Permalink
backwards compat seems to work
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Sep 30, 2024
1 parent be0614c commit c97a0df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/pynwb/io/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,22 @@ def scratch(self, builder, manager):
ret.append(manager.construct(d))
return tuple(ret) if len(ret) > 0 else None

@ObjectMapper.constructor_arg('electrodes')
def electrodes(self, builder, manager):
electrodes_builder = builder['general']['extracellular_ephys']['electrodes']

if (electrodes_builder is not None and electrodes_builder.attributes['neurodata_type'] != 'ElectrodesTable'):
electrodes_builder.attributes['neurodata_type'] = 'ElectrodesTable'
electrodes_builder.attributes['namespace'] = 'core'

new_container = manager.construct(electrodes_builder, True)
# mapper = manager.get_map(electrodes_builder)
breakpoint()
return new_container
else:
return None


@ObjectMapper.constructor_arg('session_start_time')
def dateconversion(self, builder, manager):
"""Set the constructor arg for 'session_start_time' to a datetime object.
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/foo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
nwbfile.electrodes = table
nwbfile.add_electrode_group(group)
nwbfile.add_electrode(group=group, location='brain')
breakpoint()
# breakpoint()
# nwbfile.add_electrode_column(name="label", description="label of electrode")

# nshanks = 4
Expand Down

0 comments on commit c97a0df

Please sign in to comment.