Skip to content

Commit 66c9826

Browse files
committed
expand policy spec s3 docstring
1 parent 41a20de commit 66c9826

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/mettagrid/python/src/mettagrid/policy/prepare_policy_spec.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,19 @@ def load_policy_spec_from_s3(
186186
*,
187187
device: str | None = None,
188188
) -> PolicySpec:
189-
"""Download a submission archive or checkpoint dir from S3 into cache and return a PolicySpec.
189+
"""Download a submission archive or checkpoint dir from S3 and return a PolicySpec ready for loading.
190190
191-
Caches by URI hash; applies device override when provided.
191+
Downloads into a deterministic cache location based on the URI hash, allowing
192+
reuse across calls with the same URI.
193+
194+
Args:
195+
s3_path: S3 path to a submission archive (.zip) or checkpoint directory
196+
cache_dir: Base directory for caching. Defaults to /tmp/mettagrid-policy-cache
197+
remove_downloaded_copy_on_exit: If True, register an atexit handler to clean up the cache directory
198+
device: Override the device in the loaded spec (e.g., "cpu" or "cuda:0")
199+
200+
Returns:
201+
PolicySpec with paths resolved to the local extraction directory
192202
"""
193203
if cache_dir is None:
194204
cache_dir = DEFAULT_POLICY_CACHE_DIR

0 commit comments

Comments
 (0)