sxs
Python code for manipulating data from the SXS collaboration
Science Score: 64.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
✓Committers with academic emails
2 of 10 committers (20.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.3%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Python code for manipulating data from the SXS collaboration
Basic Info
- Host: GitHub
- Owner: sxs-collaboration
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://data.black-holes.org/
- Size: 35.4 MB
Statistics
- Stars: 31
- Watchers: 1
- Forks: 22
- Open Issues: 20
- Releases: 117
Topics
Metadata Files
README.md
Simulating eXtreme Spacetimes package
[!NOTE] As described in our latest paper, our waveforms now include memory effects. Specifically, when using any simulation with version 3 or greater, you should expect to see memory effects, most visible in the $(\ell, 0)$ modes, and generally resulting in ringdowns that do not approach 0 at late times.
The sxs python package provides a high-level interface for using data
produced by the SXS collaboration. In particular, the function sxs.load can
automatically find, download, and load data, returning objects that provide
common interfaces to the various types of data, without forcing the user to
worry about details like data formats or where to find the data. It can also
automatically select the newest or highest-resolution dataset for a given
simulation, or return a range of versions or resolutions. Currently, the
high-level objects encapsulate
- Dataframe a catalog of all simulations produced by the SXS collaboration
- Simulation an object encapsulating all data for a single simulation
- Metadata data describing the simulation parameters
- Horizons time-series data describing the apparent horizons
- Waveform time-series data describing the extrapolated gravitational-wave modes
Installation
Because this package is pure python code, installation is very simple. In particular, with a reasonably modern installation, you can just run a command like
bash
python -m pip install sxs
or
bash
mamba install -c conda-forge sxs
Here, the first command assumes that you have an appropriate python
environment set up in some other way;
mamba is the
newer replacement for conda, and is a convenient way to install
python and manage environments. Either of these commands will
download and install the sxs package and its most vital
requirements.
You may also want to set some convenient defaults to automatically download and cache data:
bash
python -c "import sxs; sxs.write_config(download=True, cache=True)"
This will write a configuration file in the directory returned by
sxs.sxs_directory("config"), and downloaded data will be cached in the
directory returned by sxs.sxs_directory("cache"). See that function's
documentation
for details.
Citing this package and/or data
If you use this package and/or the data it provides in your research,
please cite them, including the specific version of the data that
you use (see below). To help with this, we provide the function
sxs.cite. Use print(sxs.cite()) to see BibTeX citations for the
version of this package you are using, the most recent paper
describing the catalog, and the catalog data itself. Use, e.g.,
print(sxs.cite("SXS:BBH:0001", "SXS:BBH:4001")) to include citations
for those specific simulations and the papers that introduced them.
Usage
An extensive demonstration of this package's capabilities is available
here, in the form of
interactive jupyter notebooks that are actually running this code and some
pre-downloaded data. The following is just a very brief overview of the sxs
package's main components.
Loading a specific version of the catalog
For the purposes of reproducibility both reproducing your own
results and allowing others to reproduce them it is important to be
aware of which version of the catalog you are using, and to cite it
when you publish results using SXS data. Whenever sxs tries to load
data, it most first load some version of the catalog. If you do not
specify a version, it will automatically find and load the most recent
version available via github, and print out a message telling you
which version it is using, like
python
Loading SXS simulations using latest tag 'v3.0.0', published at 2025-05-12T10:00:00Z.
For the rest of that Python session, all data loaded will be from that version of the catalog. If you want to use a different version, you can specify it explicitly while loading the catalog preferably as
python
sxs.load("dataframe", tag="3.0.0")
Even if you do not use the returned object from this command, it will
ensure that all data will be loaded from the specified version of the
catalog. Thus, it is best practice to make this call as soon as you
import the sxs package.
Interacting with the data
There are four important objects to understand in this package:
```python import sxs
Load a specific version of the catalog for reproducibility
df = sxs.load("dataframe", tag="3.0.0")
Load a specific simulation
sim = sxs.load("SXS:BBH:4001")
Obtain data about the horizons
horizons = sim.horizons
Obtain data about the gravitational-wave strain
h = sim.h ```
Note that tag is optional, but is good to include because it sets
the version of the catalog from which data is loaded, which ensures
reproducibility. Leave it out to see the most recent version
available, and then use that version consistently in any analysis. Be
sure to cite the specific version of the catalog you used in any
publications.
The "dataframe"
df contains information about every simulation in the catalog,
including all available data files, and information about how to get
them. You probably don't need to actually know about details like
where to get the data, but df can help you find the simulations you
care about. It is a
pandas.DataFrame object, where
the rows are names of simulations (like "SXS:BBH:0123") and the
columns include the
metadata
for the simulations things like mass ratio, spins, eccentricity,
etc. in addition to extra refinements like spin magnitudes, etc.
Once you have found a simulation you want to work with, you can load
it with, e.g., sxs.load("SXS:BBH:4001"), which will return a
Simulation
object, which contains metadata about the simulation, and allows you
to load data from the simulation. By default, it uses the
highest-resolution run of the simulation, though this lower
resolutions can be specified.
The actual data itself is primarily contained in the next two objects. The
horizons
object
has three attributes horizons.A, horizons.B, and horizons.C typically
representing the original two horizons of the black-hole binary and the common
horizon that forms at merger. In matter simulations, one or more of these may
be None. Otherwise, each of these three is a
HorizonQuantities
object, containing several timeseries relating to mass, spin, and position.
Finally, the h
waveform
encapsulates the modes of the strain waveform and the corresponding
time information, along with relevant metadata like data type, spin
weight, etc., with useful features like numpy-array-style slicing.
There is also psi4 data available, which is computed with entirely
different methods; h and psi4 are not just computed one from the
other by a double integral or differentiation. As a result, we
generally recommend using h instead of psi4 unless you have very
specific requirements.
Contributing
Contributions are welcome! There are at least two ways to contribute to this codebase:
- If you find a bug or want to suggest an enhancement, use the issue tracker on GitHub. It's a good idea to look through past issues, too, to see if anybody has run into the same problem or made the same suggestion before.
- If you will write or edit the python code, we use the fork and pull request model.
You are also allowed to make use of this code for other purposes, as detailed in the MIT license. For any type of contribution, please follow the code of conduct.
Reporting catalog data issues
If you find an issue with our data or metadata, please let us know! Fill out an issue with the catalog data template and we will take a look as soon as possible.
Owner
- Name: Simulating eXtreme Spacetimes
- Login: sxs-collaboration
- Kind: organization
- Website: https://www.black-holes.org
- Repositories: 8
- Profile: https://github.com/sxs-collaboration
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Boyle
given-names: Michael
orcid: https://orcid.org/0000-0002-5075-5116
- family-names: "Mitman"
given-names: "Keefe"
orcid: "https://orcid.org/0000-0003-0276-3856"
- family-names: "Scheel"
given-names: "Mark"
orcid: "https://orcid.org/0000-0001-6656-9134"
- family-names: "Stein"
given-names: "Leo"
orcid: "https://orcid.org/0000-0001-7559-9597"
title: "The sxs package"
license: MIT
doi: 10.5281/zenodo.4034006
version: 2025.0.18
date-released: 2025-07-21
GitHub Events
Total
- Create event: 62
- Release event: 38
- Issues event: 38
- Watch event: 5
- Delete event: 8
- Issue comment event: 82
- Push event: 128
- Pull request review comment event: 31
- Pull request review event: 21
- Pull request event: 51
- Fork event: 3
Last Year
- Create event: 62
- Release event: 38
- Issues event: 38
- Watch event: 5
- Delete event: 8
- Issue comment event: 82
- Push event: 128
- Pull request review comment event: 31
- Pull request review event: 21
- Pull request event: 51
- Fork event: 3
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Mike Boyle | m****e@g****m | 610 |
| github-actions | g****s@g****m | 114 |
| Keefe Mitman | k****n@c****u | 40 |
| Leo C. Stein | l****n@g****m | 7 |
| dependabot[bot] | 4****] | 4 |
| Mark Scheel | s****l@t****u | 4 |
| Samson Leong | 5****1 | 2 |
| Yitian Chen | 5****b | 1 |
| Prayush Kumar | p****r@g****m | 1 |
| Nils Vu | o****s@n****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 70
- Total pull requests: 113
- Average time to close issues: 4 months
- Average time to close pull requests: 22 days
- Total issue authors: 19
- Total pull request authors: 10
- Average comments per issue: 1.41
- Average comments per pull request: 1.16
- Merged pull requests: 95
- Bot issues: 0
- Bot pull requests: 5
Past Year
- Issues: 27
- Pull requests: 53
- Average time to close issues: 27 days
- Average time to close pull requests: 4 days
- Issue authors: 11
- Pull request authors: 6
- Average comments per issue: 1.41
- Average comments per pull request: 1.42
- Merged pull requests: 44
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- moble (32)
- duetosymmetry (10)
- keefemitman (6)
- akhairna (4)
- nilsvu (3)
- Kanchan-05 (1)
- vijayvarma392 (1)
- nilsdeppe (1)
- SSL32081 (1)
- Sunnnsh (1)
- AnujKankani (1)
- mhycheung (1)
- haraldp271 (1)
- GitHimanshuc (1)
- hrueter (1)
Pull Request Authors
- moble (67)
- keefemitman (17)
- duetosymmetry (15)
- markscheel (6)
- dependabot[bot] (6)
- dongzesun (5)
- SSL32081 (4)
- EthansGitHub (2)
- nilsvu (2)
- prayush (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 5,469 last-month
-
Total dependent packages: 6
(may contain duplicates) -
Total dependent repositories: 6
(may contain duplicates) - Total versions: 347
- Total maintainers: 1
pypi.org: sxs
Interface to data produced by the Simulating eXtreme Spacetimes collaboration
- Homepage: https://github.com/sxs-collaboration/sxs
- Documentation: https://sxs.readthedocs.io/
- License: The MIT License (MIT) Copyright (c) 2020 Michael Boyle Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 2025.0.18
published 7 months ago
Rankings
Maintainers (1)
conda-forge.org: sxs
This package provides a number of utilities for use by the SXS collaboration, and others who use our data. For example, the `metadata` subpackage provides functions for reading and analyzing the metadata files provided with SXS simulations for describing the physics they represent. Another important subpackage is `zenodo`, which provides handy functions for interacting with zenodo.org in general, and in particular our collection of simulation data on that site.
- Homepage: https://github.com/sxs-collaboration/sxs
- License: MIT
-
Latest release: 2022.4.3
published over 3 years ago
Rankings
conda-forge.org: sxs-ecosystem
This package provides a number of utilities for use by the SXS collaboration, and others who use our data. For example, the `metadata` subpackage provides functions for reading and analyzing the metadata files provided with SXS simulations for describing the physics they represent. Another important subpackage is `zenodo`, which provides handy functions for interacting with zenodo.org in general, and in particular our collection of simulation data on that site.
- Homepage: https://github.com/sxs-collaboration/sxs
- License: MIT
-
Latest release: 2022.3.2
published almost 4 years ago
Rankings
Dependencies
- pytest ^7.0 develop
- pytest-cov >=2.10.1 develop
- black >=22.1
- corner ^2.1.0
- feedparser ^6.0.1
- h5py ^3
- inflection ^0.5.1
- ipykernel ^5.3.4
- ipywidgets ^7.5.1
- jupyter_contrib_nbextensions ^0.5.1
- jupyterlab ^2.2.8
- line_profiler ^3.0.2
- matplotlib >=2.1.1
- memory_profiler ^0.57.0
- mkapi 1.0.13
- mkdocs >=1.1.2
- numba >=0.55
- numpy ^1.20
- numpy-quaternion >=0.3.1
- pandas ^1.1.2
- pylatexenc ^2.7
- pymdown-extensions ^8
- pytest-forked ^1.3.0
- python >=3.8,<3.11
- pytz ^2020.1
- qgrid ^1.3.1
- quaternionic ^1.0
- requests ^2.24.0
- rise ^5.6.1
- scipy ^1.0
- scri >=2020.8.18
- spherical ^1.0
- spinsfast >=2022
- sympy ^1.6.2
- tqdm ^4.48.2, <4.61.2
- urllib3 ^1.25.10
- actions/checkout v2 composite
- actions/create-release latest composite
- actions/setup-python v2 composite
- codecov/codecov-action v2 composite
- readthedocs/actions/preview v1 composite