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

Epoch name appears to clobber other parts of file #646

Closed
4 tasks done
nicain opened this issue Oct 4, 2018 · 1 comment
Closed
4 tasks done

Epoch name appears to clobber other parts of file #646

nicain opened this issue Oct 4, 2018 · 1 comment
Milestone

Comments

@nicain
Copy link
Contributor

nicain commented Oct 4, 2018

1) Bug

Steps to Reproduce

try:

    for name in ['epochs','fizzbuzz' , 'stimulus']:

        filename = os.path.join(gettempdir(), "test_%s.nwb" % name)

        nwbfile_out = NWBFile(
            source='Data source',
            session_description='test foraging2',
            identifier='behavior_session_uuid',
            session_start_time=datetime.datetime.now(),
            file_create_date=datetime.datetime.now(),
            epochs = Epochs(source='foo', name=name)#epoch_table
        )

        with NWBHDF5IO(filename, mode='w') as io:
            io.write(nwbfile_out)

        nwbfile_in = NWBHDF5IO(filename, mode='r').read()
        print nwbfile_in.epochs.name

except Exception as e:
    
    traceback.print_exc(limit=2)

output:

epochs
fizzbuzz
Traceback (most recent call last):
  File "/home/nicholasc/projects/pynwb/issues/epochs/sandbox.py", line 30, in <module>
    nwbfile_in = NWBHDF5IO(filename, mode='r').read()
  File "/home/nicholasc/projects/pynwb/src/pynwb/form/utils.py", line 343, in func_call
    return func(self, **parsed['args'])
ValueError: builder 'templates' does not have a data_type

Environment

Please describe your environment according to the following bullet points.

  • Python Executable: Conda
  • **Python Version:**Python 3.6
  • Operating System: Linux
  • Pynwb Version: git tag latest, branch dev

Problem/Use Case

Briefly describe the needed feature as well as the reasoning behind it

It appears that the name a user gives an Epoch object when constructing the file is a keyword, and can clobber the other componenets of an NWBFile on write.

Checklist

  • Have you ensured the feature or change was not already reported ?
  • Have you included a brief and descriptive title?
  • Have you included a clear description of the problem you are trying to solve?
  • Have you included a minimal code snippet that reproduces the issue you are encountering?
@ajtritt
Copy link
Member

ajtritt commented Oct 4, 2018

#633 will address this. Right now, ObjectMapper doesn't see that the name is specified to be "epochs". When building the /epochs GroupBuilder, it only works off of the neurodata_type_def specification (i.e. from nwb.epochs.yaml) and doesn't see that NWBFile has set it's name to be "epochs".

@oruebel oruebel added this to the NWB 2.x milestone Dec 19, 2018
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

4 participants