-
Notifications
You must be signed in to change notification settings - Fork 30
Repack Nwb Files #1003
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
Open
pauladkisson
wants to merge
79
commits into
main
Choose a base branch
from
repack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Repack Nwb Files #1003
Changes from 3 commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
7304229
setup temp conversion script
pauladkisson 4cc2a06
added from_existing_neurodata_object for hdf5
pauladkisson c33dfbf
added get_existing_dataset_io_configurations
pauladkisson 80c1fba
added support for chunk_shape=None
pauladkisson 7ee6fc6
added from_existing_nwbfile to HDF5BackendConfiguration
pauladkisson dacdeea
added get_existing_backend_configuration
pauladkisson dae04bf
added repack_nwbfile
pauladkisson 4ac6e33
fixed bug with export options and hdmf.container.Container.set_data_io
pauladkisson ce267fb
refactored from_ methods
pauladkisson 49f4262
template and changes optional
pauladkisson d93a5c5
added image series test
pauladkisson ab8b22f
Merge branch 'main' into repack
bendichter 934bb3a
Merge branch 'main' into repack
pauladkisson 1ad69ca
added initial test
pauladkisson 04fb89c
updated signature to use file_path
pauladkisson 6dab477
added test for trials table (fails)
pauladkisson e6d31a6
moved backend_configuration_changes to top of the fn
pauladkisson 7252449
consolidated configure_and_export_nwbfile into configure_and_write_nw…
pauladkisson 2ef5c44
parameterized for use_default_backend_configuration
pauladkisson 80eb598
optional dci
pauladkisson 433f8c9
added test for backend config changes
pauladkisson dd906ac
updated api to use boolean use_default flag instead of mode=existing
pauladkisson 668cacc
added test for get_existing_backend_configuration
pauladkisson 7796197
removed image_series test
pauladkisson b8a788c
added compressed trials table column
pauladkisson f631fb4
added test for get_existing_dataset_io.py
pauladkisson b089eb3
Merge branch 'main' into repack
pauladkisson c464764
added docstrings
pauladkisson 1cf3629
used BACKEND_NWB_IO dict
pauladkisson 481529f
added ZarrDatsetIOConfiguration.from_neurodata_object
pauladkisson 1e6b119
Merge branch 'main' into repack
bendichter 9f02b61
removed unnecessary indent
pauladkisson 9ee146f
estimate buffer shape
pauladkisson ee7ec52
updated temp_test
pauladkisson a2145a1
added zarr to dataset_io tests
pauladkisson 5785af0
added zarr to backend_configuration tests
pauladkisson b07c002
added zarr to repack_nwbfile tests
pauladkisson a8c57e8
Merge branch 'main' into repack
pauladkisson ad641ef
fixed merge
pauladkisson 8d8689f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3d43e78
Merge branch 'main' into repack
pauladkisson 893b6d1
Merge branch 'main' into repack
h-mayorquin 7219620
Merge branch 'main' into repack
pauladkisson 4d70904
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 54d8a5e
added builders to the default io configs
pauladkisson caebf5b
updated temp_test
pauladkisson 13ea990
updated configure_backend to only use dci if the dataset isn't alread…
pauladkisson 440cb8a
added support for changing backends
pauladkisson 05b225b
added support for automatic backend detection for get_existing_datase…
pauladkisson 093a826
refactored dataset_io's to minimize code duplication
pauladkisson 210650d
updated configure_backend to use a sensible default buffer_size
pauladkisson 8d039e6
Merge branch 'main' into repack
pauladkisson 1364b8a
fixed test_configure_backend_equivalency
pauladkisson 280e37c
updated changelog
pauladkisson 4c135b3
switched from deprecated output_path to new nwbfile_path
pauladkisson ddd1630
updated image_series test to be compatible with latest pynwb
pauladkisson 0c9aa55
added existing configuration section to the docs
pauladkisson cfbf523
added existing configuration section to the docs
pauladkisson 8069657
switched to math.prod
pauladkisson cba1738
added test for pixel_mask for configure_backend
pauladkisson b6bf29f
updated configure_backend to work with compound dtypes
pauladkisson c4d9c8d
added pixel_mask PlaneSegmentation to repack_nwbfile tests
pauladkisson 9f7f63e
added tests for pixel_mask PlaneSegmentation (compound dtype) and som…
pauladkisson 299c5be
Merge branch 'main' into repack
pauladkisson da63806
Merge branch 'main' into repack
pauladkisson 0a9b563
added tests for edge cases
pauladkisson 0dfaf08
fully automatic backend for get_existing_dataset_io_configuration
pauladkisson fa7bcf9
Merge branch 'main' into repack
pauladkisson 360b7dd
de-hacked nested dataset case
pauladkisson 17e4893
Merge branch 'main' into repack
pauladkisson 34f9650
py:method
pauladkisson 1f1c629
added section for repack
pauladkisson ce16be7
Merge branch 'main' into repack
pauladkisson 61bce66
switched from Union to |
pauladkisson 6e19842
Merge branch 'main' into repack
pauladkisson 943c674
updated temp_test
pauladkisson 4021ad9
updated zarr tests to use pixel_mask
pauladkisson d664c66
updated test_repack_nwbfile_with_changes to use pixel_mask
pauladkisson 18108cd
updated hdmf2zarr and zarr_to_hdmf tests to use pixel_mask
pauladkisson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import numpy as np | ||
from pynwb import NWBHDF5IO, H5DataIO, TimeSeries | ||
from pynwb.testing.mock.file import mock_NWBFile | ||
|
||
from neuroconv.tools.nwb_helpers._dataset_configuration import ( | ||
get_existing_dataset_io_configurations, | ||
) | ||
|
||
|
||
def write_nwbfile(nwbfile_path: Path): | ||
if nwbfile_path.exists(): | ||
os.remove(nwbfile_path) | ||
nwbfile = mock_NWBFile() | ||
timestamps = np.arange(10.0) | ||
data = np.arange(100, 200, 10) | ||
time_series_with_timestamps = TimeSeries( | ||
name="test_timeseries", | ||
description="an example time series", | ||
data=H5DataIO(data=data, compression="gzip", chunks=(1,), compression_opts=2), | ||
unit="m", | ||
timestamps=H5DataIO( | ||
timestamps, compression="gzip", chunks=(1,), compression_opts=2 | ||
), # TODO: add support for uncompressed timestamps | ||
) | ||
nwbfile.add_acquisition(time_series_with_timestamps) | ||
with NWBHDF5IO(nwbfile_path, mode="w") as io: | ||
io.write(nwbfile) | ||
|
||
|
||
def main(): | ||
nwbfile_path = Path("/Volumes/T7/CatalystNeuro/temp.nwb") | ||
write_nwbfile(nwbfile_path) | ||
with NWBHDF5IO(nwbfile_path, mode="r") as io: | ||
nwbfile = io.read() | ||
existing_dataset_io_configurations = get_existing_dataset_io_configurations(nwbfile, backend="hdf5") | ||
for dataset_io_configuration in existing_dataset_io_configurations: | ||
print(dataset_io_configuration) | ||
pauladkisson marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.