Skip to content

Commit

Permalink
Support archive files with multiple extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
gmertes committed Jul 23, 2024
1 parent 8423068 commit 663b679
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/anemoi/registry/entry/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ def set_archive(self, path, platform, run_number, overwrite=True, extras={}):
if isinstance(extras, list):
extras = {v.split("=")[0]: v.split("=")[1] for v in extras}

_, ext = os.path.splitext(path)
target = config()["artefacts_uri_base"] + f"/{self.key}/runs/{run_number}/{platform}{ext}"
base = os.path.basename(path)
ext = base.split(os.extsep, 1)[-1] # everything after the first dot, to support multiple ext like tar.gz
target = config()["artefacts_uri_base"] + f"/{self.key}/runs/{run_number}/{platform}.{ext}"
LOG.info(f"Uploading {path} to {target}.")
upload(path, target, overwrite=overwrite)

Expand Down

0 comments on commit 663b679

Please sign in to comment.