sxs 2025.0.8__py3-none-any.whl → 2025.0.10__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.8"
1
+ __version__ = "2025.0.10"
@@ -7,7 +7,7 @@ from ..utilities import (
7
7
  )
8
8
 
9
9
 
10
- def search_prefixes(file, lev, files, ending=""):
10
+ def search_prefixes(file, sxs_id_stem, lev, files, ending=""):
11
11
  """Find the actual filename present in the list of files
12
12
 
13
13
  Different versions of Zenodo and CaltechDATA place different
@@ -20,16 +20,18 @@ def search_prefixes(file, lev, files, ending=""):
20
20
  there is just one Lev in a simulation, and we try to save the
21
21
  files in a consistent way — including the Lev with the appropriate
22
22
  separator, different versions of Zenodo and CaltechDATA will
23
- either allow or silently remove that prefix. The simplest
23
+ either allow or silently remove that prefix. On top of all that,
24
+ early uploads also got the SXS ID as a prefix. The simplest
24
25
  approach is to just search over all possibilities, for which
25
26
  filename is actually present in the data. That's what this
26
27
  function does.
27
28
 
28
29
  """
29
- for prefix in [f"{lev}:", f"{lev}/", ""]:
30
- fn = f"{prefix}{file}"
31
- if f"{fn}{ending}" in files:
32
- return fn
30
+ for directory in ["", f"{sxs_id_stem}/", f"{sxs_id_stem}:"]:
31
+ for prefix in [f"{lev}:", f"{lev}/", ""]:
32
+ fn = f"{directory}{prefix}{file}"
33
+ if f"{fn}{ending}" in files:
34
+ return fn
33
35
  raise ValueError(f"{file}{ending} not found in any form in files")
34
36
 
35
37
 
@@ -233,7 +235,7 @@ def Simulation(location, *args, **kwargs):
233
235
  )
234
236
  warn(message)
235
237
  new_location = f"{superseding}{input_version}"
236
- if input_lev_number:
238
+ if input_lev_number is not None:
237
239
  new_location += f"/Lev{input_lev_number}"
238
240
  return Simulation(new_location, *args, **kwargs)
239
241
 
@@ -250,7 +252,7 @@ def Simulation(location, *args, **kwargs):
250
252
  # If Lev is given as part of `location`, use it; otherwise, use the highest available
251
253
  lev_numbers = metadata.get(
252
254
  "lev_numbers",
253
- sorted({lev_num for f in metadata.get("files", []) if (lev_num:=lev_number(f))})
255
+ sorted({lev_num for f in metadata.get("files", []) if (lev_num:=lev_number(f)) is not None})
254
256
  )
255
257
  if not lev_numbers:
256
258
  raise ValueError(f"Could not find Levs for {location}")
@@ -259,7 +261,10 @@ def Simulation(location, *args, **kwargs):
259
261
  f"Lev number '{input_lev_number}' not found in simulation files for {sxs_id}"
260
262
  )
261
263
  max_lev_number = max(lev_numbers)
262
- output_lev_number = input_lev_number or max_lev_number
264
+ if input_lev_number is not None:
265
+ output_lev_number = input_lev_number
266
+ else:
267
+ output_lev_number = max_lev_number
263
268
  if output_lev_number is None:
264
269
  raise ValueError(
265
270
  f"No Lev number found for {location}"
@@ -270,7 +275,7 @@ def Simulation(location, *args, **kwargs):
270
275
  # or a less-than-maximal Lev
271
276
  if (
272
277
  version_is_not_default
273
- or (lev_numbers and output_lev_number != max_lev_number)
278
+ or output_lev_number != max_lev_number
274
279
  ):
275
280
  metadata = None
276
281
 
@@ -499,11 +504,12 @@ class SimulationBase:
499
504
 
500
505
  @property
501
506
  def metadata_path(self):
502
- for separator in [":", "/"]:
503
- for ending in [".json", ".txt"]:
504
- for prefix in ["", f"{self.lev}{separator}" if self.lev else ""]:
505
- if (fn := f"{prefix}metadata{ending}") in self.files:
506
- return fn
507
+ for beginning in ["", f"{self.sxs_id_stem}/", f"{self.sxs_id_stem}:"]:
508
+ for separator in [":", "/"]:
509
+ for ending in [".json", ".txt"]:
510
+ for prefix in ["", f"{self.lev}{separator}" if self.lev else ""]:
511
+ if (fn := f"{beginning}{prefix}metadata{ending}") in self.files:
512
+ return fn
507
513
  raise ValueError(
508
514
  f"Metadata file not found in simulation files for {self.location}"
509
515
  )
@@ -797,7 +803,10 @@ class Simulation_v1(SimulationBase):
797
803
 
798
804
  @property
799
805
  def horizons_path(self):
800
- return search_prefixes("Horizons.h5", self.lev, self.files)
806
+ return search_prefixes(
807
+ "Horizons.h5",
808
+ self.sxs_id_stem, self.lev, self.files
809
+ )
801
810
 
802
811
  @property
803
812
  def strain_path(self):
@@ -807,7 +816,10 @@ class Simulation_v1(SimulationBase):
807
816
  else "OutermostExtraction.dir"
808
817
  )
809
818
  return (
810
- search_prefixes("rhOverM_Asymptotic_GeometricUnits_CoM.h5", self.lev, self.files),
819
+ search_prefixes(
820
+ "rhOverM_Asymptotic_GeometricUnits_CoM.h5",
821
+ self.sxs_id_stem, self.lev, self.files
822
+ ),
811
823
  extrapolation
812
824
  )
813
825
 
@@ -819,7 +831,10 @@ class Simulation_v1(SimulationBase):
819
831
  else "OutermostExtraction.dir"
820
832
  )
821
833
  return (
822
- search_prefixes("rMPsi4_Asymptotic_GeometricUnits_CoM.h5", self.lev, self.files),
834
+ search_prefixes(
835
+ "rMPsi4_Asymptotic_GeometricUnits_CoM.h5",
836
+ self.sxs_id_stem, self.lev, self.files
837
+ ),
823
838
  extrapolation
824
839
  )
825
840
 
@@ -866,12 +881,18 @@ class Simulation_v2(SimulationBase):
866
881
 
867
882
  @property
868
883
  def horizons_path(self):
869
- return search_prefixes("Horizons.h5", self.lev, self.files)
884
+ return search_prefixes(
885
+ "Horizons.h5",
886
+ self.sxs_id_stem, self.lev, self.files
887
+ )
870
888
 
871
889
  @property
872
890
  def strain_path(self):
873
891
  return (
874
- search_prefixes(f"Strain_{self.extrapolation}", self.lev, self.files, ".h5"),
892
+ search_prefixes(
893
+ f"Strain_{self.extrapolation}",
894
+ self.sxs_id_stem, self.lev, self.files, ".h5"
895
+ ),
875
896
  "/"
876
897
  )
877
898
 
@@ -884,7 +905,10 @@ class Simulation_v2(SimulationBase):
884
905
  )
885
906
  prefix = f"{self.lev}:" if len(self.lev_numbers)>1 else ""
886
907
  return (
887
- search_prefixes(f"ExtraWaveforms", self.lev, self.files, ".h5"),
908
+ search_prefixes(
909
+ f"ExtraWaveforms",
910
+ self.sxs_id_stem, self.lev, self.files, ".h5"
911
+ ),
888
912
  f"/rMPsi4_Asymptotic_GeometricUnits_CoM_Mem/{extrapolation}"
889
913
  )
890
914
 
@@ -922,17 +946,26 @@ class Simulation_v3(Simulation_v2):
922
946
  @property
923
947
  def strain_path(self):
924
948
  return (
925
- search_prefixes(f"Strain_{self.extrapolation}", self.lev, self.files, ".h5"),
949
+ search_prefixes(
950
+ f"Strain_{self.extrapolation}",
951
+ self.sxs_id_stem, self.lev, self.files, ".h5"
952
+ ),
926
953
  "/"
927
954
  ) if self.extrapolation == self.default_extrapolation else (
928
- search_prefixes("ExtraWaveforms", self.lev, self.files, ".h5"),
955
+ search_prefixes(
956
+ "ExtraWaveforms",
957
+ self.sxs_id_stem, self.lev, self.files, ".h5"
958
+ ),
929
959
  f"/Strain_{self.extrapolation}.dir"
930
960
  )
931
961
 
932
962
  @property
933
963
  def psi4_path(self):
934
964
  return (
935
- search_prefixes("ExtraWaveforms", self.lev, self.files, ".h5"),
965
+ search_prefixes(
966
+ "ExtraWaveforms",
967
+ self.sxs_id_stem, self.lev, self.files, ".h5"
968
+ ),
936
969
  f"/Psi4_{self.extrapolation}.dir"
937
970
  )
938
971
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sxs
3
- Version: 2025.0.8
3
+ Version: 2025.0.10
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,5 +1,5 @@
1
1
  sxs/__init__.py,sha256=8PntABL6yx7Ad70hP7WedNAVDTZiwm_2At5xIQGo4k8,2610
2
- sxs/__version__.py,sha256=T6-wsPrw9CRtaYHLEWomkUB0ZeTyias2V5LZbbcYNIs,25
2
+ sxs/__version__.py,sha256=HgC8cXi2VtVN2ag53nQXNmDS6Gzg6fRu6DgWCgu8Djs,26
3
3
  sxs/handlers.py,sha256=jVV-HK-omzoBx5N2wcpLHvyoWq86hUfWCjnGbPpD91I,18343
4
4
  sxs/juliapkg.json,sha256=-baaa3Za_KBmmiGjlh2YYLWmvUvZl6GaKKXwNI4S7qU,178
5
5
  sxs/time_series.py,sha256=OKaLg8tFyrtKcef7900ri-a0C6A8wKxA68KovZXvH6I,41081
@@ -18,7 +18,7 @@ sxs/metadata/metric.py,sha256=Tsig1Jm50OO8r89zfjCuQ4i3JAoiazSb4J9qYtPWKgM,41
18
18
  sxs/simulations/__init__.py,sha256=eXkheYhRaYyKjul5J1IXpoJ7Wq4nr3Tgwr-HSS3BTek,156
19
19
  sxs/simulations/analyze.py,sha256=YwX0i_GRATRpvp7T8VheShkclvqYsraGDDKEkJQxJnw,11530
20
20
  sxs/simulations/local.py,sha256=e77SeaWMl2PWX_EndQtShOXZxcFKhQsUDQ55R2Njcuc,43
21
- sxs/simulations/simulation.py,sha256=tzI1s15mU1CDdst7XZRD4UehtbkRvIao16ONTAA0zfI,42353
21
+ sxs/simulations/simulation.py,sha256=t7t7rXNDQFC-1llOQNdTChVXemuImEiEa-OYBts_JFs,43274
22
22
  sxs/simulations/simulations.py,sha256=sMle89VoD1CQni1N23Vjo3h2yj9LHHAtuaB_qfD3Wgg,109
23
23
  sxs/utilities/__init__.py,sha256=WSStlqljfgQheMxHGfuofSc5LdmASGvO3FNO3f_zaT0,4806
24
24
  sxs/utilities/bitwise.py,sha256=G9ZNYgwDQRhq5wbDf-p2HcUqkEP_IRDiQoXW4KyU17k,13205
@@ -82,7 +82,7 @@ sxs/zenodo/api/__init__.py,sha256=EM_eh4Q8R5E0vIfMhyIR1IYFfOBu6vA0UTasgX9gHys,21
82
82
  sxs/zenodo/api/deposit.py,sha256=J4RGvGjh0cEOrN4bBZWEDcPAhNscqB2fzLlvRZ5HTHM,36948
83
83
  sxs/zenodo/api/login.py,sha256=Yz0ytgi81_5BpDzhrS0WPMXlvU2qUaCK8yn8zxfEbko,18007
84
84
  sxs/zenodo/api/records.py,sha256=nKkhoHZ95CTztHF9Zzaug5p7IiUCJG4Em1i-l-WqH6U,3689
85
- sxs-2025.0.8.dist-info/METADATA,sha256=61LeHMJCrGehO9QH6lA0dTXDkCLE-raLMRjFjKE6hhc,9311
86
- sxs-2025.0.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
87
- sxs-2025.0.8.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
88
- sxs-2025.0.8.dist-info/RECORD,,
85
+ sxs-2025.0.10.dist-info/METADATA,sha256=sVijAvq2hDkEYG8IXie_Vna6odb72NN6xKIG7ZoKYFg,9312
86
+ sxs-2025.0.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
87
+ sxs-2025.0.10.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
88
+ sxs-2025.0.10.dist-info/RECORD,,