sxs 2024.0.32__py3-none-any.whl → 2024.0.33__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/simulations/local.py +21 -4
- {sxs-2024.0.32.dist-info → sxs-2024.0.33.dist-info}/METADATA +1 -1
- {sxs-2024.0.32.dist-info → sxs-2024.0.33.dist-info}/RECORD +6 -6
- {sxs-2024.0.32.dist-info → sxs-2024.0.33.dist-info}/WHEEL +0 -0
- {sxs-2024.0.32.dist-info → sxs-2024.0.33.dist-info}/licenses/LICENSE +0 -0
sxs/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2024.0.
|
|
1
|
+
__version__ = "2024.0.33"
|
sxs/simulations/local.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from .. import sxs_id, Metadata, sxs_directory
|
|
3
3
|
from ..utilities import sxs_identifier_re
|
|
4
|
-
from ..zenodo import path_to_invenio
|
|
4
|
+
from ..zenodo import path_to_invenio
|
|
5
5
|
|
|
6
6
|
def file_upload_allowed(file, directory_listing):
|
|
7
7
|
"""Return True if the file should be uploaded
|
|
@@ -65,7 +65,7 @@ def extract_id_from_common_metadata(file, annex_dir):
|
|
|
65
65
|
return key
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
def local_simulations(annex_dir):
|
|
68
|
+
def local_simulations(annex_dir, compute_md5=False):
|
|
69
69
|
"""
|
|
70
70
|
Walk the annex directory to find and process all simulations
|
|
71
71
|
|
|
@@ -88,6 +88,9 @@ def local_simulations(annex_dir):
|
|
|
88
88
|
----------
|
|
89
89
|
annex_dir : (str or Path)
|
|
90
90
|
The path to the annex directory to be processed.
|
|
91
|
+
compute_md5 : bool, optional
|
|
92
|
+
Whether to compute the MD5 hash of each file. Default is
|
|
93
|
+
False.
|
|
91
94
|
|
|
92
95
|
Returns
|
|
93
96
|
-------
|
|
@@ -95,6 +98,7 @@ def local_simulations(annex_dir):
|
|
|
95
98
|
A dictionary containing the processed metadata.
|
|
96
99
|
"""
|
|
97
100
|
from os import walk
|
|
101
|
+
from ..utilities import md5checksum
|
|
98
102
|
|
|
99
103
|
simulations = {}
|
|
100
104
|
annex_dir = Path(annex_dir).resolve()
|
|
@@ -121,8 +125,14 @@ def local_simulations(annex_dir):
|
|
|
121
125
|
metadata = Metadata.load(dirpath / highest_lev / "metadata")
|
|
122
126
|
metadata = metadata.add_standard_parameters()
|
|
123
127
|
|
|
128
|
+
metadata["directory"] = str(dirpath.relative_to(annex_dir))
|
|
129
|
+
|
|
124
130
|
metadata["files"] = {
|
|
125
|
-
|
|
131
|
+
path_to_invenio(file.relative_to(dirpath)): {
|
|
132
|
+
"link": str(file),
|
|
133
|
+
"size": file.stat().st_size,
|
|
134
|
+
"checksum": md5checksum(file) if compute_md5 else "",
|
|
135
|
+
}
|
|
126
136
|
for file in files_to_upload(dirpath, annex_dir)
|
|
127
137
|
}
|
|
128
138
|
|
|
@@ -136,6 +146,10 @@ def local_simulations(annex_dir):
|
|
|
136
146
|
def write_local_simulations(annex_dir, output_file=None):
|
|
137
147
|
"""Write the local simulations to a file for use when loading `Simulations`
|
|
138
148
|
|
|
149
|
+
This function calls `local_simulations` to obtain the dictionary,
|
|
150
|
+
but also writes the dictionary to a JSON file.
|
|
151
|
+
|
|
152
|
+
|
|
139
153
|
Parameters
|
|
140
154
|
----------
|
|
141
155
|
annex_dir : (str or Path)
|
|
@@ -148,7 +162,8 @@ def write_local_simulations(annex_dir, output_file=None):
|
|
|
148
162
|
|
|
149
163
|
Returns
|
|
150
164
|
-------
|
|
151
|
-
|
|
165
|
+
dict :
|
|
166
|
+
A dictionary containing the processed metadata.
|
|
152
167
|
"""
|
|
153
168
|
from json import dump
|
|
154
169
|
|
|
@@ -163,3 +178,5 @@ def write_local_simulations(annex_dir, output_file=None):
|
|
|
163
178
|
output_file.parent.mkdir(parents=True, exist_ok=True)
|
|
164
179
|
with output_file.open("w") as f:
|
|
165
180
|
dump(simulations, f, indent=2, separators=(",", ": "), ensure_ascii=True)
|
|
181
|
+
|
|
182
|
+
return simulations
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sxs
|
|
3
|
-
Version: 2024.0.
|
|
3
|
+
Version: 2024.0.33
|
|
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=hbydsXWR88sFiKExPJ1NHWGEvWRbbJBjSc1irSMYKgY,2623
|
|
2
|
-
sxs/__version__.py,sha256=
|
|
2
|
+
sxs/__version__.py,sha256=1aAfFJkJXDhyQxvB5A7JGzfK5gLev3uJrAgjXgoxXkA,26
|
|
3
3
|
sxs/handlers.py,sha256=Nc1_aDKm_wDHg2cITI_ljbqU4VRWpwQ7fdgy3c1XcE8,17531
|
|
4
4
|
sxs/juliapkg.json,sha256=-baaa3Za_KBmmiGjlh2YYLWmvUvZl6GaKKXwNI4S7qU,178
|
|
5
5
|
sxs/time_series.py,sha256=OKaLg8tFyrtKcef7900ri-a0C6A8wKxA68KovZXvH6I,41081
|
|
@@ -18,7 +18,7 @@ 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=EEax1WTKL4G5U__wHefbBX0l4vtIHTcYFnHwziGkVhM,28348
|
|
20
20
|
sxs/simulations/__init__.py,sha256=GrZym0PHTULDg_hyFmISNzDfqVLz_hQo-djbgecZs54,134
|
|
21
|
-
sxs/simulations/local.py,sha256=
|
|
21
|
+
sxs/simulations/local.py,sha256=51ULBmrodAPZXv2_qpLeEWKIR9zwPGR-zPt7XG8Vcqs,6403
|
|
22
22
|
sxs/simulations/simulation.py,sha256=OqQh6xq-s_JoQI6e2XA5j194L0DT3HGYIW8ZZiurZ2Y,34631
|
|
23
23
|
sxs/simulations/simulations.py,sha256=ATxrcihvblGgRHdR7vIMg5eKghN5Jo6U0CafTro4wYA,24827
|
|
24
24
|
sxs/utilities/__init__.py,sha256=WSStlqljfgQheMxHGfuofSc5LdmASGvO3FNO3f_zaT0,4806
|
|
@@ -80,7 +80,7 @@ sxs/zenodo/api/__init__.py,sha256=EM_eh4Q8R5E0vIfMhyIR1IYFfOBu6vA0UTasgX9gHys,21
|
|
|
80
80
|
sxs/zenodo/api/deposit.py,sha256=J4RGvGjh0cEOrN4bBZWEDcPAhNscqB2fzLlvRZ5HTHM,36948
|
|
81
81
|
sxs/zenodo/api/login.py,sha256=Yz0ytgi81_5BpDzhrS0WPMXlvU2qUaCK8yn8zxfEbko,18007
|
|
82
82
|
sxs/zenodo/api/records.py,sha256=nKkhoHZ95CTztHF9Zzaug5p7IiUCJG4Em1i-l-WqH6U,3689
|
|
83
|
-
sxs-2024.0.
|
|
84
|
-
sxs-2024.0.
|
|
85
|
-
sxs-2024.0.
|
|
86
|
-
sxs-2024.0.
|
|
83
|
+
sxs-2024.0.33.dist-info/METADATA,sha256=agwAnGwVuDDEI52_MS-8kMT1aX7c6Ps-E5SWq0l6kYE,9253
|
|
84
|
+
sxs-2024.0.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
85
|
+
sxs-2024.0.33.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
|
|
86
|
+
sxs-2024.0.33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|