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

Feature support for NWBv2 #179

Merged
merged 34 commits into from
Jun 5, 2020
Merged

Feature support for NWBv2 #179

merged 34 commits into from
Jun 5, 2020

Conversation

t-b
Copy link
Collaborator

@t-b t-b commented May 30, 2019

Cross links

#22
#179 (TODO list)
AllenInstitute/IPNWB#5
AllenInstitute/IPNWB#16
t-b/ndx-MIES#1

Requires:

Issues:

TODOs:

Close #22.

@t-b
Copy link
Collaborator Author

t-b commented May 30, 2019

@ukos-git Failed NWBv2 export: PXP and NWB
HardwareTests.zip

BasicHardwareTests#UnassociatedChannels_REENTRY(str="ITC18USB_DEV_0")

@t-b
Copy link
Collaborator Author

t-b commented May 30, 2019

@ukos-git The worst bug is fixed in cf57690.
The tests still don't pass.

I think we should:

  • write "PLACEHOLDER" instead of "" for unassociated AD channels (AD 2)
  • Fix the stimulus_description for "DA 2"

@ukos-git
Copy link

ukos-git commented May 31, 2019 via email

@t-b

This comment has been minimized.

@t-b
Copy link
Collaborator Author

t-b commented May 31, 2019

@ukos-git

I don't like the PLACEHOLDER approach in general.

The attribute is mandatory but for unassociated AD channels we don't have a stimset. Don't you think that "PLACEHOLDER" is better than empty?

@ukos-git
Copy link

ukos-git commented Jun 4, 2019

@t-b further changes to hdmf are required to read the json specifications from our NWB file. Same problem as before.

our format with simple dataspace

{
DATASET "/specifications/core/2.0.1/namespace" {
   DATATYPE  H5T_STRING {
      STRSIZE H5T_VARIABLE;
      STRPAD H5T_STR_NULLTERM;
      CSET H5T_CSET_UTF8;
      CTYPE H5T_C_S1;
   }
   DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
   DATA {
   (0): "…"
   }
}
}

crashes here

https://github.com/hdmf-dev/hdmf/blob/8ddc8574123853215a4d6c43d27bd2aec908017d/src/hdmf/backends/hdf5/h5_utils.py#L171-L174

@ukos-git
Copy link

ukos-git commented Jun 4, 2019

@ukos-git Failed NWBv2 export: PXP and NWB

Fails at the IGORWaveNote Attribute of the acquisition wave. probably need a MWE to further investigate this. Maybe the line breaking using <CR>?

@t-b
Copy link
Collaborator Author

t-b commented Jun 5, 2019

@ukos-git Is the latest IPNWB version pushed?

I'm getting here:

From https://github.com/AllenInstitute/IPNWB
 + 44b9cd7...7315b98 feature/nwbv2 -> origin/feature/nwbv2  (forced update)
error: Server does not allow request for unadvertised object 13da2c145a4cbc945f972808050ee0eebdcef74c

@ukos-git
Copy link

ukos-git commented Jun 6, 2019

I guess, you refer to a339bcd. Rebase was necessary due to the huge amount of "changes" and "wip" commit messages. We should probably squash all commits per MR and avoid force pushing, as github looses all commentary etc on force pushes.

@t-b
Copy link
Collaborator Author

t-b commented Jun 6, 2019

I guess, you refer to a339bcd. Rebase was necessary due to the huge amount of "changes" and "wip" commit messages. We should probably squash all commits per MR and avoid force pushing, as github looses all commentary etc on force pushes.

The submodule commit referenced in the parent repo needs to be available as top commit in one of the branches (in git lingo it needs to be the tip of a branch). This is what the error message is complaining about.

Yes github is still not able to handle force pushes and comments properly. That is the reason I'm mainly commenting with non-commit comments.

@ukos-git
Copy link

ukos-git commented Jun 6, 2019

You will probably have to do a hard reset on the MIES repo

▶ git ls-tree feature/nwbv2 IPNWB
160000 commit 7315b98ac805b974a18efe5e5dae0bc131106259	IPNWB
▶ git ls-tree feature/nwbv2~1 IPNWB
160000 commit 13da2c145a4cbc945f972808050ee0eebdcef74c	IPNWB
▶ git ls-tree  a339bcd IPNWB        
160000 commit 13da2c145a4cbc945f972808050ee0eebdcef74c	IPNWB

The current IPNWB commit is over at IPNWB, top commit of branch feature/nwbv2. But a339bcd has an unreferenced (old) commit pointing to 13da2c145a4cbc945f972808050ee0eebdcef74c that should get removed by squashing on merge.

https://github.com/AllenInstitute/IPNWB/commits/feature/nwbv2

@ukos-git
Copy link

ukos-git commented Jun 6, 2019

Traceback (most recent call last):
  File "src/pynwb/validate.py", line 117, in <module>
    main()
  File "src/pynwb/validate.py", line 73, in main
    namespaces = HDF5IO.load_namespaces(catalog, path).keys()
  File "/home/matthias/Documents/Projects/hdmf/src/hdmf/utils.py", line 388, in func_call
    return func(self, **parsed['args'])
  File "/home/matthias/Documents/Projects/hdmf/src/hdmf/backends/hdf5/h5tools.py", line 99, in load_namespaces
    d.update(namespace_catalog.load_namespaces('namespace', reader=reader))
  File "/home/matthias/Documents/Projects/hdmf/src/hdmf/utils.py", line 388, in func_call
    return func(self, **parsed['args'])
  File "/home/matthias/Documents/Projects/hdmf/src/hdmf/spec/namespace.py", line 447, in load_namespaces
    namespaces = reader.read_namespace(namespace_path)
  File "/home/matthias/Documents/Projects/hdmf/src/hdmf/backends/hdf5/h5_utils.py", line 172, in read_namespace
    ret = self.__read(ns_path)
  File "/home/matthias/Documents/Projects/hdmf/src/hdmf/backends/hdf5/h5_utils.py", line 165, in __read
    d = json.loads(s)
  File "/usr/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not ndarray

@t-b
Copy link
Collaborator Author

t-b commented Jun 6, 2019

@ukos-git if you use the latest ipnwb branches the validation against the cached namespace results in the same errors as against the pynwb spec.

@ukos-git
Copy link

ukos-git commented Jun 7, 2019

Do you mean the two 64bit integer errors? - I used the pynwb yaml files without changing the spec but we can not write 64bit integers with current HDF5 XOP.

So it is somewhat expected that cached spec and plain pynwb spec give the same errors.

@t-b
Copy link
Collaborator Author

t-b commented Jun 7, 2019

@ukos-git Yes these errors are expected. But I plan to tweak the pynwb yaml spec so that our files are compliant as well.

@t-b t-b assigned t-b and ukos-git Jun 8, 2019
@t-b
Copy link
Collaborator Author

t-b commented Jun 11, 2019

@ukos-git I've looked into the stimset storage for the unassociated channels. For ADC we don't have one anyway. So only DAC needs some thinking.
And I think the current behaviour in master is correct. Unassociated channels are stored as plain TimeSeries and as that they have, especially for v2, no associated stimset.

@t-b
Copy link
Collaborator Author

t-b commented Oct 4, 2019

Rebased onto latest master.

@t-b t-b force-pushed the feature/nwbv2 branch 2 times, most recently from d804b02 to cc439d9 Compare October 13, 2019 16:42
t-b added 21 commits May 29, 2020 10:55
If that is defined the experiment is never saved.
We want to be notified if a function executing during NWB_ExportAllData
raised an RTE.
… old experiments

Saved experiments prior to 14b1205 (ExpConfig_ConfigureMIES: Close the
user config notebook immediately, 2018-06-26) which used the legacy
experiment configuration have the file UserConfig.txt open as notebook.

This results in the following experiment recreation macro snippet

NewPath MIES ":::Program Files:MIES:"
// ...
OpenNotebook/N=UserConfigNB/R/W=(5.25,44.75,705,500)/V=0/P=MIES "UserConfig.txt"

If one of these experiments is now exported into NWB the user is getting
a Missing File/Folder dialog as UserConfig.txt can not be found.

But if we just create an empty file UserConfig.txt we can trick Igor Pro
into not complaining.
We now check the versions stored in the JSON documents and compare them
to the group names in /specifications and the /nwb_version attribute.
In case we got an abort we don't want to keep the NWB file as it is
incomplete.
This avoids an error on later adding more data into the file.
See also hdmf-dev/hdmf#354.
When we start a new experiment from the current one we don't want to
reuse the old session start time as, not very suprisingly, a new session
has begun.

Noticed by Wayne Wakeman doing mass conversions to NWBv2.
In the previous commit we fixed resetting the session start time on save
and clear.

For existing experiments we need to find a workaround on data export. We
now ignore session start times which are older (45min) than the oldest
sweep.
This function is called from BeforeUncompiledHook and thus needs to
always work. Even with really old experiments which don't have the
expected GUI controls and thus assert out.
@t-b t-b requested a review from timjarsky June 2, 2020 18:30
@t-b t-b assigned timjarsky and unassigned t-b Jun 2, 2020
@t-b
Copy link
Collaborator Author

t-b commented Jun 2, 2020

@timjarsky Ready to merge according to Wayne.

Copy link
Collaborator

@timjarsky timjarsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big day for MIES.

@t-b t-b merged commit 1424f9f into master Jun 5, 2020
@t-b t-b deleted the feature/nwbv2 branch June 5, 2020 19:36
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

Successfully merging this pull request may close these issues.

Add support for exporting into NWBv2 as well
3 participants