Skip to content

Commit

Permalink
Allow sxs.load to work on anything in simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
moble committed Oct 10, 2024
1 parent 0fdf399 commit 2f9b50f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions sxs/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,17 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
return Simulation(location, download=download, cache=cache, progress=progress, **kwargs)

else:
# Try to find an appropriate SXS file in the simulations
simulations = Simulations.load(
download=download,
local=kwargs.get("local", False),
annex_dir=kwargs.get("annex_dir", None)
)
if location.split("/Lev")[0] in simulations:
return Simulation(
location, download=download, cache=cache, progress=progress, **kwargs
)

# Try to find an appropriate SXS file in the catalog
catalog = Catalog.load(download=download)
selections = catalog.select_files(location)
Expand Down

0 comments on commit 2f9b50f

Please sign in to comment.