sxs 2024.0.11__py3-none-any.whl → 2024.0.13__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/__init__.py +1 -1
- sxs/__version__.py +1 -1
- sxs/handlers.py +3 -0
- sxs/simulations/__init__.py +1 -0
- sxs/simulations/local.py +31 -14
- sxs/simulations/simulation.py +2 -2
- sxs/simulations/simulations.py +49 -0
- {sxs-2024.0.11.dist-info → sxs-2024.0.13.dist-info}/METADATA +2 -2
- {sxs-2024.0.11.dist-info → sxs-2024.0.13.dist-info}/RECORD +11 -11
- {sxs-2024.0.11.dist-info → sxs-2024.0.13.dist-info}/WHEEL +0 -0
- {sxs-2024.0.11.dist-info → sxs-2024.0.13.dist-info}/licenses/LICENSE +0 -0
sxs/__init__.py
CHANGED
|
@@ -29,7 +29,7 @@ from .waveforms import rotating_paired_xor_multishuffle_bzip2 as rpxmb
|
|
|
29
29
|
from .waveforms import rotating_paired_diff_multishuffle_bzip2 as rpdmb
|
|
30
30
|
from .waveforms import spectre_cce_v1
|
|
31
31
|
from . import catalog, metadata, horizons, waveforms, zenodo, caltechdata
|
|
32
|
-
from .simulations import Simulation, Simulations
|
|
32
|
+
from .simulations import Simulation, Simulations, write_local_simulations, local_simulations
|
|
33
33
|
from .handlers import load, load_via_sxs_id, loadcontext, load_lvc
|
|
34
34
|
|
|
35
35
|
# The speed of light is, of course, defined to be exactly
|
sxs/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2024.0.
|
|
1
|
+
__version__ = "2024.0.13"
|
sxs/handlers.py
CHANGED
|
@@ -283,6 +283,9 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
|
|
|
283
283
|
elif location == "simulations":
|
|
284
284
|
return Simulations.load(download=download)
|
|
285
285
|
|
|
286
|
+
elif location == "local_simulations":
|
|
287
|
+
return Simulations.local(download=download)
|
|
288
|
+
|
|
286
289
|
elif sxs_id_version_lev_exact_re.match(location):
|
|
287
290
|
return Simulation(location, download=download, cache=cache, progress=progress, **kwargs)
|
|
288
291
|
|
sxs/simulations/__init__.py
CHANGED
sxs/simulations/local.py
CHANGED
|
@@ -84,13 +84,15 @@ def local_simulations(annex_dir):
|
|
|
84
84
|
each file that would be uploaded if the simulation were
|
|
85
85
|
published.
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
Parameters
|
|
88
|
+
----------
|
|
89
|
+
annex_dir : (str or Path)
|
|
90
|
+
The path to the annex directory to be processed.
|
|
91
|
+
|
|
92
|
+
Returns
|
|
93
|
+
-------
|
|
94
|
+
dict :
|
|
95
|
+
A dictionary containing the processed metadata.
|
|
94
96
|
"""
|
|
95
97
|
from os import walk
|
|
96
98
|
|
|
@@ -130,18 +132,33 @@ def local_simulations(annex_dir):
|
|
|
130
132
|
return simulations
|
|
131
133
|
|
|
132
134
|
|
|
133
|
-
def write_local_simulations(annex_dir):
|
|
135
|
+
def write_local_simulations(annex_dir, output_file=None):
|
|
134
136
|
"""Write the local simulations to a file for use when loading `Simulations`
|
|
135
137
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
Parameters
|
|
139
|
+
----------
|
|
140
|
+
annex_dir : (str or Path)
|
|
141
|
+
The path to the annex directory to be processed.
|
|
142
|
+
output_file : (str or Path, optional)
|
|
143
|
+
The path to the file to be written. By default, the file is
|
|
144
|
+
written to `sxs_directory("cache") / "local_simulations.json"`.
|
|
145
|
+
N.B.: If you specify a different file, `sxs.load` will not
|
|
146
|
+
automatically find it.
|
|
147
|
+
|
|
148
|
+
Returns
|
|
149
|
+
-------
|
|
141
150
|
None
|
|
142
151
|
"""
|
|
143
152
|
from json import dump
|
|
144
153
|
|
|
154
|
+
# Process the annex directory to find all simulations
|
|
145
155
|
simulations = local_simulations(annex_dir)
|
|
146
|
-
|
|
156
|
+
|
|
157
|
+
# Write the simulations to file
|
|
158
|
+
if output_file is None:
|
|
159
|
+
output_file = sxs_directory("cache") / "local_simulations.json"
|
|
160
|
+
else:
|
|
161
|
+
output_file = Path(output_file)
|
|
162
|
+
output_file.parent.mkdir(parents=True, exist_ok=True)
|
|
163
|
+
with output_file.open("w") as f:
|
|
147
164
|
dump(simulations, f, indent=2, separators=(",", ": "), ensure_ascii=True)
|
sxs/simulations/simulation.py
CHANGED
|
@@ -423,7 +423,7 @@ class SimulationBase:
|
|
|
423
423
|
`f_ref`.
|
|
424
424
|
|
|
425
425
|
Parameters
|
|
426
|
-
|
|
426
|
+
----------
|
|
427
427
|
t_ref : float, optional
|
|
428
428
|
The reference time at which the waveform frame is specified.
|
|
429
429
|
This is measured in units of M, and defined relative to the
|
|
@@ -456,7 +456,7 @@ class SimulationBase:
|
|
|
456
456
|
including all modes up to and including this ell value.
|
|
457
457
|
|
|
458
458
|
Returns
|
|
459
|
-
|
|
459
|
+
-------
|
|
460
460
|
times : float array
|
|
461
461
|
Uniformly spaced 1D array of times, in units of M, at which
|
|
462
462
|
the waveform and dynamics quantities are returned. Aligned
|
sxs/simulations/simulations.py
CHANGED
|
@@ -64,6 +64,55 @@ class Simulations(collections.OrderedDict):
|
|
|
64
64
|
)
|
|
65
65
|
return datetime.min.replace(tzinfo=timezone.utc)
|
|
66
66
|
return remote_timestamp
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def local(cls, directory=None, *, download=None):
|
|
70
|
+
"""Load the local catalog of SXS simulations
|
|
71
|
+
|
|
72
|
+
This function loads the standard public catalog, but also
|
|
73
|
+
includes any local simulations found in the given directory.
|
|
74
|
+
If no directory is provided, it will look for the local
|
|
75
|
+
simulations file in the sxs cache directory.
|
|
76
|
+
|
|
77
|
+
Parameters
|
|
78
|
+
----------
|
|
79
|
+
directory : {None, str, Path}, optional
|
|
80
|
+
A directory containing subdirectories of SXS simulations.
|
|
81
|
+
See `sxs.local_simulations` for details about what is
|
|
82
|
+
expected in this directory. If None (the default), it
|
|
83
|
+
will look for the local simulations file in the sxs cache
|
|
84
|
+
directory.
|
|
85
|
+
download : {None, bool}, optional
|
|
86
|
+
Passed to `Simulations.load` when loading the public set
|
|
87
|
+
of simulations.
|
|
88
|
+
|
|
89
|
+
See Also
|
|
90
|
+
--------
|
|
91
|
+
sxs.local_simulations : Search for local simulations
|
|
92
|
+
sxs.write_local_simulations : Write local simulations to a file
|
|
93
|
+
|
|
94
|
+
"""
|
|
95
|
+
import json
|
|
96
|
+
from .local import write_local_simulations
|
|
97
|
+
from .. import sxs_directory
|
|
98
|
+
|
|
99
|
+
local_path = sxs_directory("cache") / "local_simulations.json"
|
|
100
|
+
if directory is not None:
|
|
101
|
+
write_local_simulations(directory)
|
|
102
|
+
if not local_path.exists():
|
|
103
|
+
if directory is not None:
|
|
104
|
+
raise ValueError(f"Writing local simulations for {directory=} failed")
|
|
105
|
+
else:
|
|
106
|
+
raise ValueError(
|
|
107
|
+
f"Local simulations file not found, but no `directory` was provided.\n"
|
|
108
|
+
+ "If called from `sxs.load`, just pass the name of the directory."
|
|
109
|
+
)
|
|
110
|
+
with local_path.open("r") as f:
|
|
111
|
+
local_simulations = json.load(f)
|
|
112
|
+
simulations = cls.load(download)
|
|
113
|
+
simulations.update(local_simulations)
|
|
114
|
+
simulations.__file__ = str(local_path)
|
|
115
|
+
return simulations
|
|
67
116
|
|
|
68
117
|
@classmethod
|
|
69
118
|
@functools.lru_cache()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sxs
|
|
3
|
-
Version: 2024.0.
|
|
3
|
+
Version: 2024.0.13
|
|
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/
|
|
@@ -44,7 +44,7 @@ Requires-Dist: pandas>=1.1.2
|
|
|
44
44
|
Requires-Dist: pytz>=2020.1
|
|
45
45
|
Requires-Dist: quaternionic>=1.0
|
|
46
46
|
Requires-Dist: requests>=2.24.0
|
|
47
|
-
Requires-Dist: scipy>=1.
|
|
47
|
+
Requires-Dist: scipy>=1.7
|
|
48
48
|
Requires-Dist: spherical>=1.0
|
|
49
49
|
Requires-Dist: tqdm>=4.63.1
|
|
50
50
|
Requires-Dist: urllib3>=1.25.10
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
sxs/__init__.py,sha256=
|
|
2
|
-
sxs/__version__.py,sha256=
|
|
3
|
-
sxs/handlers.py,sha256=
|
|
1
|
+
sxs/__init__.py,sha256=hbydsXWR88sFiKExPJ1NHWGEvWRbbJBjSc1irSMYKgY,2623
|
|
2
|
+
sxs/__version__.py,sha256=ccSsvMKSEb0DDrHig0GNWueoK8ceho4S2fY9o4nd_po,26
|
|
3
|
+
sxs/handlers.py,sha256=bnQ1pH9EXZV_1iW9zf_WA61CfsavFjbcA0gmtoY5KWY,16770
|
|
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
|
|
@@ -17,10 +17,10 @@ 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
19
|
sxs/metadata/metadata.py,sha256=y6X7LcsJKiZFjBPTwRHGtsT2uHf2s0r0OG_EGjD27pE,27663
|
|
20
|
-
sxs/simulations/__init__.py,sha256=
|
|
21
|
-
sxs/simulations/local.py,sha256=
|
|
22
|
-
sxs/simulations/simulation.py,sha256=
|
|
23
|
-
sxs/simulations/simulations.py,sha256=
|
|
20
|
+
sxs/simulations/__init__.py,sha256=GrZym0PHTULDg_hyFmISNzDfqVLz_hQo-djbgecZs54,134
|
|
21
|
+
sxs/simulations/local.py,sha256=Q3BZoLT8sPx5gLbNgbyswQvk9kebts-vcXipaR3veCA,5731
|
|
22
|
+
sxs/simulations/simulation.py,sha256=WgxvZexjBH9fwd5qKID7YwvA1wglHerXwS_VQT1LlkY,33915
|
|
23
|
+
sxs/simulations/simulations.py,sha256=AVoNcsW0RN4GGHiPEdVilUXN1jMGAGm8FfiWMIF3ZaU,19127
|
|
24
24
|
sxs/utilities/__init__.py,sha256=KTtsBKblP02t20anSzV_7tucRUw_bFObY5my5ZuJEBU,4793
|
|
25
25
|
sxs/utilities/bitwise.py,sha256=G9ZNYgwDQRhq5wbDf-p2HcUqkEP_IRDiQoXW4KyU17k,13205
|
|
26
26
|
sxs/utilities/dicts.py,sha256=CCpm3upG_9SRj9gjawukSUfaJ5asF-XRG2ausEXhYyg,695
|
|
@@ -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-2024.0.
|
|
83
|
-
sxs-2024.0.
|
|
84
|
-
sxs-2024.0.
|
|
85
|
-
sxs-2024.0.
|
|
82
|
+
sxs-2024.0.13.dist-info/METADATA,sha256=7lXzXHpcbDsfFGk4PPNrfY7Rhzkr2spdIWGv7_H4jME,9245
|
|
83
|
+
sxs-2024.0.13.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
84
|
+
sxs-2024.0.13.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
|
|
85
|
+
sxs-2024.0.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|