sxs 2025.0.13__py3-none-any.whl → 2025.0.15__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "2025.0.13"
1
+ __version__ = "2025.0.15"
sxs/citation.py CHANGED
@@ -1,7 +1,7 @@
1
1
  def cite(*sxs_ids, bibtex=True):
2
2
  """Cite this package and/or data
3
3
 
4
- Prints out a citation for the package, the most recent paper
4
+ Prints out a citation for this package, the most recent paper
5
5
  describing the catalog, the catalog data itself, and optionally
6
6
  individual simulations.
7
7
 
@@ -30,6 +30,9 @@ def cite(*sxs_ids, bibtex=True):
30
30
  from . import doi_prefix, load, __version__
31
31
  from . import sxs_id as sxs_identifier
32
32
 
33
+ if len(sxs_ids) == 1 and isinstance(sxs_ids[0], (list, tuple)):
34
+ sxs_ids = tuple(sxs_ids[0])
35
+
33
36
  simulations = load("simulations")
34
37
 
35
38
  # Get the DOI for this version of this package
sxs/handlers.py CHANGED
@@ -199,29 +199,36 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
199
199
  -----
200
200
  This function can load data in various ways.
201
201
 
202
- 1) Given an absolute or relative path to a local file, it just
203
- loads the data directly.
204
-
205
- 2) If `truepath` is set, and points to a file that exists —
202
+ 1) If `truepath` is set, and points to a file that exists —
206
203
  whether absolute, relative to the current working directory,
207
204
  or relative to the cache directory — that file will be
208
205
  loaded.
209
206
 
210
- 3) If `location` is a valid URL including the scheme (https://,
207
+ 2) Given an absolute or relative path to a local file, it just
208
+ loads the data directly.
209
+
210
+ 3) If `location` is one of "simulations" or "dataframe" (or the
211
+ deprecated "catalog"), the corresponding catalog data is
212
+ loaded. The "simulations" option returns a dictionary mapping
213
+ SXS IDs to raw metadata, while "dataframe" returns a pandas
214
+ DataFrame indexed by SXS ID, but the metadata is processed
215
+ into more consistent form.
216
+
217
+ 4) If `location` is a valid URL including the scheme (https://,
211
218
  or http://), it will be downloaded regardless of the
212
219
  `download` parameter and optionally cached.
213
220
 
214
- 4) Given an SXS simulation specification — like "SXS:BBH:1234",
221
+ 5) Given an SXS simulation specification — like "SXS:BBH:1234",
215
222
  "SXS:BBH:1234v2.0", "SXS:BBH:1234/Lev5", or
216
223
  "SXS:BBH:1234v2.0/Lev5" — the simulation is loaded as an
217
224
  `sxs.Simulation` object.
218
225
 
219
- 5) Given an SXS path — like
226
+ 6) Given an SXS path — like
220
227
  "SXS:BBH:1234/Lev5/h_Extrapolated_N2.h5" — the file is
221
228
  located in the catalog for details. This function then looks
222
229
  in the local cache directory and loads it if present.
223
230
 
224
- 6) If the SXS path is not found in the cache directory and
231
+ 7) If the SXS path is not found in the cache directory and
225
232
  `download` is set to `True` (when this function is called, or
226
233
  in the sxs config file) this function attempts to download
227
234
  the data. Note that `download` must be explicitly set in
@@ -263,6 +270,15 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
263
270
  elif truepath and (testpath := cache_path / sxs_path_to_system_path(truepath)).exists():
264
271
  path = testpath
265
272
 
273
+ elif _safe_resolve_exists(path):
274
+ pass # We already have the correct path
275
+
276
+ elif location == "catalog":
277
+ return Catalog.load(download=download)
278
+
279
+ elif location in ["simulations", "dataframe"]:
280
+ return sxscatalog.load(location, download=download, **kwargs)
281
+
266
282
  elif _safe_resolve_exists(h5_path):
267
283
  path = h5_path
268
284
 
@@ -278,12 +294,6 @@ def load(location, download=None, cache=None, progress=None, truepath=None, **kw
278
294
  raise ValueError(f"File '{truepath}' not found in cache, but downloading turned off")
279
295
  download_file(location, path, progress=progress)
280
296
 
281
- elif location == "catalog":
282
- return Catalog.load(download=download)
283
-
284
- elif location in ["simulations", "dataframe"]:
285
- return sxscatalog.load(location, download=download, **kwargs)
286
-
287
297
  elif sxs_id_version_lev_exact_re.match(location):
288
298
  return Simulation(location, download=download, cache=cache, progress=progress, **kwargs)
289
299
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sxs
3
- Version: 2025.0.13
3
+ Version: 2025.0.15
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/
@@ -78,7 +78,7 @@ Description-Content-Type: text/markdown
78
78
  [![PyPI Version](https://img.shields.io/pypi/v/sxs?color=)](https://pypi.org/project/sxs/)
79
79
  [![Conda Version](https://img.shields.io/conda/vn/conda-forge/sxs.svg?color=)](https://anaconda.org/conda-forge/sxs)
80
80
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sxs-collaboration/sxs/blob/main/LICENSE)
81
- [![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/)
82
82
 
83
83
 
84
84
  # Simulating eXtreme Spacetimes package
@@ -142,11 +142,11 @@ for details.
142
142
  If you use this package and/or the data it provides in your research,
143
143
  please cite them, including the *specific version of the data* that
144
144
  you use (see below). To help with this, we provide the function
145
- `sxs.cite`, which will print out a citation — in BibTeX format or just
146
- the DOIs for the package, the most recent paper describing the
147
- catalog, the catalog data itself, and optionally individual
148
- simulations.
149
-
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
 
@@ -255,3 +255,30 @@ different methods; `h` and `psi4` are not just computed one from the
255
255
  other by a double integral or differentiation. As a result, we
256
256
  generally recommend using `h` instead of `psi4` unless you have very
257
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.
@@ -1,7 +1,7 @@
1
1
  sxs/__init__.py,sha256=C8VhmrUPAa70Y-C2KfZv9BhS6ef-eB7uaNtwm18IRhk,2637
2
- sxs/__version__.py,sha256=qT5_mCWSL-clhzUVFYLfMLmGxxmlJqEydwiwpos4nFw,26
3
- sxs/citation.py,sha256=hPns9t996GeKJe2HviUs00hM3fJb7JQu_f54XOPV3BE,7061
4
- sxs/handlers.py,sha256=jVV-HK-omzoBx5N2wcpLHvyoWq86hUfWCjnGbPpD91I,18343
2
+ sxs/__version__.py,sha256=-4DnKrWvKjux3Uu6q5u3zKYaCEb5k1_HJBrX1pCA_O8,26
3
+ sxs/citation.py,sha256=QAiRnasTXpufZCaoxTKR5ESSJQ2ww7FgWyxoaaAQifw,7167
4
+ sxs/handlers.py,sha256=rUS0TmbewpllnZHkS5TXCx6nxGA-E8xrBGLlejBPEAg,18820
5
5
  sxs/juliapkg.json,sha256=-baaa3Za_KBmmiGjlh2YYLWmvUvZl6GaKKXwNI4S7qU,178
6
6
  sxs/time_series.py,sha256=OKaLg8tFyrtKcef7900ri-a0C6A8wKxA68KovZXvH6I,41081
7
7
  sxs/catalog/__init__.py,sha256=9-WTMTPDmqqkFyIHOtEbPA6etXm3_RSRrLWvHtLrjLg,205
@@ -83,7 +83,7 @@ sxs/zenodo/api/__init__.py,sha256=EM_eh4Q8R5E0vIfMhyIR1IYFfOBu6vA0UTasgX9gHys,21
83
83
  sxs/zenodo/api/deposit.py,sha256=J4RGvGjh0cEOrN4bBZWEDcPAhNscqB2fzLlvRZ5HTHM,36948
84
84
  sxs/zenodo/api/login.py,sha256=hXyxLrx1PALaEEH76XrBvlO5Wwz-qa-MCjkI8UyB3t0,18005
85
85
  sxs/zenodo/api/records.py,sha256=nKkhoHZ95CTztHF9Zzaug5p7IiUCJG4Em1i-l-WqH6U,3689
86
- sxs-2025.0.13.dist-info/METADATA,sha256=kiyO3KLqzK_lqQe3cIMsMunkIUv6dqeuTHUgWJzbwck,11644
87
- sxs-2025.0.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
88
- sxs-2025.0.13.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
89
- sxs-2025.0.13.dist-info/RECORD,,
86
+ sxs-2025.0.15.dist-info/METADATA,sha256=DKZV6kRJFEsEhCM7B5P1_vHxeJIHqbv1xD6yU4HBVvg,12857
87
+ sxs-2025.0.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
88
+ sxs-2025.0.15.dist-info/licenses/LICENSE,sha256=ptVOd5m7LDM5ZF0x32cxb8c2Nd5NDmAhy6DX7xt_7VA,1080
89
+ sxs-2025.0.15.dist-info/RECORD,,