sxs 2024.0.42__py3-none-any.whl → 2024.0.43__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 +1 -1
- sxs/handlers.py +4 -1
- sxs/simulations/local.py +8 -7
- sxs/simulations/simulations.py +48 -16
- {sxs-2024.0.42.dist-info → sxs-2024.0.43.dist-info}/METADATA +1 -1
- {sxs-2024.0.42.dist-info → sxs-2024.0.43.dist-info}/RECORD +8 -8
- {sxs-2024.0.42.dist-info → sxs-2024.0.43.dist-info}/WHEEL +0 -0
- {sxs-2024.0.42.dist-info → sxs-2024.0.43.dist-info}/licenses/LICENSE +0 -0
sxs/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2024.0.
|
|
1
|
+
__version__ = "2024.0.43"
|
sxs/handlers.py
CHANGED
|
@@ -284,7 +284,10 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
|
|
|
284
284
|
return Simulations.load(
|
|
285
285
|
download=download,
|
|
286
286
|
local=kwargs.get("local", False),
|
|
287
|
-
annex_dir=kwargs.get("annex_dir", None)
|
|
287
|
+
annex_dir=kwargs.get("annex_dir", None),
|
|
288
|
+
output_file=kwargs.get("output_file", None),
|
|
289
|
+
compute_md5=kwargs.get("compute_md5", False),
|
|
290
|
+
show_progress=kwargs.get("show_progress", False)
|
|
288
291
|
)
|
|
289
292
|
|
|
290
293
|
elif location == "dataframe":
|
sxs/simulations/local.py
CHANGED
|
@@ -215,12 +215,13 @@ def write_local_simulations(annex_dir, output_file=None, compute_md5=False, show
|
|
|
215
215
|
simulations = local_simulations(annex_dir, compute_md5=compute_md5, show_progress=show_progress)
|
|
216
216
|
|
|
217
217
|
# Write the simulations to file
|
|
218
|
-
if output_file is None
|
|
219
|
-
output_file
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
218
|
+
if output_file is not False: # Test literal identity to allow `None`
|
|
219
|
+
if output_file is None:
|
|
220
|
+
output_file = sxs_directory("cache") / "local_simulations.json"
|
|
221
|
+
else:
|
|
222
|
+
output_file = Path(output_file)
|
|
223
|
+
output_file.parent.mkdir(parents=True, exist_ok=True)
|
|
224
|
+
with output_file.open("w") as f:
|
|
225
|
+
dump(simulations, f, indent=2, separators=(",", ": "), ensure_ascii=True)
|
|
225
226
|
|
|
226
227
|
return simulations
|
sxs/simulations/simulations.py
CHANGED
|
@@ -173,7 +173,7 @@ class Simulations(collections.OrderedDict):
|
|
|
173
173
|
return remote_timestamp
|
|
174
174
|
|
|
175
175
|
@classmethod
|
|
176
|
-
def local(cls, directory=None, *, download=None):
|
|
176
|
+
def local(cls, directory=None, *, download=None, output_file=None, compute_md5=False, show_progress=False):
|
|
177
177
|
"""Load the local catalog of SXS simulations
|
|
178
178
|
|
|
179
179
|
This function loads the standard public catalog, but also
|
|
@@ -192,30 +192,47 @@ class Simulations(collections.OrderedDict):
|
|
|
192
192
|
download : {None, bool}, optional
|
|
193
193
|
Passed to `Simulations.load` when loading the public set
|
|
194
194
|
of simulations.
|
|
195
|
+
output_file : {None, str, Path}, optional
|
|
196
|
+
If `directory` is not None, this will be passed to
|
|
197
|
+
`sxs.write_local_simulations`.
|
|
198
|
+
compute_md5 : bool, optional
|
|
199
|
+
If `directory` is not None, this will be passed to
|
|
200
|
+
`sxs.local_simulations`.
|
|
201
|
+
show_progress : bool, optional
|
|
202
|
+
If `directory` is not None, this will be passed to
|
|
203
|
+
`sxs.local_simulations`.
|
|
195
204
|
|
|
196
205
|
See Also
|
|
197
206
|
--------
|
|
198
207
|
sxs.local_simulations : Search for local simulations
|
|
199
|
-
sxs.write_local_simulations : Write local simulations to a
|
|
208
|
+
sxs.write_local_simulations : Write local simulations to a
|
|
209
|
+
file
|
|
200
210
|
|
|
201
211
|
"""
|
|
202
212
|
import json
|
|
203
213
|
from .local import write_local_simulations
|
|
204
214
|
from .. import sxs_directory
|
|
205
215
|
|
|
206
|
-
local_path = sxs_directory("cache") / "local_simulations.json"
|
|
207
216
|
if directory is not None:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
local_path = output_file
|
|
218
|
+
local_simulations = write_local_simulations(
|
|
219
|
+
directory,
|
|
220
|
+
output_file=output_file,
|
|
221
|
+
compute_md5=compute_md5,
|
|
222
|
+
show_progress=show_progress
|
|
223
|
+
)
|
|
224
|
+
else:
|
|
225
|
+
local_path = sxs_directory("cache") / "local_simulations.json"
|
|
226
|
+
if not local_path.exists():
|
|
227
|
+
if directory is not None:
|
|
228
|
+
raise ValueError(f"Writing local simulations for {directory=} failed")
|
|
229
|
+
else:
|
|
230
|
+
raise ValueError(
|
|
231
|
+
f"Local simulations file not found, but no `directory` was provided.\n"
|
|
232
|
+
+ "If called from `sxs.load`, just pass the name of the directory."
|
|
233
|
+
)
|
|
234
|
+
with local_path.open("r") as f:
|
|
235
|
+
local_simulations = json.load(f)
|
|
219
236
|
simulations = cls.load(download)
|
|
220
237
|
doi_versions = {
|
|
221
238
|
k: v["DOI_versions"]
|
|
@@ -229,7 +246,7 @@ class Simulations(collections.OrderedDict):
|
|
|
229
246
|
return simulations
|
|
230
247
|
|
|
231
248
|
@classmethod
|
|
232
|
-
def load(cls, download=None, *, local=False, annex_dir=None):
|
|
249
|
+
def load(cls, download=None, *, local=False, annex_dir=None, output_file=None, compute_md5=False, show_progress=False):
|
|
233
250
|
"""Load the catalog of SXS simulations
|
|
234
251
|
|
|
235
252
|
Note that — unlike most SXS data files — the simulations file
|
|
@@ -263,6 +280,15 @@ class Simulations(collections.OrderedDict):
|
|
|
263
280
|
If provided and `local=True`, this function will load
|
|
264
281
|
local simulations from the given directory. This is
|
|
265
282
|
equivalent to calling `Simulations.local(directory)`.
|
|
283
|
+
output_file : {None, str, Path}, optional
|
|
284
|
+
If `annex_dir` is not None, this will be passed to
|
|
285
|
+
`sxs.write_local_simulations`.
|
|
286
|
+
compute_md5 : bool, optional
|
|
287
|
+
If `annex_dir` is not None, this will be passed to
|
|
288
|
+
`sxs.simulations.local_simulations`.
|
|
289
|
+
show_progress : bool, optional
|
|
290
|
+
If `annex_dir` is not None, this will be passed to
|
|
291
|
+
`sxs.simulations.local_simulations`.
|
|
266
292
|
|
|
267
293
|
See Also
|
|
268
294
|
--------
|
|
@@ -280,7 +306,13 @@ class Simulations(collections.OrderedDict):
|
|
|
280
306
|
return cls._simulations
|
|
281
307
|
|
|
282
308
|
if local or annex_dir is not None:
|
|
283
|
-
cls._simulations = cls.local(
|
|
309
|
+
cls._simulations = cls.local(
|
|
310
|
+
annex_dir,
|
|
311
|
+
download=download,
|
|
312
|
+
output_file=output_file,
|
|
313
|
+
compute_md5=compute_md5,
|
|
314
|
+
show_progress=show_progress
|
|
315
|
+
)
|
|
284
316
|
return cls._simulations
|
|
285
317
|
|
|
286
318
|
progress = read_config("download_progress", True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sxs
|
|
3
|
-
Version: 2024.0.
|
|
3
|
+
Version: 2024.0.43
|
|
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=hbydsXWR88sFiKExPJ1NHWGEvWRbbJBjSc1irSMYKgY,2623
|
|
2
|
-
sxs/__version__.py,sha256=
|
|
3
|
-
sxs/handlers.py,sha256=
|
|
2
|
+
sxs/__version__.py,sha256=2f1GnLIs4eYPdnrJrRDZeA5ovQX_2cfkuPAyFII9GGE,26
|
|
3
|
+
sxs/handlers.py,sha256=o7ihff0glg1DEP95reBZ75lH2h2mP-sZkwUL1_eoMwU,17720
|
|
4
4
|
sxs/juliapkg.json,sha256=-baaa3Za_KBmmiGjlh2YYLWmvUvZl6GaKKXwNI4S7qU,178
|
|
5
5
|
sxs/time_series.py,sha256=OKaLg8tFyrtKcef7900ri-a0C6A8wKxA68KovZXvH6I,41081
|
|
6
6
|
sxs/caltechdata/__init__.py,sha256=pvyc2Djch4DA6t06op-0NSTegrMSywzNi7Z3W_91-Cg,14670
|
|
@@ -19,9 +19,9 @@ sxs/metadata/__init__.py,sha256=jz0A3sBYQoNVZ5sdHv6LgI6y4kP2051-esCR62xt6bM,184
|
|
|
19
19
|
sxs/metadata/metadata.py,sha256=vqzNufg46BrbFAuvDF55JvrQc0ZIBxSG4eH2awv5PDs,28610
|
|
20
20
|
sxs/metadata/metric.py,sha256=W_PMNmsJ2qBjIeAll4TgUz79-SZkiBTswTfK4gKWrPU,6785
|
|
21
21
|
sxs/simulations/__init__.py,sha256=GrZym0PHTULDg_hyFmISNzDfqVLz_hQo-djbgecZs54,134
|
|
22
|
-
sxs/simulations/local.py,sha256=
|
|
22
|
+
sxs/simulations/local.py,sha256=nfca2cG3LWNC8Jc-i79BZmKdwPfhPgPKja-wXg_qEKw,8344
|
|
23
23
|
sxs/simulations/simulation.py,sha256=lVA2aSRy4-V1-1bFE74zIN8Tpvf7QDtn9n7xmR7oqcU,37579
|
|
24
|
-
sxs/simulations/simulations.py,sha256=
|
|
24
|
+
sxs/simulations/simulations.py,sha256=5OYQez3BXtg8zbCe85MlSqYtAKv4UqXt7iRfLiPAWxw,25367
|
|
25
25
|
sxs/utilities/__init__.py,sha256=WSStlqljfgQheMxHGfuofSc5LdmASGvO3FNO3f_zaT0,4806
|
|
26
26
|
sxs/utilities/bitwise.py,sha256=G9ZNYgwDQRhq5wbDf-p2HcUqkEP_IRDiQoXW4KyU17k,13205
|
|
27
27
|
sxs/utilities/dicts.py,sha256=CCpm3upG_9SRj9gjawukSUfaJ5asF-XRG2ausEXhYyg,695
|
|
@@ -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-2024.0.
|
|
86
|
-
sxs-2024.0.
|
|
87
|
-
sxs-2024.0.
|
|
88
|
-
sxs-2024.0.
|
|
85
|
+
sxs-2024.0.43.dist-info/METADATA,sha256=5rmhF6Twj0ZjJtLFM6_zmtlccn4mJ0dDK78wh5CJaNM,9253
|
|
86
|
+
sxs-2024.0.43.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
87
|
+
sxs-2024.0.43.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
|
|
88
|
+
sxs-2024.0.43.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|