sxs 2025.0.4__py3-none-any.whl → 2025.0.6__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.4"
1
+ __version__ = "2025.0.6"
@@ -924,18 +924,33 @@ class Simulation_v3(Simulation_v2):
924
924
 
925
925
 
926
926
  def get_file_info(metadata, sxs_id, download=None):
927
- # TODO: Allow an existing zenodo_metadata.json file to be used
928
- from .. import load_via_sxs_id
927
+ from .. import load, load_via_sxs_id
929
928
  if "files" in metadata:
930
929
  return metadata["files"]
931
930
  truepath = Path(sxs_path_to_system_path(sxs_id)) / "zenodo_metadata.json"
932
931
  record = load_via_sxs_id(sxs_id, "export/json", truepath=truepath, download=download)
933
- entries = record["files"]["entries"]
934
- return {
935
- str(filename): {
936
- "checksum": entry["checksum"],
937
- "size": entry["size"],
938
- "link": entry["links"]["content"],
932
+ if not record.get("files", {}).get("entries", []):
933
+ # CaltechDATA files should generally be already stored in the `simulations`,
934
+ # but just in case, we get to this point
935
+ truepath = Path(sxs_path_to_system_path(sxs_id)) / "caltechdata_files.json"
936
+ url = record["links"]["files"]
937
+ record = load(url, truepath=truepath, download=download)
938
+ entries = record["entries"]
939
+ return {
940
+ entry["key"]: {
941
+ "checksum": entry["checksum"],
942
+ "size": entry["size"],
943
+ "link": entry["links"]["content"],
944
+ }
945
+ for entry in entries
946
+ }
947
+ else:
948
+ entries = record["files"]["entries"]
949
+ return {
950
+ str(filename): {
951
+ "checksum": entry["checksum"],
952
+ "size": entry["size"],
953
+ "link": entry["links"]["content"],
954
+ }
955
+ for filename, entry in entries.items()
939
956
  }
940
- for filename, entry in entries.items()
941
- }
sxs/utilities/inspire.py CHANGED
@@ -44,7 +44,7 @@ def inspire2doi(inspire_bibtex_key, raise_exceptions=False):
44
44
 
45
45
 
46
46
  def query(
47
- query,
47
+ query_string,
48
48
  sort="mostrecent",
49
49
  page=1,
50
50
  size=1000,
@@ -56,7 +56,7 @@ def query(
56
56
 
57
57
  Parameters
58
58
  ----------
59
- query : str
59
+ query_string : str
60
60
  The search query. For details, see
61
61
  https://github.com/inspirehep/rest-api-doc/tree/master#search-query
62
62
  fields : str, optional
@@ -93,32 +93,37 @@ def query(
93
93
 
94
94
  """
95
95
  import sys
96
- import requests
97
- from requests.adapters import HTTPAdapter
98
- from urllib3.util.retry import Retry
99
96
 
100
- session = requests.Session()
97
+ # Reuse the same session, in case user repeatedly calls query
98
+ if not hasattr(query, "session"):
99
+ import requests
100
+ from requests.adapters import HTTPAdapter
101
+ from urllib3.util.retry import Retry
102
+
103
+ query.session = requests.Session()
104
+
105
+ ## Retry automatically on certain types of errors
106
+ retry = Retry(
107
+ total=10,
108
+ backoff_factor=0.1,
109
+ status_forcelist=[
110
+ 413, # Request Entity Too Large
111
+ 429, # Too Many Requests
112
+ 500, # Internal Server Error
113
+ 502, # Bad Gateway
114
+ 503, # Service Unavailable
115
+ 504, # Gateway Timeout
116
+ ],
117
+ )
118
+ adapter = HTTPAdapter(max_retries=retry)
119
+ query.session.mount("https://", adapter)
120
+
121
+ session = query.session
101
122
  collected_results = []
102
123
 
103
- ## Retry automatically on certain types of errors
104
- retry = Retry(
105
- total=10,
106
- backoff_factor=0.1,
107
- status_forcelist=[
108
- 413, # Request Entity Too Large
109
- 429, # Too Many Requests
110
- 500, # Internal Server Error
111
- 502, # Bad Gateway
112
- 503, # Service Unavailable
113
- 504, # Gateway Timeout
114
- ],
115
- )
116
- adapter = HTTPAdapter(max_retries=retry)
117
- session.mount("https://", adapter)
118
-
119
124
  url = api_url.format(record_type=record_type)
120
125
  params = {
121
- "q": query,
126
+ "q": query_string,
122
127
  "sort": sort,
123
128
  "size": size,
124
129
  "page": page,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sxs
3
- Version: 2025.0.4
3
+ Version: 2025.0.6
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=YlOJhL85IYEczUyRNWzDPIj3M_eeb9k05_B0RVtrMMk,25
2
+ sxs/__version__.py,sha256=yvdjudtPjiQebLjJ4Ne10nfyYPrzHlDRMvfyAxij7Mo,25
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=RaImREx3fWlXgJRCI-Wsq0-LjidL-Mb8SIN3-n-TMqM,10373
20
20
  sxs/simulations/local.py,sha256=e77SeaWMl2PWX_EndQtShOXZxcFKhQsUDQ55R2Njcuc,43
21
- sxs/simulations/simulation.py,sha256=to8iAofvW_TMIfyO1tYSiCwuVUC7v-2ykGsjN0WvTGY,41104
21
+ sxs/simulations/simulation.py,sha256=QtGdZDOXgt7C44CqqvdJCCQmEkcXjxPUL-yDrUR13Ps,41741
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
@@ -26,7 +26,7 @@ sxs/utilities/dicts.py,sha256=CCpm3upG_9SRj9gjawukSUfaJ5asF-XRG2ausEXhYyg,695
26
26
  sxs/utilities/downloads.py,sha256=dgQvlpY3DffDX1HrmISb6iThuuIDt9BAPbgXFBrh2PQ,116
27
27
  sxs/utilities/files.py,sha256=l7SNOg0ikgqXV3bmPJdXZQMQ_XPGXVUsIJIOjDVp3Mg,4517
28
28
  sxs/utilities/formats.py,sha256=EekLcSi-fhFdkPT7R9h10d9_0gZH4EomH5-RVQp-sg8,3867
29
- sxs/utilities/inspire.py,sha256=5F4KJ2D9qaEArl7dlhMv-K3Dym5S5oQI5RTwZXKhXRw,5298
29
+ sxs/utilities/inspire.py,sha256=Q_N0W3Ta37lpihoF3nbBOFCmVHzmp4CAPuW0YapROGw,5541
30
30
  sxs/utilities/monotonicity.py,sha256=YVwj3Tjew8dkpJJ9TReyuISD2ul5HJfkEJgCoiLru5Q,812
31
31
  sxs/utilities/pretty_print.py,sha256=ZDHR3uvkzQ3Whk_eIp3BB7Abh796nqyrVsQRa68zgGc,1473
32
32
  sxs/utilities/select.py,sha256=UgoEQIvkm8NBe6sD5O2gK0g9Pep-xvWoYQ3b7RxI-Ww,6727
@@ -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.4.dist-info/METADATA,sha256=b28vdu-l2V0319BujaHzvAKWRTrPwB6RrmA6nlfMw00,9311
86
- sxs-2025.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
87
- sxs-2025.0.4.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
88
- sxs-2025.0.4.dist-info/RECORD,,
85
+ sxs-2025.0.6.dist-info/METADATA,sha256=HsKY1bopxuPt9Art9HXqOlYGrIy6l73GU6y5xotFisQ,9311
86
+ sxs-2025.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
87
+ sxs-2025.0.6.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
88
+ sxs-2025.0.6.dist-info/RECORD,,
File without changes