sxs 2024.0.6__py3-none-any.whl → 2024.0.7__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__ = "2024.0.6"
1
+ __version__ = "2024.0.7"
sxs/handlers.py CHANGED
@@ -282,7 +282,7 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
282
282
 
283
283
  elif location == "simulations":
284
284
  return Simulations.load(download=download)
285
-
285
+
286
286
  elif sxs_id_version_lev_exact_re.match(location):
287
287
  return Simulation(location, download=download, cache=cache, progress=progress, **kwargs)
288
288
 
@@ -311,7 +311,12 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
311
311
 
312
312
  loader = sxs_loader(path, kwargs.get("group", None))
313
313
 
314
- return loader(path, **kwargs)
314
+ loaded = loader(path, **kwargs)
315
+ try:
316
+ loaded.__file__ = str(path)
317
+ except:
318
+ pass
319
+ return loaded
315
320
 
316
321
 
317
322
  def load_via_sxs_id(sxsid, location, *, download=None, cache=None, progress=None, truepath=None, **kwargs):
sxs/metadata/metadata.py CHANGED
@@ -90,7 +90,7 @@ class Metadata(collections.OrderedDict):
90
90
  else:
91
91
  return cls.from_json_file(json_path)
92
92
  else:
93
- raise ValueError(f"Could not find file named '{file_name}', '{json_path}', or '{txt_path}'")
93
+ raise ValueError(f"Could not find file named '{json_path}' or '{txt_path}'")
94
94
 
95
95
  load = from_file
96
96
 
@@ -95,7 +95,8 @@ def Simulation(location, *args, **kwargs):
95
95
  arguments other than those listed above.
96
96
 
97
97
  """
98
- from .. import load
98
+ from .. import load, sxs_directory
99
+ from ..utilities import sxs_path_to_system_path
99
100
 
100
101
  # Extract the simulation ID, version, and Lev from the location string
101
102
  simulation_id, input_version = sxs_id_and_version(location)
@@ -202,15 +203,17 @@ def Simulation(location, *args, **kwargs):
202
203
  # Finally, figure out which version of the simulation to load and dispatch
203
204
  version_number = float(version[1:])
204
205
  if 1 <= version_number < 2.0:
205
- return Simulation_v1(
206
+ sim = Simulation_v1(
206
207
  metadata, series, version, sxs_id_stem, sxs_id, url, files, lev_numbers, output_lev_number, location, *args, **kwargs
207
208
  )
208
209
  elif 2 <= version_number < 3.0:
209
- return Simulation_v2(
210
+ sim = Simulation_v2(
210
211
  metadata, series, version, sxs_id_stem, sxs_id, url, files, lev_numbers, output_lev_number, location, *args, **kwargs
211
212
  )
212
213
  else:
213
214
  raise ValueError(f"Version '{version}' not yet supported")
215
+ sim.__file__ = str(sxs_directory("cache") / sxs_path_to_system_path(sim.sxs_id))
216
+ return sim
214
217
 
215
218
 
216
219
  class SimulationBase:
@@ -157,7 +157,9 @@ class Simulations(collections.OrderedDict):
157
157
  except Exception as e:
158
158
  raise ValueError(f"Failed to open '{cache_path}' as a ZIP file") from e
159
159
 
160
- return cls(simulations)
160
+ sims = cls(simulations)
161
+ sims.__file__ = str(cache_path)
162
+ return sims
161
163
 
162
164
  @classmethod
163
165
  def reload(cls, download=True):
@@ -435,7 +435,7 @@ def load(
435
435
  # This means we need to change the suffix *before* the resolve() call.
436
436
  h5_path = pathlib.Path(file_name_str).with_suffix(".h5").expanduser().resolve()
437
437
  json_path = pathlib.Path(file_name_str).with_suffix(".json").expanduser().resolve()
438
- metadata_path = (pathlib.Path(file_name_str).parent / "metadata.json").expanduser().resolve()
438
+ metadata_path = (pathlib.Path(file_name_str).parent / "metadata").expanduser().resolve()
439
439
 
440
440
  # This will be used for validation
441
441
  h5_size = h5_path.stat().st_size
@@ -571,12 +571,10 @@ def load(
571
571
  w = w.to_inertial_frame()
572
572
 
573
573
  if metadata is None:
574
- if metadata_path.exists():
574
+ try:
575
575
  metadata = Metadata.from_file(metadata_path)
576
- elif metadata_path.with_suffix(".txt").exists():
577
- metadata = Metadata.from_file(metadata_path.with_suffix(".txt"))
578
- else:
579
- invalid(f"\nMetadata files {metadata_path}/.txt cannot be found, but at least one is expected for this data format.")
576
+ except ValueError as e:
577
+ invalid(f"\n{e},\nbut one is expected for this data format.")
580
578
 
581
579
  dtb = kwargs.pop("drop_times_before", 0)
582
580
  if dtb=="begin":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sxs
3
- Version: 2024.0.6
3
+ Version: 2024.0.7
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,6 +1,6 @@
1
1
  sxs/__init__.py,sha256=51_F8xiD6cdE2kIq9dPyHxNQVsp4oCvtR1wQQQ0VS2A,2577
2
- sxs/__version__.py,sha256=YFK3IT8GG2d3hDuZZ42G2jgH-IxsrF_xK1YVnywr2M4,25
3
- sxs/handlers.py,sha256=F9XmIhjZm8df1g49fUHemc-9wWstwFUZMacY2RXCWhE,24814
2
+ sxs/__version__.py,sha256=j01pd3i6foxRb99xUCzpe724QNlPfN7SMCX-DnRdfAc,25
3
+ sxs/handlers.py,sha256=mEPkqvFmmt-kfX8fLhwhozrgh7RxnUIX3-UcswtIBNw,24896
4
4
  sxs/juliapkg.json,sha256=higH1UDu30K_PN6-o7lAz0j1xjgYEiCCYBAc-Iaw1Iw,178
5
5
  sxs/time_series.py,sha256=OKaLg8tFyrtKcef7900ri-a0C6A8wKxA68KovZXvH6I,41081
6
6
  sxs/caltechdata/__init__.py,sha256=s-RXyBiImKsQenqJIU6NAjlsjOX7f1MkIIW9rPtWYyg,14761
@@ -16,10 +16,10 @@ sxs/horizons/xor_multishuffle_bzip2.py,sha256=y4AKuxmLuj8K1pkdhIoSzENGyMu4uhpiPr
16
16
  sxs/julia/GWFrames.py,sha256=47H9Ugff7ldGBujiUTcADT3b4MSxUtqmajvSApI91WA,2892
17
17
  sxs/julia/__init__.py,sha256=uSLP_xfU-GZG7IO5vs0TEkCR4LH8aBYMF-852wDY3kI,3490
18
18
  sxs/metadata/__init__.py,sha256=KCvJ9Cf1WhIZp-z28UzarKcmUAzV2BOv2gqKiorILjo,149
19
- sxs/metadata/metadata.py,sha256=_vGqMUbeiN0fecJj9f9f9ex56WgSZuwwBXykUuj1_ZI,27679
19
+ sxs/metadata/metadata.py,sha256=y6X7LcsJKiZFjBPTwRHGtsT2uHf2s0r0OG_EGjD27pE,27663
20
20
  sxs/simulations/__init__.py,sha256=sl-sDI5N2A03lAfzMig8Jm_Beri_v65qjlIOeGGX9XM,72
21
- sxs/simulations/simulation.py,sha256=8eGMyKIBJD45uo8Gb6fhhF5mHnp03cGu5SzAb-4wfS4,22884
22
- sxs/simulations/simulations.py,sha256=G4w_zed15g-b_4wLnt5sRmVPo2XxDq6XAW8EnlreX9E,16953
21
+ sxs/simulations/simulation.py,sha256=uHp36DfMsh3o_8hUJK-D_tl4LnunL9YfRUTZGjOkcIs,23049
22
+ sxs/simulations/simulations.py,sha256=a-L9xDYNySw2DO5vf5gtRFNr4UrEvIvf9BeqpnIbdLU,17013
23
23
  sxs/utilities/__init__.py,sha256=YTyrKYkiDZV4EoT4IHXGBsc_j6RU0aK1c3HERyshVq0,4760
24
24
  sxs/utilities/bitwise.py,sha256=G9ZNYgwDQRhq5wbDf-p2HcUqkEP_IRDiQoXW4KyU17k,13205
25
25
  sxs/utilities/dicts.py,sha256=CCpm3upG_9SRj9gjawukSUfaJ5asF-XRG2ausEXhYyg,695
@@ -66,7 +66,7 @@ sxs/waveforms/waveform_signal.py,sha256=Ojrt6DSDdleB0qmu6UwjjPnYdaWsrjnpBA_8dhnM
66
66
  sxs/waveforms/format_handlers/__init__.py,sha256=0wsnuBYCYsCkN19L2ipga7BtigvPyBcqiy_4qrzmLpE,50
67
67
  sxs/waveforms/format_handlers/lvc.py,sha256=kUiLT-QbBTH5Di2touWwXqasQ8Q777mV9zhRIHEqjPk,7789
68
68
  sxs/waveforms/format_handlers/nrar.py,sha256=2gQby7NwfagXCCllzVsxsc_cRbtdIWVvvwF4GOLvtLQ,20431
69
- sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py,sha256=ixxAntHxxDEP_NJJ9vSwptwIHBBZRcFq00k9WcOeOug,27676
69
+ sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py,sha256=C19-9VkQ5dt9I7GHkeFrF56k_BbFPHXIMX_xmmBj7ww,27477
70
70
  sxs/waveforms/format_handlers/rotating_paired_xor_multishuffle_bzip2.py,sha256=pFEJIlb6OQQNhv6r48ALFnZMKNZjuQY55ydWBADCDgU,2348
71
71
  sxs/waveforms/format_handlers/spectre_cce_v1.py,sha256=nh57zbG_uWJZQVhMrz7H05fpsjl1X6oaita8aTRcWxU,3963
72
72
  sxs/zenodo/__init__.py,sha256=KDcCWb7E3frZ0VylKFUkgeEMra6RG1q6FFy5Na8UuLY,26224
@@ -78,7 +78,7 @@ sxs/zenodo/api/__init__.py,sha256=EM_eh4Q8R5E0vIfMhyIR1IYFfOBu6vA0UTasgX9gHys,21
78
78
  sxs/zenodo/api/deposit.py,sha256=J4RGvGjh0cEOrN4bBZWEDcPAhNscqB2fzLlvRZ5HTHM,36948
79
79
  sxs/zenodo/api/login.py,sha256=Yz0ytgi81_5BpDzhrS0WPMXlvU2qUaCK8yn8zxfEbko,18007
80
80
  sxs/zenodo/api/records.py,sha256=nKkhoHZ95CTztHF9Zzaug5p7IiUCJG4Em1i-l-WqH6U,3689
81
- sxs-2024.0.6.dist-info/METADATA,sha256=0W1NSgRu9H9pxeMYebBBB1fNjBhCzNe5aFZw4ngYi1o,9301
82
- sxs-2024.0.6.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
83
- sxs-2024.0.6.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
84
- sxs-2024.0.6.dist-info/RECORD,,
81
+ sxs-2024.0.7.dist-info/METADATA,sha256=QhRUbtPaWuv0iFgPc2yfCcrW1iXYgCnulp6DiMJkcoU,9301
82
+ sxs-2024.0.7.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
83
+ sxs-2024.0.7.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
84
+ sxs-2024.0.7.dist-info/RECORD,,
File without changes