sxs 2024.0.40__tar.gz → 2024.0.42__tar.gz
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-2024.0.40 → sxs-2024.0.42}/CITATION.cff +2 -2
- {sxs-2024.0.40 → sxs-2024.0.42}/PKG-INFO +1 -1
- sxs-2024.0.42/sxs/__version__.py +1 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/metadata/metadata.py +6 -2
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/metadata/metric.py +7 -3
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/simulations/local.py +9 -1
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/simulations/simulation.py +38 -14
- sxs-2024.0.40/sxs/__version__.py +0 -1
- {sxs-2024.0.40 → sxs-2024.0.42}/.codecov.yml +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/.github/dependabot.yml +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/.github/scripts/parse_bump_rule.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/.github/workflows/build.yml +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/.github/workflows/pr_rtd_link.yml +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/.gitignore +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/.readthedocs.yaml +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/LICENSE +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/README.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/catalog.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/horizons.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/load.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/metadata.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/simulation.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/simulations.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/time_series.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/api/waveforms.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/html/main.html +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/images/favicon.ico +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/index.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/javascript/mathjax.js +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/julia.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/mathematica.md +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/stylesheets/extra.css +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/tutorials/00-Introduction.ipynb +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/tutorials/01-Simulations_and_Metadata.ipynb +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/tutorials/02-Simulation.ipynb +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/tutorials/03-Horizons.ipynb +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/tutorials/04-Waveforms.ipynb +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/docs/tutorials/05-PreprocessingForFFTs.ipynb +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/mkdocs.yml +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/pyproject.toml +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/caltechdata/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/caltechdata/catalog.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/caltechdata/login.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/catalog/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/catalog/catalog.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/catalog/create.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/catalog/description.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/handlers.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/horizons/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/horizons/spec_horizons_h5.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/horizons/xor_multishuffle_bzip2.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/julia/GWFrames.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/julia/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/juliapkg.json +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/metadata/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/simulations/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/simulations/simulations.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/time_series.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/bitwise.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/decimation/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/decimation/greedy_spline.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/decimation/linear_bisection.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/decimation/peak_greed.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/decimation/suppression.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/dicts.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/downloads.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/files.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/formats.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/inspire.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/comparisons.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/conversion.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/dataset.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/horizons.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/metadata.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/waveform_amp_phase.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/lvcnr/waveforms.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/monotonicity.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/pretty_print.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/references/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/references/ads.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/references/arxiv.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/references/fairchild_report.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/references/inspire.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/references/journal_abbreviations.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/references/references.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/select.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/smooth_functions.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/string_converters.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/sxs_directories.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/sxs_identifiers.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/utilities/url.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/alignment.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/format_handlers/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/format_handlers/grathena.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/format_handlers/lvc.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/format_handlers/nrar.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/format_handlers/rotating_paired_xor_multishuffle_bzip2.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/format_handlers/spectre_cce_v1.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/memory.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/mode_utilities.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/transformations.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/waveform_grid.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/waveform_mixin.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/waveform_modes.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/waveforms/waveform_signal.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/api/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/api/deposit.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/api/login.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/api/records.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/catalog.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/creators.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/simannex.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/sxs/zenodo/surrogatemodeling.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/__init__.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/conftest.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_catalog.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_horizons.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_julia.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_loader.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_metadata.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_simulation.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_time_series.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_transformations.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_utilities.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_waveform_rotations.py +0 -0
- {sxs-2024.0.40 → sxs-2024.0.42}/tests/test_waveforms.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sxs
|
|
3
|
-
Version: 2024.0.
|
|
3
|
+
Version: 2024.0.42
|
|
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/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2024.0.42"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import re
|
|
4
4
|
import collections
|
|
5
|
+
import numpy as np
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
_valid_identifier_pattern = re.compile(r'\W|^(?=\d)')
|
|
@@ -29,8 +30,11 @@ def _backwards_compatibility(metadata):
|
|
|
29
30
|
# it's probably a good idea to duplicate whatever is included here
|
|
30
31
|
# in that function, just to make sure nothing slips through the
|
|
31
32
|
# cracks.
|
|
32
|
-
if "number_of_orbits" not in metadata
|
|
33
|
-
|
|
33
|
+
if "number_of_orbits" not in metadata:
|
|
34
|
+
if "number_of_orbits_from_start" in metadata:
|
|
35
|
+
metadata["number_of_orbits"] = metadata["number_of_orbits_from_start"]
|
|
36
|
+
else:
|
|
37
|
+
metadata["number_of_orbits"] = np.nan
|
|
34
38
|
return metadata
|
|
35
39
|
|
|
36
40
|
|
|
@@ -14,6 +14,9 @@ class MetadataMetric:
|
|
|
14
14
|
metadata, rather than as a strict metric for clustering or
|
|
15
15
|
classification.
|
|
16
16
|
|
|
17
|
+
Note that calling an object of this class with two metadata
|
|
18
|
+
collections will return the *squared* distance between them.
|
|
19
|
+
|
|
17
20
|
Parameters
|
|
18
21
|
----------
|
|
19
22
|
parameters : list of str, optional
|
|
@@ -60,13 +63,14 @@ class MetadataMetric:
|
|
|
60
63
|
def __init__(
|
|
61
64
|
self,
|
|
62
65
|
parameters=[
|
|
63
|
-
"
|
|
66
|
+
"reference_mass1",
|
|
67
|
+
"reference_mass2",
|
|
64
68
|
"reference_dimensionless_spin1",
|
|
65
69
|
"reference_dimensionless_spin2",
|
|
66
70
|
"reference_eccentricity",
|
|
67
71
|
"reference_mean_anomaly",
|
|
68
72
|
],
|
|
69
|
-
metric=np.diag([1, 1, 1, 1, 1, 1, 1, 1, 1/np.pi**2]),
|
|
73
|
+
metric=np.diag([1, 1, 1, 1, 1, 1, 1, 1, 1, 1/np.pi**2]),
|
|
70
74
|
allow_different_object_types=False,
|
|
71
75
|
eccentricity_threshold1=1e-2,
|
|
72
76
|
eccentricity_threshold2=1e-3,
|
|
@@ -113,7 +117,7 @@ class MetadataMetric:
|
|
|
113
117
|
values1[i], values2[i] = np.unwrap([floater(values1[i]), floater(values2[i])])
|
|
114
118
|
|
|
115
119
|
if "reference_eccentricity" in self.parameters:
|
|
116
|
-
# Either way, we first make sure that the corresponding entries are floats.
|
|
120
|
+
# Either way, we first try to make sure that the corresponding entries are floats.
|
|
117
121
|
i = self.parameters.index("reference_eccentricity")
|
|
118
122
|
values1[i] = metadata1.get("reference_eccentricity_bound", floaterbound(values1[i]))
|
|
119
123
|
values2[i] = metadata2.get("reference_eccentricity_bound", floaterbound(values2[i]))
|
|
@@ -153,7 +153,14 @@ def local_simulations(annex_dir, compute_md5=False, show_progress=False):
|
|
|
153
153
|
files = files_to_upload(dirpath, annex_dir)
|
|
154
154
|
|
|
155
155
|
metadata["mtime"] = datetime.fromtimestamp(
|
|
156
|
-
max(
|
|
156
|
+
max(
|
|
157
|
+
(
|
|
158
|
+
file.resolve().stat().st_mtime
|
|
159
|
+
for file in files
|
|
160
|
+
if file.exists()
|
|
161
|
+
),
|
|
162
|
+
default=0.0,
|
|
163
|
+
),
|
|
157
164
|
tz=timezone.utc,
|
|
158
165
|
).isoformat()
|
|
159
166
|
|
|
@@ -164,6 +171,7 @@ def local_simulations(annex_dir, compute_md5=False, show_progress=False):
|
|
|
164
171
|
"checksum": md5checksum(file) if compute_md5 else "",
|
|
165
172
|
}
|
|
166
173
|
for file in files
|
|
174
|
+
if file.exists()
|
|
167
175
|
}
|
|
168
176
|
except KeyboardInterrupt:
|
|
169
177
|
raise
|
|
@@ -59,13 +59,14 @@ def Simulation(location, *args, **kwargs):
|
|
|
59
59
|
If `True`, completely bypass checking for deprecation or
|
|
60
60
|
supersession. No warnings or errors will be issued. Default
|
|
61
61
|
is `False`.
|
|
62
|
-
auto_supersede : bool, optional
|
|
63
|
-
If
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
issued
|
|
68
|
-
that this can also be set in the configuration
|
|
62
|
+
auto_supersede : bool or float, optional
|
|
63
|
+
If present, automatically load the closest undeprecated
|
|
64
|
+
simulation. If this is a float and the distance to the
|
|
65
|
+
closest undeprecated simulation (see the following argument)
|
|
66
|
+
is larger, a ValueError will be raised. Otherwise, a warning
|
|
67
|
+
will be issued with the ID of the new simulation and the
|
|
68
|
+
distance. Note that this can also be set in the configuration
|
|
69
|
+
file by calling, e.g.,
|
|
69
70
|
`sxs.write_config(auto_supersede=True)`.
|
|
70
71
|
metadata_metric : MetadataMetric, optional
|
|
71
72
|
Metric to use for comparing simulations when automatically
|
|
@@ -147,8 +148,9 @@ def Simulation(location, *args, **kwargs):
|
|
|
147
148
|
f"Simulation '{location}' is deprecated. You could\n"
|
|
148
149
|
+ " 1. pass `ignore_deprecation=True` to load the latest available version,\n"
|
|
149
150
|
+ " 2. manually choose a different simulation from the catalog,\n"
|
|
150
|
-
+ " 3. pass `auto_supersede=
|
|
151
|
-
+
|
|
151
|
+
+ " 3. pass `auto_supersede=0.01` to load a match closer than 0.01 in the catalog if one exists,\n"
|
|
152
|
+
+ " 4. pass `auto_supersede=True` to load the closest match in the catalog, or\n"
|
|
153
|
+
+ f" 5. include the version number, as in '{sxs_id_stem}v2.0', to load a specific version.\n"
|
|
152
154
|
)
|
|
153
155
|
else:
|
|
154
156
|
message = ("\n"
|
|
@@ -170,11 +172,25 @@ def Simulation(location, *args, **kwargs):
|
|
|
170
172
|
original_kwargs["ignore_deprecation"] = True
|
|
171
173
|
original = Simulation(location, *args, **original_kwargs)
|
|
172
174
|
metadata_metric = kwargs.pop("metadata_metric", MetadataMetric())
|
|
173
|
-
superseding = original.closest_simulation(
|
|
175
|
+
superseding, distance = original.closest_simulation(
|
|
174
176
|
dataframe=simulations.dataframe,
|
|
175
177
|
metadata_metric=metadata_metric
|
|
176
178
|
)
|
|
177
|
-
|
|
179
|
+
if isinstance(auto_supersede, str):
|
|
180
|
+
try:
|
|
181
|
+
auto_supersede = float(auto_supersede)
|
|
182
|
+
except:
|
|
183
|
+
pass
|
|
184
|
+
if isinstance(auto_supersede, float) and distance > auto_supersede:
|
|
185
|
+
raise ValueError(
|
|
186
|
+
f"Simulation '{sxs_id}' is deprecated, but the closest undeprecated\n"
|
|
187
|
+
f"simulation is more distant than allowed by `auto_supersede` argument:\n"
|
|
188
|
+
f"{distance:.3g} > {auto_supersede:.3g}.\n"
|
|
189
|
+
)
|
|
190
|
+
message = (
|
|
191
|
+
f"\nSimulation '{sxs_id}' is being automatically superseded by '{superseding}'."
|
|
192
|
+
f"\nThe distance between them in the given metadata metric is {distance:.3g}."
|
|
193
|
+
)
|
|
178
194
|
warn(message)
|
|
179
195
|
new_location = f"{superseding}{input_version}"
|
|
180
196
|
if input_lev_number:
|
|
@@ -342,6 +358,7 @@ class SimulationBase:
|
|
|
342
358
|
metadata
|
|
343
359
|
|
|
344
360
|
"""
|
|
361
|
+
from numpy import sqrt
|
|
345
362
|
from ..metadata.metric import MetadataMetric
|
|
346
363
|
from .. import load
|
|
347
364
|
if dataframe is None:
|
|
@@ -350,11 +367,11 @@ class SimulationBase:
|
|
|
350
367
|
if drop_deprecated:
|
|
351
368
|
dataframe = dataframe[~dataframe.deprecated]
|
|
352
369
|
return dataframe.apply(
|
|
353
|
-
lambda m: metadata_metric(self.metadata, m),
|
|
370
|
+
lambda m: sqrt(metadata_metric(self.metadata, m)),
|
|
354
371
|
axis=1
|
|
355
372
|
)
|
|
356
373
|
|
|
357
|
-
def closest_simulation(self, dataframe=None, metadata_metric=None):
|
|
374
|
+
def closest_simulation(self, dataframe=None, metadata_metric=None, warning_threshold=1e-2):
|
|
358
375
|
"""Return the closest undeprecated simulation to this one
|
|
359
376
|
|
|
360
377
|
Note that any simulation in `dataframe` with zero distance
|
|
@@ -370,12 +387,17 @@ class SimulationBase:
|
|
|
370
387
|
metadata_metric : MetadataMetric, optional
|
|
371
388
|
Metric to use for comparing simulations. If not provided,
|
|
372
389
|
the default metric will be used.
|
|
390
|
+
warning_threshold : float, optional
|
|
391
|
+
Threshold distance above which a warning will be issued
|
|
392
|
+
that the closest simulation is fairly distant. Default is
|
|
393
|
+
1e-3.
|
|
373
394
|
|
|
374
395
|
Returns
|
|
375
396
|
-------
|
|
376
397
|
closest_index : str
|
|
377
398
|
Index of the closest undeprecated simulation in the
|
|
378
399
|
`dataframe`.
|
|
400
|
+
distance : float
|
|
379
401
|
|
|
380
402
|
"""
|
|
381
403
|
d = self.distances(
|
|
@@ -384,7 +406,9 @@ class SimulationBase:
|
|
|
384
406
|
drop_deprecated=True
|
|
385
407
|
)
|
|
386
408
|
d = d[d > 0].sort_values()
|
|
387
|
-
|
|
409
|
+
if d.iloc[0] > warning_threshold:
|
|
410
|
+
warn(f"\nClosest simulation ({d.index[0]}) is fairly distant: {d.iloc[0]:.3g}")
|
|
411
|
+
return d.index[0], d.iloc[0]
|
|
388
412
|
|
|
389
413
|
@property
|
|
390
414
|
def dataframe(self):
|
sxs-2024.0.40/sxs/__version__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2024.0.40"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|