sxs 2025.0.1__py3-none-any.whl → 2025.0.2__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.1"
1
+ __version__ = "2025.0.2"
sxs/handlers.py CHANGED
@@ -237,7 +237,7 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
237
237
  import pathlib
238
238
  import urllib.request
239
239
  from . import Simulations, Simulation, read_config, sxs_directory, Catalog
240
- from .utilities import url, download_file, sxs_path_to_system_path, sxs_id_version_lev_exact_re, lev_path_re
240
+ from .utilities import url, download_file, sxs_path_to_system_path, sxs_id_version_lev_exact_re, lev_path_re, sxs_identifier_re
241
241
 
242
242
  # Note: `download` and/or `cache` may still be `None` after this
243
243
  if download is None:
@@ -294,11 +294,30 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
294
294
  local=kwargs.get("local", False),
295
295
  annex_dir=kwargs.get("annex_dir", None)
296
296
  )
297
+ # If we chop off any "/LevN", and it's in the simulations, load it as a simulation
297
298
  if lev_path_re.sub("", location) in simulations:
298
299
  return Simulation(
299
300
  location, download=download, cache=cache, progress=progress, **kwargs
300
301
  )
301
302
 
303
+ # Now we look for a file in `simulations`
304
+ if sxs_identifier_re.match(location):
305
+ split_location = sxs_identifier_re.split(location)
306
+ # Currently we can only handle unversioned SXS ID files
307
+ if split_location[5] is None:
308
+ sxs_id = split_location[1]
309
+ file = split_location[-1].lstrip("/").lstrip("\\")
310
+ if sxs_id in simulations:
311
+ simulation = simulations[sxs_id]
312
+ if "files" in simulation:
313
+ file_info = simulation["files"][file]
314
+ location = file_info["link"]
315
+ truepath = truepath or (pathlib.Path(sxs_id) / file)
316
+ return load(
317
+ location, truepath=truepath,
318
+ download=download, cache=cache, progress=progress, **kwargs
319
+ )
320
+
302
321
  # Try to find an appropriate SXS file in the catalog
303
322
  catalog = Catalog.load(download=download)
304
323
  selections = catalog.select_files(location)
@@ -36,11 +36,12 @@ def to_lvc_conventions(
36
36
  ):
37
37
  r"""Return SXS waveform in LVC conventions.
38
38
 
39
- This is the function underpinning `sxs.load_lvc`. Essentially,
40
- that function is a fairly thin wrapper around this one; it just
41
- loads the `h` and `horizons` data and passes it to this function.
42
- For explanation of what this function does, the inputs, and
43
- outputs, see that function's docstring.
39
+ This is the function underpinning the `to_lvk` method of the
40
+ various `Simulation` types. Essentially, that function is a
41
+ fairly thin wrapper around this one; it just loads the `h` and
42
+ `horizons` data and passes it to this function. For explanation
43
+ of what this function does, the inputs, and outputs, see that
44
+ function's docstring.
44
45
 
45
46
  """
46
47
  if t_ref is None and f_ref is None:
@@ -413,6 +413,12 @@ def load(
413
413
  raise ValueError(message)
414
414
 
415
415
  file_name_str = str(file_name)
416
+ if file_name_str.endswith(".json"):
417
+ # This is just a JSON file with the "sxs_format" key, not an H5 file
418
+ # with the data in it. Just return the JSON data.
419
+ from ...handlers import JSONHandler
420
+ return JSONHandler.load(file_name_str)
421
+
416
422
  group = kwargs.get("group", None)
417
423
  if ".h5" in file_name_str and not file_name_str.endswith(".h5"):
418
424
  file_name_str, group = file_name_str.split(".h5")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sxs
3
- Version: 2025.0.1
3
+ Version: 2025.0.2
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/
@@ -46,7 +46,7 @@ Requires-Dist: quaternionic>=1.0.15
46
46
  Requires-Dist: requests>=2.24.0
47
47
  Requires-Dist: scipy>=1.13
48
48
  Requires-Dist: spherical>=1.0.15
49
- Requires-Dist: sxscatalog>=3.0.0a1
49
+ Requires-Dist: sxscatalog>=3.0.0a26
50
50
  Requires-Dist: tqdm>=4.63.1
51
51
  Requires-Dist: urllib3>=1.25.10
52
52
  Provides-Extra: docs
@@ -1,6 +1,6 @@
1
1
  sxs/__init__.py,sha256=8PntABL6yx7Ad70hP7WedNAVDTZiwm_2At5xIQGo4k8,2610
2
- sxs/__version__.py,sha256=Bm-_JhTS0PjYQZLvzOzJamRZy3Sq8gy04rjMiv45GLE,25
3
- sxs/handlers.py,sha256=12a14BjxsAgTHoEj0MrKtuv7wV1Y4chNr1oF9rha3DY,17205
2
+ sxs/__version__.py,sha256=00CnSIbrBDJK1w5pLXr3qrweMV-XKl67exMRg7gte3Q,25
3
+ sxs/handlers.py,sha256=Rhj6HAKPKSCJYwpWcz2eUkd6yuQZdCndQjZhq71QQ1A,18308
4
4
  sxs/juliapkg.json,sha256=-baaa3Za_KBmmiGjlh2YYLWmvUvZl6GaKKXwNI4S7qU,178
5
5
  sxs/time_series.py,sha256=OKaLg8tFyrtKcef7900ri-a0C6A8wKxA68KovZXvH6I,41081
6
6
  sxs/catalog/__init__.py,sha256=9-WTMTPDmqqkFyIHOtEbPA6etXm3_RSRrLWvHtLrjLg,205
@@ -65,9 +65,9 @@ sxs/waveforms/waveform_modes.py,sha256=NousbAeSedN1RNh21g_5LAh0K82ikIumHPELKf9X_
65
65
  sxs/waveforms/waveform_signal.py,sha256=Ojrt6DSDdleB0qmu6UwjjPnYdaWsrjnpBA_8dhnM_q4,182
66
66
  sxs/waveforms/format_handlers/__init__.py,sha256=0wsnuBYCYsCkN19L2ipga7BtigvPyBcqiy_4qrzmLpE,50
67
67
  sxs/waveforms/format_handlers/grathena.py,sha256=5NrHL3K0mRHApnFx5YsMUufDKUD1A_dZu8mGQqOdBeE,3622
68
- sxs/waveforms/format_handlers/lvc.py,sha256=gdXYqa8Bn8jCSIRIshMP399WO9ZMtkNtkAQiuzqhH_0,7817
68
+ sxs/waveforms/format_handlers/lvc.py,sha256=8hGyjSaXRfS1RPiknbACi6mSLDU-xoD3EiDG2CqEit4,7861
69
69
  sxs/waveforms/format_handlers/nrar.py,sha256=3ycVoqQcWAAixV3mKp58_wUhYBHt6QeLv2YGSvy-EGM,21538
70
- sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py,sha256=C19-9VkQ5dt9I7GHkeFrF56k_BbFPHXIMX_xmmBj7ww,27477
70
+ sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py,sha256=7XgXnroQ-3dHCYnN6KrDkz8z9EVl57f8W6iOX6bUemA,27745
71
71
  sxs/waveforms/format_handlers/rotating_paired_xor_multishuffle_bzip2.py,sha256=pFEJIlb6OQQNhv6r48ALFnZMKNZjuQY55ydWBADCDgU,2348
72
72
  sxs/waveforms/format_handlers/spectre_cce_v1.py,sha256=nh57zbG_uWJZQVhMrz7H05fpsjl1X6oaita8aTRcWxU,3963
73
73
  sxs/zenodo/__init__.py,sha256=rgFd1jN7IVcZEeed7iAoht1DitbLj31-8EtA0pd_e3c,25996
@@ -79,7 +79,7 @@ sxs/zenodo/api/__init__.py,sha256=EM_eh4Q8R5E0vIfMhyIR1IYFfOBu6vA0UTasgX9gHys,21
79
79
  sxs/zenodo/api/deposit.py,sha256=J4RGvGjh0cEOrN4bBZWEDcPAhNscqB2fzLlvRZ5HTHM,36948
80
80
  sxs/zenodo/api/login.py,sha256=Yz0ytgi81_5BpDzhrS0WPMXlvU2qUaCK8yn8zxfEbko,18007
81
81
  sxs/zenodo/api/records.py,sha256=nKkhoHZ95CTztHF9Zzaug5p7IiUCJG4Em1i-l-WqH6U,3689
82
- sxs-2025.0.1.dist-info/METADATA,sha256=UVgzRlHmWBxbE04NKD4p5fvpo3I7u8uFJp-DWxzhzA0,9287
83
- sxs-2025.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- sxs-2025.0.1.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
85
- sxs-2025.0.1.dist-info/RECORD,,
82
+ sxs-2025.0.2.dist-info/METADATA,sha256=1LSOQXL_n4JZSL1Z_EW-ShJ5JLvurIp2WbHYBFuHHqY,9288
83
+ sxs-2025.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
+ sxs-2025.0.2.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
85
+ sxs-2025.0.2.dist-info/RECORD,,
File without changes