Skip to content

Commit

Permalink
Merge pull request #124 from josephnowak/feature/general-improvements
Browse files Browse the repository at this point in the history
The append and update method were refactored to improve its efficienc…
  • Loading branch information
josephnowak authored Sep 7, 2024
2 parents 4317c50 + 82ac6ff commit 6e65a15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tensordb/storages/zarr_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def __init__(
synchronizer = synchronizer(path=lock_path)

self.chunks = chunks
if self.chunks is None:
self.chunks = {}
self.synchronizer = synchronizer
self.unique_coords = unique_coords or {}
self.sorted_coords = sorted_coords or {}
Expand Down Expand Up @@ -125,7 +127,7 @@ def _transform_to_dataset(self, new_data, chunk_data: bool = True) -> xr.Dataset
new_data = new_data.to_dataset(name=self.data_names)

if chunk_data:
new_data = new_data if self.chunks is None else new_data.chunk(self.chunks)
new_data = new_data.chunk(self.chunks)
return new_data

def append_preview(
Expand Down

0 comments on commit 6e65a15

Please sign in to comment.