sxs 2025.0.12__tar.gz → 2025.0.14__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.
Files changed (142) hide show
  1. {sxs-2025.0.12 → sxs-2025.0.14}/CITATION.cff +8 -2
  2. {sxs-2025.0.12 → sxs-2025.0.14}/PKG-INFO +134 -54
  3. sxs-2025.0.14/README.md +209 -0
  4. sxs-2025.0.14/docs/api/cite.md +10 -0
  5. sxs-2025.0.14/docs/api/metadata.md +3 -0
  6. {sxs-2025.0.12 → sxs-2025.0.14}/docs/api/simulation.md +4 -1
  7. {sxs-2025.0.12 → sxs-2025.0.14}/docs/mathematica.md +1 -1
  8. {sxs-2025.0.12 → sxs-2025.0.14}/docs/tutorials/00-Introduction.ipynb +21 -21
  9. sxs-2025.0.14/docs/tutorials/01-Catalog_Dataframe.ipynb +4318 -0
  10. sxs-2025.0.14/docs/tutorials/02-Simulation.ipynb +700 -0
  11. sxs-2025.0.14/docs/tutorials/03-Horizons.ipynb +422 -0
  12. {sxs-2025.0.12 → sxs-2025.0.14}/docs/tutorials/04-Waveforms.ipynb +78 -30
  13. sxs-2025.0.14/docs/tutorials/05-PreprocessingForFFTs.ipynb +524 -0
  14. {sxs-2025.0.12 → sxs-2025.0.14}/mkdocs.yml +2 -1
  15. {sxs-2025.0.12 → sxs-2025.0.14}/pyproject.toml +1 -0
  16. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/__init__.py +1 -0
  17. sxs-2025.0.14/sxs/__version__.py +1 -0
  18. sxs-2025.0.14/sxs/citation.py +205 -0
  19. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/simulations/simulation.py +16 -9
  20. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/api/login.py +1 -1
  21. sxs-2025.0.12/README.md +0 -130
  22. sxs-2025.0.12/docs/api/metadata.md +0 -3
  23. sxs-2025.0.12/docs/tutorials/01-Simulations_and_Metadata.ipynb +0 -4739
  24. sxs-2025.0.12/docs/tutorials/02-Simulation.ipynb +0 -564
  25. sxs-2025.0.12/docs/tutorials/03-Horizons.ipynb +0 -412
  26. sxs-2025.0.12/docs/tutorials/05-PreprocessingForFFTs.ipynb +0 -521
  27. sxs-2025.0.12/sxs/__version__.py +0 -1
  28. {sxs-2025.0.12 → sxs-2025.0.14}/.codecov.yml +0 -0
  29. {sxs-2025.0.12 → sxs-2025.0.14}/.github/ISSUE_TEMPLATE/catalog-data-issue-template.md +0 -0
  30. {sxs-2025.0.12 → sxs-2025.0.14}/.github/dependabot.yml +0 -0
  31. {sxs-2025.0.12 → sxs-2025.0.14}/.github/scripts/parse_bump_rule.py +0 -0
  32. {sxs-2025.0.12 → sxs-2025.0.14}/.github/workflows/build.yml +0 -0
  33. {sxs-2025.0.12 → sxs-2025.0.14}/.github/workflows/pr_rtd_link.yml +0 -0
  34. {sxs-2025.0.12 → sxs-2025.0.14}/.gitignore +0 -0
  35. {sxs-2025.0.12 → sxs-2025.0.14}/.readthedocs.yaml +0 -0
  36. {sxs-2025.0.12 → sxs-2025.0.14}/LICENSE +0 -0
  37. {sxs-2025.0.12 → sxs-2025.0.14}/docs/api/catalog.md +0 -0
  38. {sxs-2025.0.12 → sxs-2025.0.14}/docs/api/horizons.md +0 -0
  39. {sxs-2025.0.12 → sxs-2025.0.14}/docs/api/load.md +0 -0
  40. {sxs-2025.0.12 → sxs-2025.0.14}/docs/api/simulations.md +0 -0
  41. {sxs-2025.0.12 → sxs-2025.0.14}/docs/api/time_series.md +0 -0
  42. {sxs-2025.0.12 → sxs-2025.0.14}/docs/api/waveforms.md +0 -0
  43. {sxs-2025.0.12 → sxs-2025.0.14}/docs/html/main.html +0 -0
  44. {sxs-2025.0.12 → sxs-2025.0.14}/docs/images/favicon.ico +0 -0
  45. {sxs-2025.0.12 → sxs-2025.0.14}/docs/index.md +0 -0
  46. {sxs-2025.0.12 → sxs-2025.0.14}/docs/javascript/mathjax.js +0 -0
  47. {sxs-2025.0.12 → sxs-2025.0.14}/docs/julia.md +0 -0
  48. {sxs-2025.0.12 → sxs-2025.0.14}/docs/stylesheets/extra.css +0 -0
  49. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/catalog/__init__.py +0 -0
  50. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/catalog/catalog.py +0 -0
  51. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/catalog/create.py +0 -0
  52. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/catalog/description.py +0 -0
  53. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/handlers.py +0 -0
  54. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/horizons/__init__.py +0 -0
  55. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/horizons/spec_horizons_h5.py +0 -0
  56. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/horizons/xor_multishuffle_bzip2.py +0 -0
  57. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/julia/GWFrames.py +0 -0
  58. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/julia/__init__.py +0 -0
  59. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/juliapkg.json +0 -0
  60. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/metadata/__init__.py +0 -0
  61. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/metadata/metadata.py +0 -0
  62. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/metadata/metric.py +0 -0
  63. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/simulations/__init__.py +0 -0
  64. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/simulations/analyze.py +0 -0
  65. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/simulations/local.py +0 -0
  66. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/simulations/simulations.py +0 -0
  67. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/time_series.py +0 -0
  68. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/__init__.py +0 -0
  69. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/bitwise.py +0 -0
  70. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/decimation/__init__.py +0 -0
  71. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/decimation/greedy_spline.py +0 -0
  72. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/decimation/linear_bisection.py +0 -0
  73. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/decimation/peak_greed.py +0 -0
  74. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/decimation/suppression.py +0 -0
  75. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/dicts.py +0 -0
  76. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/downloads.py +0 -0
  77. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/files.py +0 -0
  78. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/formats.py +0 -0
  79. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/inspire.py +0 -0
  80. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/__init__.py +0 -0
  81. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/comparisons.py +0 -0
  82. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/conversion.py +0 -0
  83. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/dataset.py +0 -0
  84. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/horizons.py +0 -0
  85. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/metadata.py +0 -0
  86. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/waveform_amp_phase.py +0 -0
  87. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/lvcnr/waveforms.py +0 -0
  88. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/monotonicity.py +0 -0
  89. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/pretty_print.py +0 -0
  90. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/references/__init__.py +0 -0
  91. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/references/ads.py +0 -0
  92. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/references/arxiv.py +0 -0
  93. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/references/fairchild_report.py +0 -0
  94. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/references/inspire.py +0 -0
  95. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/references/journal_abbreviations.py +0 -0
  96. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/references/references.py +0 -0
  97. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/select.py +0 -0
  98. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/smooth_functions.py +0 -0
  99. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/string_converters.py +0 -0
  100. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/sxs_directories.py +0 -0
  101. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/sxs_identifiers.py +0 -0
  102. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/utilities/url.py +0 -0
  103. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/__init__.py +0 -0
  104. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/alignment.py +0 -0
  105. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/format_handlers/__init__.py +0 -0
  106. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/format_handlers/grathena.py +0 -0
  107. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/format_handlers/lvc.py +0 -0
  108. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/format_handlers/nrar.py +0 -0
  109. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/format_handlers/rotating_paired_diff_multishuffle_bzip2.py +0 -0
  110. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/format_handlers/rotating_paired_xor_multishuffle_bzip2.py +0 -0
  111. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/format_handlers/spectre_cce_v1.py +0 -0
  112. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/memory.py +0 -0
  113. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/mode_utilities.py +0 -0
  114. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/norms.py +0 -0
  115. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/transformations.py +0 -0
  116. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/waveform_grid.py +0 -0
  117. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/waveform_mixin.py +0 -0
  118. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/waveform_modes.py +0 -0
  119. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/waveform_mts.py +0 -0
  120. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/waveforms/waveform_signal.py +0 -0
  121. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/__init__.py +0 -0
  122. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/api/__init__.py +0 -0
  123. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/api/deposit.py +0 -0
  124. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/api/records.py +0 -0
  125. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/catalog.py +0 -0
  126. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/creators.py +0 -0
  127. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/simannex.py +0 -0
  128. {sxs-2025.0.12 → sxs-2025.0.14}/sxs/zenodo/surrogatemodeling.py +0 -0
  129. {sxs-2025.0.12 → sxs-2025.0.14}/tests/__init__.py +0 -0
  130. {sxs-2025.0.12 → sxs-2025.0.14}/tests/conftest.py +0 -0
  131. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_alignment.py +0 -0
  132. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_catalog.py +0 -0
  133. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_horizons.py +0 -0
  134. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_julia.py +0 -0
  135. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_loader.py +0 -0
  136. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_metadata.py +0 -0
  137. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_simulation.py +0 -0
  138. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_time_series.py +0 -0
  139. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_transformations.py +0 -0
  140. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_utilities.py +0 -0
  141. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_waveform_rotations.py +0 -0
  142. {sxs-2025.0.12 → sxs-2025.0.14}/tests/test_waveforms.py +0 -0
@@ -4,11 +4,17 @@ authors:
4
4
  - family-names: Boyle
5
5
  given-names: Michael
6
6
  orcid: https://orcid.org/0000-0002-5075-5116
7
+ - family-names: "Mitman"
8
+ given-names: "Keefe"
9
+ orcid: "https://orcid.org/0000-0003-0276-3856"
7
10
  - family-names: "Scheel"
8
11
  given-names: "Mark"
9
12
  orcid: "https://orcid.org/0000-0001-6656-9134"
13
+ - family-names: "Stein"
14
+ given-names: "Leo"
15
+ orcid: "https://orcid.org/0000-0001-7559-9597"
10
16
  title: "The sxs package"
11
17
  license: MIT
12
18
  doi: 10.5281/zenodo.4034006
13
- version: 2025.0.12
14
- date-released: 2025-05-12
19
+ version: 2025.0.14
20
+ date-released: 2025-05-14
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sxs
3
- Version: 2025.0.12
3
+ Version: 2025.0.14
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/
@@ -35,6 +35,7 @@ Classifier: Programming Language :: Python :: 3
35
35
  Classifier: Topic :: Scientific/Engineering :: Astronomy
36
36
  Classifier: Topic :: Scientific/Engineering :: Physics
37
37
  Requires-Python: >=3.10
38
+ Requires-Dist: bibtexparser>=2.0.0b8
38
39
  Requires-Dist: h5py>=3
39
40
  Requires-Dist: inflection>=0.5.1
40
41
  Requires-Dist: juliacall>=0.9.20
@@ -77,7 +78,7 @@ Description-Content-Type: text/markdown
77
78
  [![PyPI Version](https://img.shields.io/pypi/v/sxs?color=)](https://pypi.org/project/sxs/)
78
79
  [![Conda Version](https://img.shields.io/conda/vn/conda-forge/sxs.svg?color=)](https://anaconda.org/conda-forge/sxs)
79
80
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sxs-collaboration/sxs/blob/main/LICENSE)
80
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/moble/sxs_notebooks/main)
81
+ [![Open with marimo](https://marimo.io/shield.svg)](https://data.black-holes.org/)
81
82
 
82
83
 
83
84
  # Simulating eXtreme Spacetimes package
@@ -91,11 +92,11 @@ automatically select the newest or highest-resolution dataset for a given
91
92
  simulation, or return a range of versions or resolutions. Currently, the
92
93
  high-level objects encapsulate
93
94
 
94
- * Simulations — a catalog of all simulations produced by the SXS collaboration
95
+ * Dataframe — a catalog of all simulations produced by the SXS collaboration
95
96
  * Simulation — an object encapsulating all data for a single simulation
96
97
  * Metadata — data describing the simulation parameters
97
98
  * Horizons — time-series data describing the apparent horizons
98
- * Waveforms — time-series data describing the extrapolated gravitational-wave
99
+ * Waveform — time-series data describing the extrapolated gravitational-wave
99
100
  modes
100
101
 
101
102
 
@@ -105,36 +106,25 @@ Because this package is pure python code, installation is very simple. In
105
106
  particular, with a reasonably modern installation, you can just run a command
106
107
  like
107
108
 
108
- ```bash
109
- conda install -c conda-forge sxs
110
- ```
111
-
112
- or
113
-
114
109
  ```bash
115
110
  python -m pip install sxs
116
111
  ```
117
112
 
118
- Here, `conda` requires the [conda](https://docs.anaconda.com/anaconda/install/)
119
- installation of python, which is the most recommended approach for scientific
120
- python; the second command assumes that you have an appropriate python
121
- environment set up in some other way. Either of these commands will download
122
- and install the `sxs` package and its most vital requirements.
123
-
124
- If you want to install all the goodies that enable things like jupyter
125
- notebooks with plots and interactive tables, you could run
126
-
127
- ```bash
128
- conda install -c conda-forge sxs-ecosystem
129
- ```
130
-
131
113
  or
132
114
 
133
115
  ```bash
134
- python -m pip install sxs[ecosystem]
116
+ mamba install -c conda-forge sxs
135
117
  ```
136
118
 
137
- You will probably also want to set some sensible defaults to automatically
119
+ Here, the first command assumes that you have an appropriate python
120
+ environment set up in some other way;
121
+ [`mamba`](https://mamba.readthedocs.io/en/latest/index.html) is the
122
+ newer replacement for `conda`, and is a convenient way to install
123
+ python and manage environments. Either of these commands will
124
+ download and install the `sxs` package and its most vital
125
+ requirements.
126
+
127
+ You may also want to set some convenient defaults to automatically
138
128
  download and cache data:
139
129
 
140
130
  ```bash
@@ -147,6 +137,16 @@ directory returned by `sxs.sxs_directory("cache")`. See [that function's
147
137
  documentation](https://sxs.readthedocs.io/en/main/api/sxs.utilities.sxs_directories/#sxsutilitiessxs_directoriessxs_directory)
148
138
  for details.
149
139
 
140
+ ## Citing this package and/or data
141
+
142
+ If you use this package and/or the data it provides in your research,
143
+ please cite them, including the *specific version of the data* that
144
+ you use (see below). To help with this, we provide the function
145
+ `sxs.cite`. Use `print(sxs.cite())` to see BibTeX citations for the
146
+ version of this package you are using, the most recent paper
147
+ describing the catalog, and the catalog data itself. Use, e.g.,
148
+ `print(sxs.cite("SXS:BBH:0001", "SXS:BBH:4001"))` to include citations
149
+ for those specific simulations *and* the papers that introduced them.
150
150
 
151
151
  ## Usage
152
152
 
@@ -156,36 +156,83 @@ interactive jupyter notebooks that are actually running this code and some
156
156
  pre-downloaded data. The following is just a very brief overview of the `sxs`
157
157
  package's main components.
158
158
 
159
- There are five important objects to understand in this package:
159
+ ### Loading a specific version of the catalog
160
+
161
+ For the purposes of reproducibility — both reproducing your own
162
+ results and allowing others to reproduce them — it is important to be
163
+ aware of which version of the catalog you are using, and to cite it
164
+ when you publish results using SXS data. Whenever `sxs` tries to load
165
+ data, it most first load some version of the catalog. If you do not
166
+ specify a version, it will automatically find and load the most recent
167
+ version available via github, and print out a message telling you
168
+ which version it is using, like
169
+
170
+ ```python
171
+ Loading SXS simulations using latest tag 'v3.0.0', published at 2025-05-12T10:00:00Z.
172
+ ```
173
+
174
+ For the rest of that Python session, all data loaded will be from that
175
+ version of the catalog. If you want to use a different version, you
176
+ can specify it explicitly while loading the catalog — preferably as
177
+
178
+ ```python
179
+ sxs.load("dataframe", tag="3.0.0")
180
+ ```
181
+
182
+ Even if you do not use the returned object from this command, it will
183
+ ensure that all data will be loaded from the specified version of the
184
+ catalog. Thus, it is best practice to make this call as soon as you
185
+ import the `sxs` package.
186
+
187
+
188
+ ### Interacting with the data
189
+
190
+
191
+ There are four important objects to understand in this package:
160
192
 
161
193
  ```python
162
194
  import sxs
163
195
 
164
- simulations = sxs.load("simulations")
165
- sxs_bbh_1234 = sxs.load("SXS:BBH:1234")
166
- metadata = sxs_bbh_1234.metadata
167
- horizons = sxs_bbh_1234.horizons
168
- h = sxs_bbh_1234.h
196
+ # Load a specific version of the catalog for reproducibility
197
+ df = sxs.load("dataframe", tag="3.0.0")
198
+
199
+ # Load a specific simulation
200
+ sim = sxs.load("SXS:BBH:4001")
201
+
202
+ # Obtain data about the horizons
203
+ horizons = sim.horizons
204
+
205
+ # Obtain data about the gravitational-wave strain
206
+ h = sim.h
169
207
  ```
170
208
 
171
- [The `simulations`
172
- object](https://sxs.readthedocs.io/en/main/api/simulations/) contains
173
- information about every simulation in the catalog, including all
174
- available data files, and information about how to get them. You
175
- probably don't need to actually know about details like where to get
176
- the data, but `simulations` can help you find the simulations you care
177
- about. It is a `dict` object, where the keys are names of simulations
178
- (like "SXS:BBH:0123") and the values are the same types as [the
179
- `metadata`
180
- object](https://sxs.readthedocs.io/en/main/api/sxs.metadata.metadata/#sxs.metadata.metadata.Metadata),
181
- which contains metadata about that simulation things like mass
182
- ratio, spins, etc. This `metadata` reflects the actual output of the
183
- simulations, which leads to some inconsistencies in their formats. A
184
- more consistent interface (though it is biased toward returning NaNs
185
- where a human might glean more information) is provided by
186
- `simulations.dataframe`, which returns a
187
- [`pandas`](https://pandas.pydata.org/docs/) `DataFrame` with specific
188
- data types for each column.
209
+ Note that `tag` is optional, but is good to include because it sets
210
+ the version of the catalog from which data is loaded, which ensures
211
+ reproducibility. Leave it out to see the most recent version
212
+ available, and then use that version consistently in any analysis. Be
213
+ sure to cite the specific version of the catalog you used in any
214
+ publications.
215
+
216
+ [The "dataframe"](https://sxs.readthedocs.io/en/main/api/dataframe/)
217
+ `df` contains information about every simulation in the catalog,
218
+ including all available data files, and information about how to get
219
+ them. You probably don't need to actually know about details like
220
+ where to get the data, but `df` can help you find the simulations you
221
+ care about. It is a
222
+ [`pandas.DataFrame`](https://pandas.pydata.org/docs/) object, where
223
+ the rows are names of simulations (like "SXS:BBH:0123") and the
224
+ columns include [the
225
+ `metadata`](https://sxs.readthedocs.io/en/main/api/sxs.metadata.metadata/#sxs.metadata.metadata.Metadata)
226
+ for the simulations things like mass ratio, spins, eccentricity,
227
+ etc. — in addition to extra refinements like spin magnitudes, etc.
228
+
229
+ Once you have found a simulation you want to work with, you can load
230
+ it with, e.g., `sxs.load("SXS:BBH:4001")`, which will return a
231
+ [`Simulation`](https://sxs.readthedocs.io/en/main/api/sxs.simulation/#sxs.simulation.Simulation)
232
+ object, which contains metadata about the simulation, and allows you
233
+ to load data from the simulation. By default, it uses the
234
+ highest-resolution run of the simulation, though this lower
235
+ resolutions can be specified.
189
236
 
190
237
  The actual data itself is primarily contained in the next two objects. [The
191
238
  `horizons`
@@ -197,8 +244,41 @@ be `None`. Otherwise, each of these three is a
197
244
  [`HorizonQuantities`](https://sxs.readthedocs.io/en/main/api/sxs.horizons/#sxs.horizons.HorizonQuantities)
198
245
  object, containing several timeseries relating to mass, spin, and position.
199
246
 
200
- Finally, the
201
- [`waveform`](https://sxs.readthedocs.io/en/main/api/sxs.waveforms.waveform_modes/#sxs.waveforms.waveform_modes.WaveformModes)
202
- encapsulates the modes of the waveform and the corresponding time information,
203
- along with relevant metadata like data type, spin weight, etc., and useful
204
- features like numpy-array-style slicing.
247
+ Finally, the [`h`
248
+ waveform](https://sxs.readthedocs.io/en/main/api/sxs.waveforms.waveform_modes/#sxs.waveforms.waveform_modes.WaveformModes)
249
+ encapsulates the modes of the strain waveform and the corresponding
250
+ time information, along with relevant metadata like data type, spin
251
+ weight, etc., with useful features like numpy-array-style slicing.
252
+
253
+ There is also `psi4` data available, which is computed with entirely
254
+ different methods; `h` and `psi4` are not just computed one from the
255
+ other by a double integral or differentiation. As a result, we
256
+ generally recommend using `h` instead of `psi4` unless you have very
257
+ specific requirements.
258
+
259
+ ## Contributing
260
+
261
+ Contributions are welcome! There are at least two ways to contribute
262
+ to this codebase:
263
+
264
+ 1. If you find a bug or want to suggest an enhancement, use the [issue
265
+ tracker](https://github.com/sxs-collaboration/sxs/issues) on
266
+ GitHub. It's a good idea to look through past issues, too, to see
267
+ if anybody has run into the same problem or made the same
268
+ suggestion before.
269
+ 2. If you will write or edit the python code, we use the [fork and
270
+ pull
271
+ request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
272
+ model.
273
+
274
+ You are also allowed to make use of this code for other purposes, as
275
+ detailed in the [MIT license](LICENSE). For any type of contribution,
276
+ please follow the [code of
277
+ conduct](https://github.com/sxs-collaboration/.github/blob/master/CODE_OF_CONDUCT.md).
278
+
279
+ ## Reporting catalog data issues
280
+
281
+ If you find an issue with our data or metadata, please let us know!
282
+ [Fill out an issue with the catalog data
283
+ template](https://github.com/sxs-collaboration/sxs/issues/new?template=catalog-data-issue-template.md)
284
+ and we will take a look as soon as possible.
@@ -0,0 +1,209 @@
1
+ [![Test Status](https://github.com/sxs-collaboration/sxs/workflows/tests/badge.svg)](https://github.com/sxs-collaboration/sxs/actions)
2
+ [![Documentation Status](https://readthedocs.org/projects/sxs/badge/?version=main)](https://sxs.readthedocs.io/en/main/?badge=main)
3
+ [![PyPI Version](https://img.shields.io/pypi/v/sxs?color=)](https://pypi.org/project/sxs/)
4
+ [![Conda Version](https://img.shields.io/conda/vn/conda-forge/sxs.svg?color=)](https://anaconda.org/conda-forge/sxs)
5
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sxs-collaboration/sxs/blob/main/LICENSE)
6
+ [![Open with marimo](https://marimo.io/shield.svg)](https://data.black-holes.org/)
7
+
8
+
9
+ # Simulating eXtreme Spacetimes package
10
+
11
+ The `sxs` python package provides a high-level interface for using data
12
+ produced by the SXS collaboration. In particular, the function `sxs.load` can
13
+ automatically find, download, and load data, returning objects that provide
14
+ common interfaces to the various types of data, without forcing the user to
15
+ worry about details like data formats or where to find the data. It can also
16
+ automatically select the newest or highest-resolution dataset for a given
17
+ simulation, or return a range of versions or resolutions. Currently, the
18
+ high-level objects encapsulate
19
+
20
+ * Dataframe — a catalog of all simulations produced by the SXS collaboration
21
+ * Simulation — an object encapsulating all data for a single simulation
22
+ * Metadata — data describing the simulation parameters
23
+ * Horizons — time-series data describing the apparent horizons
24
+ * Waveform — time-series data describing the extrapolated gravitational-wave
25
+ modes
26
+
27
+
28
+ ## Installation
29
+
30
+ Because this package is pure python code, installation is very simple. In
31
+ particular, with a reasonably modern installation, you can just run a command
32
+ like
33
+
34
+ ```bash
35
+ python -m pip install sxs
36
+ ```
37
+
38
+ or
39
+
40
+ ```bash
41
+ mamba install -c conda-forge sxs
42
+ ```
43
+
44
+ Here, the first command assumes that you have an appropriate python
45
+ environment set up in some other way;
46
+ [`mamba`](https://mamba.readthedocs.io/en/latest/index.html) is the
47
+ newer replacement for `conda`, and is a convenient way to install
48
+ python and manage environments. Either of these commands will
49
+ download and install the `sxs` package and its most vital
50
+ requirements.
51
+
52
+ You may also want to set some convenient defaults to automatically
53
+ download and cache data:
54
+
55
+ ```bash
56
+ python -c "import sxs; sxs.write_config(download=True, cache=True)"
57
+ ```
58
+
59
+ This will write a configuration file in the directory returned by
60
+ `sxs.sxs_directory("config")`, and downloaded data will be cached in the
61
+ directory returned by `sxs.sxs_directory("cache")`. See [that function's
62
+ documentation](https://sxs.readthedocs.io/en/main/api/sxs.utilities.sxs_directories/#sxsutilitiessxs_directoriessxs_directory)
63
+ for details.
64
+
65
+ ## Citing this package and/or data
66
+
67
+ If you use this package and/or the data it provides in your research,
68
+ please cite them, including the *specific version of the data* that
69
+ you use (see below). To help with this, we provide the function
70
+ `sxs.cite`. Use `print(sxs.cite())` to see BibTeX citations for the
71
+ version of this package you are using, the most recent paper
72
+ describing the catalog, and the catalog data itself. Use, e.g.,
73
+ `print(sxs.cite("SXS:BBH:0001", "SXS:BBH:4001"))` to include citations
74
+ for those specific simulations *and* the papers that introduced them.
75
+
76
+ ## Usage
77
+
78
+ An extensive demonstration of this package's capabilities is available
79
+ [here](https://mybinder.org/v2/gh/moble/sxs_notebooks/main), in the form of
80
+ interactive jupyter notebooks that are actually running this code and some
81
+ pre-downloaded data. The following is just a very brief overview of the `sxs`
82
+ package's main components.
83
+
84
+ ### Loading a specific version of the catalog
85
+
86
+ For the purposes of reproducibility — both reproducing your own
87
+ results and allowing others to reproduce them — it is important to be
88
+ aware of which version of the catalog you are using, and to cite it
89
+ when you publish results using SXS data. Whenever `sxs` tries to load
90
+ data, it most first load some version of the catalog. If you do not
91
+ specify a version, it will automatically find and load the most recent
92
+ version available via github, and print out a message telling you
93
+ which version it is using, like
94
+
95
+ ```python
96
+ Loading SXS simulations using latest tag 'v3.0.0', published at 2025-05-12T10:00:00Z.
97
+ ```
98
+
99
+ For the rest of that Python session, all data loaded will be from that
100
+ version of the catalog. If you want to use a different version, you
101
+ can specify it explicitly while loading the catalog — preferably as
102
+
103
+ ```python
104
+ sxs.load("dataframe", tag="3.0.0")
105
+ ```
106
+
107
+ Even if you do not use the returned object from this command, it will
108
+ ensure that all data will be loaded from the specified version of the
109
+ catalog. Thus, it is best practice to make this call as soon as you
110
+ import the `sxs` package.
111
+
112
+
113
+ ### Interacting with the data
114
+
115
+
116
+ There are four important objects to understand in this package:
117
+
118
+ ```python
119
+ import sxs
120
+
121
+ # Load a specific version of the catalog for reproducibility
122
+ df = sxs.load("dataframe", tag="3.0.0")
123
+
124
+ # Load a specific simulation
125
+ sim = sxs.load("SXS:BBH:4001")
126
+
127
+ # Obtain data about the horizons
128
+ horizons = sim.horizons
129
+
130
+ # Obtain data about the gravitational-wave strain
131
+ h = sim.h
132
+ ```
133
+
134
+ Note that `tag` is optional, but is good to include because it sets
135
+ the version of the catalog from which data is loaded, which ensures
136
+ reproducibility. Leave it out to see the most recent version
137
+ available, and then use that version consistently in any analysis. Be
138
+ sure to cite the specific version of the catalog you used in any
139
+ publications.
140
+
141
+ [The "dataframe"](https://sxs.readthedocs.io/en/main/api/dataframe/)
142
+ `df` contains information about every simulation in the catalog,
143
+ including all available data files, and information about how to get
144
+ them. You probably don't need to actually know about details like
145
+ where to get the data, but `df` can help you find the simulations you
146
+ care about. It is a
147
+ [`pandas.DataFrame`](https://pandas.pydata.org/docs/) object, where
148
+ the rows are names of simulations (like "SXS:BBH:0123") and the
149
+ columns include [the
150
+ `metadata`](https://sxs.readthedocs.io/en/main/api/sxs.metadata.metadata/#sxs.metadata.metadata.Metadata)
151
+ for the simulations — things like mass ratio, spins, eccentricity,
152
+ etc. — in addition to extra refinements like spin magnitudes, etc.
153
+
154
+ Once you have found a simulation you want to work with, you can load
155
+ it with, e.g., `sxs.load("SXS:BBH:4001")`, which will return a
156
+ [`Simulation`](https://sxs.readthedocs.io/en/main/api/sxs.simulation/#sxs.simulation.Simulation)
157
+ object, which contains metadata about the simulation, and allows you
158
+ to load data from the simulation. By default, it uses the
159
+ highest-resolution run of the simulation, though this lower
160
+ resolutions can be specified.
161
+
162
+ The actual data itself is primarily contained in the next two objects. [The
163
+ `horizons`
164
+ object](https://sxs.readthedocs.io/en/main/api/sxs.horizons/#sxs.horizons.Horizons)
165
+ has three attributes — `horizons.A`, `horizons.B`, and `horizons.C` — typically
166
+ representing the original two horizons of the black-hole binary and the common
167
+ horizon that forms at merger. In matter simulations, one or more of these may
168
+ be `None`. Otherwise, each of these three is a
169
+ [`HorizonQuantities`](https://sxs.readthedocs.io/en/main/api/sxs.horizons/#sxs.horizons.HorizonQuantities)
170
+ object, containing several timeseries relating to mass, spin, and position.
171
+
172
+ Finally, the [`h`
173
+ waveform](https://sxs.readthedocs.io/en/main/api/sxs.waveforms.waveform_modes/#sxs.waveforms.waveform_modes.WaveformModes)
174
+ encapsulates the modes of the strain waveform and the corresponding
175
+ time information, along with relevant metadata like data type, spin
176
+ weight, etc., with useful features like numpy-array-style slicing.
177
+
178
+ There is also `psi4` data available, which is computed with entirely
179
+ different methods; `h` and `psi4` are not just computed one from the
180
+ other by a double integral or differentiation. As a result, we
181
+ generally recommend using `h` instead of `psi4` unless you have very
182
+ specific requirements.
183
+
184
+ ## Contributing
185
+
186
+ Contributions are welcome! There are at least two ways to contribute
187
+ to this codebase:
188
+
189
+ 1. If you find a bug or want to suggest an enhancement, use the [issue
190
+ tracker](https://github.com/sxs-collaboration/sxs/issues) on
191
+ GitHub. It's a good idea to look through past issues, too, to see
192
+ if anybody has run into the same problem or made the same
193
+ suggestion before.
194
+ 2. If you will write or edit the python code, we use the [fork and
195
+ pull
196
+ request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)
197
+ model.
198
+
199
+ You are also allowed to make use of this code for other purposes, as
200
+ detailed in the [MIT license](LICENSE). For any type of contribution,
201
+ please follow the [code of
202
+ conduct](https://github.com/sxs-collaboration/.github/blob/master/CODE_OF_CONDUCT.md).
203
+
204
+ ## Reporting catalog data issues
205
+
206
+ If you find an issue with our data or metadata, please let us know!
207
+ [Fill out an issue with the catalog data
208
+ template](https://github.com/sxs-collaboration/sxs/issues/new?template=catalog-data-issue-template.md)
209
+ and we will take a look as soon as possible.
@@ -0,0 +1,10 @@
1
+ # `sxs.cite`
2
+
3
+ For reasons of reproducibility — and for general academic integrity —
4
+ it is important to cite the specific packages and data you use in your
5
+ research. In particular, it is absolutely vital to cite the specific
6
+ version of the catalog of SXS simulations you use, as well as the
7
+ version of this `sxs` package that you use. The `sxs.cite` function
8
+ provides those specific citations.
9
+
10
+ ::: sxs.cite
@@ -0,0 +1,3 @@
1
+ # `Metadata` class
2
+
3
+ ::: sxscatalog.metadata.metadata.Metadata
@@ -1,6 +1,6 @@
1
1
  # `Simulation` classes
2
2
 
3
- The `Simulation` classes are the primary interface for accessing
3
+ The `Simulation` classes form the primary interface for accessing
4
4
  simulation data. They are the top-level objects that contain all the
5
5
  data for a single simulation. These classes are designed to be
6
6
  lightweight and to load data only when needed.
@@ -21,3 +21,6 @@ return the appropriate object.
21
21
 
22
22
  ## `Simulation_v2` class
23
23
  ::: sxs.simulations.simulation.Simulation_v2
24
+
25
+ ## `Simulation_v3` class
26
+ ::: sxs.simulations.simulation.Simulation_v3
@@ -8,7 +8,7 @@ containing the Python code you want to run.
8
8
  ## Getting Mathematica working with Python
9
9
 
10
10
  As of this writing, Mathematica *claims* that it works with all reasonably
11
- modern versions of Python — specificaly ["Python 2.6+ and Python
11
+ modern versions of Python — specifically ["Python
12
12
  3.4+"](https://reference.wolfram.com/language/ref/externalevaluationsystem/Python.html).
13
13
  Assuming this is true, the only extra thing to worry about is that Mathematica
14
14
  requires the `pyzmq` package to interface with Python.
@@ -17,41 +17,39 @@
17
17
  "source": [
18
18
  "# Pythonic Preliminaries\n",
19
19
  "\n",
20
- "* ***Don't*** use your system python. Installing packages to it might screw up how your OS works.\n",
20
+ "* ***Don't*** use your system python. Installing packages to it might mess up how your OS works.\n",
21
21
  "* ***Don't*** use `sudo` when doing anything involving python.\n",
22
22
  "* ***Do*** use an environment manager:\n",
23
- " * [Anaconda](https://www.anaconda.com/products/individual) is best for scientific python\n",
24
- " * [Virtualenv](https://virtualenv.pypa.io/en/latest/) is slightly simpler, but much less capable\n",
25
- " * [Pip](https://pip.pypa.io/en/stable/) is a useful tool, but is not an environment manager; don't rely on it alone\n",
26
- " * Pipenv is only suitable for web development, not scientific python; don't use this at all\n",
23
+ " * [`pixi`](https://pixi.sh/) is the latest way to use [conda](https://docs.conda.io/projects/conda/en/latest/index.html)/[mamba](https://mamba.readthedocs.io/en/latest/index.html).\n",
24
+ " * [`uv`](https://docs.astral.sh/uv/) is the only reasonable way to use [`pip`](https://pip.pypa.io/en/stable/).\n",
27
25
  "\n",
28
- "The `sxs` package requires python 3.8 or greater, and a bunch of other packages that should be automatically installed along with it.\n",
26
+ "The `sxs` package requires python 3.10 or greater, and a bunch of other packages that should be automatically installed along with it.\n",
29
27
  "\n",
30
- "The simplest way to install this package is to install anaconda (from the link above) and then install `sxs` like this:\n",
28
+ "The old-fashioned ways to install this package work as usual:\n",
31
29
  "\n",
32
30
  "```python\n",
33
- "conda install -c conda-forge sxs\n",
31
+ "python -m pip install sxs\n",
34
32
  "```\n",
35
33
  "\n",
36
- "But if you have your own environment set up in some other way you could also do\n",
34
+ "or\n",
37
35
  "\n",
38
36
  "```python\n",
39
- "python -m pip install sxs\n",
37
+ "mamba install -c conda-forge sxs\n",
40
38
  "```\n",
41
39
  "\n",
42
- "If you want a more complete set of tools, you could also do something like\n",
40
+ "When using either `pixi` or `uv` as we recommend — you can add the package to your workspace/environment with\n",
43
41
  "\n",
44
42
  "```python\n",
45
- "conda install -c conda-forge sxs-ecosystem\n",
43
+ "pixi init sxs # If you don't have a workspace already\n",
44
+ "pixi add sxs\n",
46
45
  "```\n",
47
46
  "\n",
48
47
  "or\n",
49
48
  "\n",
50
49
  "```python\n",
51
- "python -m pip install sxs[ecosystem]\n",
52
- "```\n",
53
- "\n",
54
- "This installs nice goodies like [Matplotlib](https://matplotlib.org/) for plotting and [Jupyter](https://jupyter.org/) for running interactive notebooks like this one yourself. On non-Windows systems, this also installs some other useful packages from the SXS collaboration, like [`scri`](https://github.com/moble/scri)."
50
+ "uv venv # If you don't have a venv already\n",
51
+ "uv pip install sxs\n",
52
+ "```"
55
53
  ]
56
54
  },
57
55
  {
@@ -104,7 +102,7 @@
104
102
  "metadata": {},
105
103
  "outputs": [],
106
104
  "source": [
107
- "sxs.write_config(download=True, cache=True, auto_supersede=True)"
105
+ "sxs.write_config(download=True, cache=True, auto_supersede=False)"
108
106
  ]
109
107
  },
110
108
  {
@@ -122,7 +120,7 @@
122
120
  {
123
121
  "data": {
124
122
  "text/plain": [
125
- "{'download': True, 'cache': True, 'auto_supersede': True}"
123
+ "{'download': True, 'cache': True, 'auto_supersede': False}"
126
124
  ]
127
125
  },
128
126
  "execution_count": 3,
@@ -183,7 +181,7 @@
183
181
  "\n",
184
182
  "The first line will\n",
185
183
  "\n",
186
- " 1. download the catalog of SXS `Simulations` with relevant metadata, if necessary, and cache it to disk if desired\n",
184
+ " 1. download the catalog of SXS simulations with relevant metadata, if necessary, and cache it to disk if desired\n",
187
185
  " 2. find the metadata for the simulation with the given ID\n",
188
186
  " 3. check that the simulation has not been deprecated (if so, it will advise you of what to do)\n",
189
187
  " 4. decide on the version and `Lev` to use — defaulting to the most recent of each\n",
@@ -240,6 +238,8 @@
240
238
  "source": [
241
239
  "(If this failed for you, it's probably because you don't already have the data, and you haven't set up the sensible defaults in the previous section. Review that advice to see how to set up those defaults, or pass `download=True` to the `sxs.load` function to download just this once.)\n",
242
240
  "\n",
241
+ "Note that `h.data` represents the modes of the strain waveform, which do not asymptote to zero after merger because of memory effects — real physical effects that should be present in the waveforms.\n",
242
+ "\n",
243
243
  "This example loads the metadata into the `sxs_bbh_1234` object. Then, as soon as `sxs_bbh_1234.h` is accessed, it downloads and loads the waveform. We extract the time data with `sxs_bbh_1234.h.t`, and the real part of the complex data with `sxs_bbh_1234.h.data.real`. We will get into much more detail about this in the following notebooks."
244
244
  ]
245
245
  },
@@ -251,7 +251,7 @@
251
251
  "\n",
252
252
  "It is probably best to go through these notebooks in order:\n",
253
253
  "\n",
254
- " 1. [The `Simulations` interface and `Metadata`](/tutorials/01-Simulations_and_Metadata)\n",
254
+ " 1. [The catalog `DataFrame` interface](/tutorials/01-Catalog_Dataframe)\n",
255
255
  " 2. [The `Simulation` interface](/tutorials/02-Simulation)\n",
256
256
  " 3. [Data describing `Horizons`](/tutorials/03-Horizons)\n",
257
257
  " 4. [Introduction to `WaveformModes` objects](/tutorials/04-Waveforms)"
@@ -274,7 +274,7 @@
274
274
  "name": "python",
275
275
  "nbconvert_exporter": "python",
276
276
  "pygments_lexer": "ipython3",
277
- "version": "3.11.9"
277
+ "version": "3.12.3"
278
278
  },
279
279
  "widgets": {
280
280
  "application/vnd.jupyter.widget-state+json": {