sxs 2025.0.14__py3-none-any.whl → 2025.0.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sxs/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2025.0.14"
1
+ __version__ = "2025.0.16"
sxs/citation.py CHANGED
@@ -30,6 +30,9 @@ def cite(*sxs_ids, bibtex=True):
30
30
  from . import doi_prefix, load, __version__
31
31
  from . import sxs_id as sxs_identifier
32
32
 
33
+ if len(sxs_ids) == 1 and isinstance(sxs_ids[0], (list, tuple)):
34
+ sxs_ids = tuple(sxs_ids[0])
35
+
33
36
  simulations = load("simulations")
34
37
 
35
38
  # Get the DOI for this version of this package
sxs/handlers.py CHANGED
@@ -199,29 +199,36 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
199
199
  -----
200
200
  This function can load data in various ways.
201
201
 
202
- 1) Given an absolute or relative path to a local file, it just
203
- loads the data directly.
204
-
205
- 2) If `truepath` is set, and points to a file that exists —
202
+ 1) If `truepath` is set, and points to a file that exists —
206
203
  whether absolute, relative to the current working directory,
207
204
  or relative to the cache directory — that file will be
208
205
  loaded.
209
206
 
210
- 3) If `location` is a valid URL including the scheme (https://,
207
+ 2) Given an absolute or relative path to a local file, it just
208
+ loads the data directly.
209
+
210
+ 3) If `location` is one of "simulations" or "dataframe" (or the
211
+ deprecated "catalog"), the corresponding catalog data is
212
+ loaded. The "simulations" option returns a dictionary mapping
213
+ SXS IDs to raw metadata, while "dataframe" returns a pandas
214
+ DataFrame indexed by SXS ID, but the metadata is processed
215
+ into more consistent form.
216
+
217
+ 4) If `location` is a valid URL including the scheme (https://,
211
218
  or http://), it will be downloaded regardless of the
212
219
  `download` parameter and optionally cached.
213
220
 
214
- 4) Given an SXS simulation specification — like "SXS:BBH:1234",
221
+ 5) Given an SXS simulation specification — like "SXS:BBH:1234",
215
222
  "SXS:BBH:1234v2.0", "SXS:BBH:1234/Lev5", or
216
223
  "SXS:BBH:1234v2.0/Lev5" — the simulation is loaded as an
217
224
  `sxs.Simulation` object.
218
225
 
219
- 5) Given an SXS path — like
226
+ 6) Given an SXS path — like
220
227
  "SXS:BBH:1234/Lev5/h_Extrapolated_N2.h5" — the file is
221
228
  located in the catalog for details. This function then looks
222
229
  in the local cache directory and loads it if present.
223
230
 
224
- 6) If the SXS path is not found in the cache directory and
231
+ 7) If the SXS path is not found in the cache directory and
225
232
  `download` is set to `True` (when this function is called, or
226
233
  in the sxs config file) this function attempts to download
227
234
  the data. Note that `download` must be explicitly set in
@@ -263,6 +270,15 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
263
270
  elif truepath and (testpath := cache_path / sxs_path_to_system_path(truepath)).exists():
264
271
  path = testpath
265
272
 
273
+ elif _safe_resolve_exists(path):
274
+ pass # We already have the correct path
275
+
276
+ elif location == "catalog":
277
+ return Catalog.load(download=download)
278
+
279
+ elif location in ["simulations", "dataframe"]:
280
+ return sxscatalog.load(location, download=download, **kwargs)
281
+
266
282
  elif _safe_resolve_exists(h5_path):
267
283
  path = h5_path
268
284
 
@@ -278,12 +294,6 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
278
294
  raise ValueError(f"File '{truepath}' not found in cache, but downloading turned off")
279
295
  download_file(location, path, progress=progress)
280
296
 
281
- elif location == "catalog":
282
- return Catalog.load(download=download)
283
-
284
- elif location in ["simulations", "dataframe"]:
285
- return sxscatalog.load(location, download=download, **kwargs)
286
-
287
297
  elif sxs_id_version_lev_exact_re.match(location):
288
298
  return Simulation(location, download=download, cache=cache, progress=progress, **kwargs)
289
299
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sxs
3
- Version: 2025.0.14
3
+ Version: 2025.0.16
4
4
  Summary: Interface to data produced by the Simulating eXtreme Spacetimes collaboration
5
5
  Project-URL: Homepage, https://github.com/sxs-collaboration/sxs
6
6
  Project-URL: Documentation, https://sxs.readthedocs.io/
@@ -1,7 +1,7 @@
1
1
  sxs/__init__.py,sha256=C8VhmrUPAa70Y-C2KfZv9BhS6ef-eB7uaNtwm18IRhk,2637
2
- sxs/__version__.py,sha256=eCKOuEJ8I4r8khfPMQo8e9Eo2SpoVADBudzBmD192cs,26
3
- sxs/citation.py,sha256=90c8zOsWTcDX42NWEKGPLWvDYVORj2Ie9VPKZti-iOU,7062
4
- sxs/handlers.py,sha256=jVV-HK-omzoBx5N2wcpLHvyoWq86hUfWCjnGbPpD91I,18343
2
+ sxs/__version__.py,sha256=xCVYVWrP49sS05Knu6LBHhTBlrCM-7hIvBCvunxySHA,26
3
+ sxs/citation.py,sha256=QAiRnasTXpufZCaoxTKR5ESSJQ2ww7FgWyxoaaAQifw,7167
4
+ sxs/handlers.py,sha256=rUS0TmbewpllnZHkS5TXCx6nxGA-E8xrBGLlejBPEAg,18820
5
5
  sxs/juliapkg.json,sha256=-baaa3Za_KBmmiGjlh2YYLWmvUvZl6GaKKXwNI4S7qU,178
6
6
  sxs/time_series.py,sha256=OKaLg8tFyrtKcef7900ri-a0C6A8wKxA68KovZXvH6I,41081
7
7
  sxs/catalog/__init__.py,sha256=9-WTMTPDmqqkFyIHOtEbPA6etXm3_RSRrLWvHtLrjLg,205
@@ -83,7 +83,7 @@ sxs/zenodo/api/__init__.py,sha256=EM_eh4Q8R5E0vIfMhyIR1IYFfOBu6vA0UTasgX9gHys,21
83
83
  sxs/zenodo/api/deposit.py,sha256=J4RGvGjh0cEOrN4bBZWEDcPAhNscqB2fzLlvRZ5HTHM,36948
84
84
  sxs/zenodo/api/login.py,sha256=hXyxLrx1PALaEEH76XrBvlO5Wwz-qa-MCjkI8UyB3t0,18005
85
85
  sxs/zenodo/api/records.py,sha256=nKkhoHZ95CTztHF9Zzaug5p7IiUCJG4Em1i-l-WqH6U,3689
86
- sxs-2025.0.14.dist-info/METADATA,sha256=zCZwHwSN4HulK5BOz-UAqjMuPqrChhMmjw5f5wYnMig,12857
87
- sxs-2025.0.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
88
- sxs-2025.0.14.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
89
- sxs-2025.0.14.dist-info/RECORD,,
86
+ sxs-2025.0.16.dist-info/METADATA,sha256=A-DbdcADvHCuL5mIbKoA2NU3FDv_xaF3qU1yewLPiXs,12857
87
+ sxs-2025.0.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
88
+ sxs-2025.0.16.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
89
+ sxs-2025.0.16.dist-info/RECORD,,