Skip to content

Commit

Permalink
chore: improved clarity, after chats with Edan
Browse files Browse the repository at this point in the history
  • Loading branch information
callumtilbury committed Mar 12, 2024
1 parent f918658 commit 88894f8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions flashbax/vault/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def __init__( # noqa: CCR001

print(f"Loading vault found at {self._base_path}")

if compression is not None:
print(
"Requested compression settings will be ignored as the vault already exists."
)

elif experience_structure is not None:
# Create the necessary dirs for the vault
os.makedirs(self._base_path)
Expand Down Expand Up @@ -230,7 +235,6 @@ def _get_base_spec(self, name: str) -> dict:
"base": f"{DRIVER}{self._base_path}",
"path": name,
},
"metadata": {},
}

def _init_leaf(
Expand Down Expand Up @@ -259,9 +263,11 @@ def _init_leaf(
*shape[2:], # Experience dim(s)
)
leaf_dtype = dtype
spec["metadata"]["compressor"] = (
COMPRESSION_DEFAULT if self._compression is None else self._compression
)
spec["metadata"] = {
"compressor": COMPRESSION_DEFAULT
if self._compression is None
else self._compression
}

leaf_ds = ts.open(
spec,
Expand Down

0 comments on commit 88894f8

Please sign in to comment.