Skip to content

Commit

Permalink
fix(tensorstore): Swap path to str
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Nov 11, 2024
1 parent f66b590 commit a30564c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/nwp_consumer/internal/entities/tensorstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class TensorStore(abc.ABC):
name: str
"""Identifier for the store and the data within."""

path: pathlib.Path
path: str
"""The path to the store."""

coordinate_map: NWPDimensionCoordinateMap
Expand Down Expand Up @@ -355,7 +355,7 @@ def scan_parameter_values(self, p: Parameter) -> ResultE[ParameterScanResult]:
),
)

def postprocess(self, options: PostProcessOptions) -> ResultE[pathlib.Path]:
def postprocess(self, options: PostProcessOptions) -> ResultE[str]:
"""Post-process the store.
This creates a new store, as many of the postprocess options require
Expand All @@ -374,14 +374,14 @@ def postprocess(self, options: PostProcessOptions) -> ResultE[pathlib.Path]:
else:
return Success(self.path)

def update_attrs(self, attrs: dict[str, str]) -> ResultE[pathlib.Path]:
def update_attrs(self, attrs: dict[str, str]) -> ResultE[str]:
"""Update the attributes of the store.
This method updates the attributes of the store with the given dictionary.
"""
group: zarr.Group = zarr.open_group(self.path.as_posix())
group: zarr.Group = zarr.open_group(self.path)
group.attrs.update(attrs)
zarr.consolidate_metadata(self.path.as_posix())
zarr.consolidate_metadata(self.path)
return Success(self.path)

def missing_times(self) -> ResultE[list[dt.datetime]]:
Expand Down
1 change: 1 addition & 0 deletions src/nwp_consumer/internal/services/archiver_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ def archive(self, year: int, month: int) -> ResultE[pathlib.Path]:
return Failure(
TypeError(f"Unexpected result type: {type(init_store_result)}"),
)

0 comments on commit a30564c

Please sign in to comment.