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

ScratchData notes passed as None instead of empty string in add_scratch #1307

Closed
3 of 5 tasks
lvsltz opened this issue Oct 15, 2020 · 1 comment · Fixed by #1309
Closed
3 of 5 tasks

ScratchData notes passed as None instead of empty string in add_scratch #1307

lvsltz opened this issue Oct 15, 2020 · 1 comment · Fixed by #1309
Labels
category: bug errors in the code or code behavior

Comments

@lvsltz
Copy link

lvsltz commented Oct 15, 2020

Description

If an np.ndarray is added in scratch with nwbfile.add_scratch(ndarray,name='some_name') without a notes argument, ScratchData is created with notes = None and fails with
TypeError: ScratchData.__init__: incorrect type for 'notes' (got 'NoneType', expected 'str')

Adding something like this before https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/src/pynwb/file.py#L695 should fix it.

if notes is None:
    notes = ''

Steps to Reproduce

data = np.random.randint(0,30,(5,9))
nwbfile.add_scratch(data, name = 'some_name')

Environment

Python Executable: Conda
Python Version: 3.7
Operating System: Linux
HDMF Version: pynwb 1.3.3, hdmf 1.6.4

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?
  • Have you checked our Contributing document?
@lvsltz lvsltz added the category: bug errors in the code or code behavior label Oct 15, 2020
@rly rly mentioned this issue Oct 29, 2020
5 tasks
@bendichter
Copy link
Contributor

Thank, @lvsltz! Looks like Ryan is on this.

@rly rly closed this as completed in #1309 Nov 4, 2020
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