Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions src/nwb_benchmarks/benchmarks/network_tracking_remote_slicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,25 @@ def setup(self, params: dict[str, str | Tuple[slice]]):
self.data_to_slice = self.neurodata_object.data


class HDF5PyNWBROS3PreloadedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote HDF5 NWB files using pynwb and the ROS3 driver with preloaded
data.
"""

params = hdf5_params

def setup(self, params: dict[str, str | Tuple[slice]]):
https_url = params["https_url"]
object_name = params["object_name"]
slice_range = params["slice_range"]

self.nwbfile, self.io, _ = read_hdf5_pynwb_ros3(https_url=https_url)
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data
self._temp = self.data_to_slice[slice_range]


class LindiLocalJSONContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote HDF5 NWB files by reading the local LINDI JSON files with
Expand Down Expand Up @@ -350,6 +369,24 @@ def setup(self, params: dict[str, str | Tuple[slice]]):
self.data_to_slice = self.neurodata_object.data


class ZarrPyNWBS3PreloadedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote Zarr NWB files using pynwb with S3 with preloaded data.
"""

params = zarr_params

def setup(self, params: dict[str, str | Tuple[slice]]):
https_url = params["https_url"]
object_name = params["object_name"]
slice_range = params["slice_range"]

self.nwbfile, self.io = read_zarr_pynwb_s3(https_url=https_url, mode="r")
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data
self._temp = self.data_to_slice[slice_range]


class ZarrPyNWBS3ForceNoConsolidatedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote Zarr NWB files using pynwb with S3 and without using
Expand All @@ -365,3 +402,22 @@ def setup(self, params: dict[str, str | Tuple[slice]]):
self.nwbfile, self.io = read_zarr_pynwb_s3(https_url=https_url, mode="r-")
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data


class ZarrPyNWBS3ForceNoConsolidatedPreloadedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote Zarr NWB files using pynwb with S3 and without using
consolidated metadata with preloaded data.
"""

params = zarr_params

def setup(self, params: dict[str, str | Tuple[slice]]):
https_url = params["https_url"]
object_name = params["object_name"]
slice_range = params["slice_range"]

self.nwbfile, self.io = read_zarr_pynwb_s3(https_url=https_url, mode="r-")
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data
self._temp = self.data_to_slice[slice_range]
56 changes: 56 additions & 0 deletions src/nwb_benchmarks/benchmarks/time_remote_slicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,25 @@ def setup(self, params: dict[str, str | Tuple[slice]]):
self.data_to_slice = self.neurodata_object.data


class HDF5PyNWBROS3PreloadedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote HDF5 NWB files using pynwb and the ROS3 driver with preloaded
data.
"""

params = hdf5_params

def setup(self, params: dict[str, str | Tuple[slice]]):
https_url = params["https_url"]
object_name = params["object_name"]
slice_range = params["slice_range"]

self.nwbfile, self.io, _ = read_hdf5_pynwb_ros3(https_url=https_url)
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data
self._temp = self.data_to_slice[slice_range]


class LindiLocalJSONContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote HDF5 NWB files by reading the local LINDI JSON files with
Expand Down Expand Up @@ -338,6 +357,24 @@ def setup(self, params: dict[str, str | Tuple[slice]]):
self.data_to_slice = self.neurodata_object.data


class ZarrPyNWBS3PreloadedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote Zarr NWB files using pynwb with S3 with preloaded data.
"""

params = zarr_params

def setup(self, params: dict[str, str | Tuple[slice]]):
https_url = params["https_url"]
object_name = params["object_name"]
slice_range = params["slice_range"]

self.nwbfile, self.io = read_zarr_pynwb_s3(https_url=https_url, mode="r")
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data
self._temp = self.data_to_slice[slice_range]


class ZarrPyNWBS3ForceNoConsolidatedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote Zarr NWB files using pynwb with S3 and without using
Expand All @@ -353,3 +390,22 @@ def setup(self, params: dict[str, str | Tuple[slice]]):
self.nwbfile, self.io = read_zarr_pynwb_s3(https_url=https_url, mode="r-")
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data


class ZarrPyNWBS3ForceNoConsolidatedPreloadedContinuousSliceBenchmark(ContinuousSliceBenchmark):
"""
Time the read of a continuous data slice from remote Zarr NWB files using pynwb with S3 and without using
consolidated metadata with preloaded data.
"""

params = zarr_params

def setup(self, params: dict[str, str | Tuple[slice]]):
https_url = params["https_url"]
object_name = params["object_name"]
slice_range = params["slice_range"]

self.nwbfile, self.io = read_zarr_pynwb_s3(https_url=https_url, mode="r-")
self.neurodata_object = get_object_by_name(nwbfile=self.nwbfile, object_name=object_name)
self.data_to_slice = self.neurodata_object.data
self._temp = self.data_to_slice[slice_range]
Loading