diff --git a/src/nwp_consumer/internal/entities/tensorstore.py b/src/nwp_consumer/internal/entities/tensorstore.py index 53a02de7..f8d368fe 100644 --- a/src/nwp_consumer/internal/entities/tensorstore.py +++ b/src/nwp_consumer/internal/entities/tensorstore.py @@ -145,8 +145,8 @@ def initialize_empty_store( "region_name": os.getenv("AWS_REGION", "eu-west-1"), }, ) - store = s3fs.mapping.S3Map(zarrdir, fs, check=True, create=True) - path = zarrdir + path = zarrdir + "/" + TensorStore.gen_store_filename(coords=coords) + store = s3fs.mapping.S3Map(path, fs, check=True, create=True) except Exception as e: return Failure(OSError( f"Unable to create file mapping for ZARRDIR '{zarrdir}'. " @@ -164,7 +164,7 @@ def initialize_empty_store( # Write the coordinates to a skeleton Zarr store # * 'compute=False' enables only saving metadata # * 'mode="w"' overwrites any existing store - log.info("Initialising zarr store at '%s'", store) + log.info("Initialising zarr store at '%s'", path) da: xr.DataArray = coords.as_zeroed_dataarray(name=model) encoding = { model: {"write_empty_chunks": False}, @@ -184,7 +184,7 @@ def initialize_empty_store( except Exception as e: return Failure( OSError( - f"Failed writing blank store to disk: {e}", + f"Failed writing blank store to '{path}': {e}", ), ) @@ -194,7 +194,7 @@ def initialize_empty_store( return Failure( OSError( f"Error reading back coordinates of initialized store " - f"from disk (possible corruption): {coordinate_map_result}", + f"from path '{path}' (possible corruption): {coordinate_map_result}", ), )