Skip to main content

Optimized functionality for Bilby

Project description

pipeline status coverage report Latest Release Conda Forge License

bilby-cython

Optimized cython implementations of specific Bilby operations.

For very fast waveform models, computing the antenna response and time delays uses a significant amount of run time, see, e.g., this issue.

This repo provides optimized cython implementations of the existing Python functions. Most of the speed up comes from leveraging the fact that these are operations of 3-element vectors.

Installation

bilby.cython is available through conda-forge and pypi and can be installed with either of the following

$ conda install -c conda-forge bilby.cython
$ python -m pip install bilby.cython

There are prebuilt versions for many architectures/OSs, however, non-standard systems will require a version of Cython to build from the source with

Usage

In order to use the functions implemented here you can import them from the bilby.cython package

from bilby_cython import geometry
geometry.get_polarization_tensor(ra=0.0, dec=0.0, time=0.0, psi=0.0, mode="plus")

Ported functions

  • time_delay_geocentric: calculating time delays between two interferometers
  • get_polarization_tensor: calculation of polarization tensors
  • three_by_three_matrix_contraction: rojecting polarization tensors against detector response tensors
  • calculate_arm: calculate an interferometer arm vector
  • zenith_azimuth_to_theta_phi: rotating the reference from from detector-based coordinates to celestial

New functions

  • time_delay_from_geocenter: calculate the time delay between an interferometer and the geocenter. This removes an array allocation that was slow for some reason.
  • get_polarization_tensor_multiple_modes: compute multiple polarization tensors in a single function call. This reduces the overheads per call.

Testing

test/test_geometry.py verifies that the new functions agree with the old versions at sufficient precision. The old code is deliberately copied from the current Bilby to enable testing after Bilby switches to use this code.

Timing

This is the output of test/timing.py when run on a 2020 M1 MacBook Pro. The new functions are 5-40x faster than the old versions. These times are comparable with the lal` equivalents with greater flexibility.

Timing time delay calculation over 10000 trials.
Cython time: 2.366e-06
Numpy time: 1.026e-05
Timing polarization tensor calculation over 1000 trials.
Cython time: 2.470e-06
Numpy time: 4.247e-05
Timing two mode polarization tensor calculation over 1000 trials.
Cython time: 1.790e-06
Numpy time: 2.907e-05
Timing six mode polarization tensor calculation over 1000 trials.
Cython time: 1.250e-06
Numpy time: 4.111e-05
Timing antenna response calculation over 1000 trials.
Cython time: 4.269e-06
Numpy time: 4.709e-05
Timing frame conversion calculation over 1000 trials.
Cython time: 2.516e-06
Numpy time: 2.243e-05

Profiling the standard Bilby fast_tutorial.py example for a very fast waveform model reduces the amount of time spent computing the antenna response from 16% to 3% and computing time delays from 3% to 1%.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilby_cython-0.5.1.tar.gz (328.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bilby_cython-0.5.1-cp314-cp314-win_amd64.whl (509.9 kB view details)

Uploaded CPython 3.14Windows x86-64

bilby_cython-0.5.1-cp313-cp313-win_amd64.whl (504.3 kB view details)

Uploaded CPython 3.13Windows x86-64

bilby_cython-0.5.1-cp312-cp312-win_amd64.whl (504.3 kB view details)

Uploaded CPython 3.12Windows x86-64

bilby_cython-0.5.1-cp311-cp311-win_amd64.whl (506.9 kB view details)

Uploaded CPython 3.11Windows x86-64

bilby.cython-0.5.1-cp312-cp312-win_amd64.whl (499.9 kB view details)

Uploaded CPython 3.12Windows x86-64

bilby.cython-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

bilby.cython-0.5.1-cp312-cp312-macosx_12_0_x86_64.whl (493.2 kB view details)

Uploaded CPython 3.12macOS 12.0+ x86-64

bilby.cython-0.5.1-cp311-cp311-win_amd64.whl (501.0 kB view details)

Uploaded CPython 3.11Windows x86-64

bilby.cython-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

bilby.cython-0.5.1-cp311-cp311-macosx_12_0_x86_64.whl (492.0 kB view details)

Uploaded CPython 3.11macOS 12.0+ x86-64

bilby.cython-0.5.1-cp310-cp310-win_amd64.whl (501.1 kB view details)

Uploaded CPython 3.10Windows x86-64

bilby.cython-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

bilby.cython-0.5.1-cp310-cp310-macosx_12_0_x86_64.whl (492.0 kB view details)

Uploaded CPython 3.10macOS 12.0+ x86-64

bilby.cython-0.5.1-cp39-cp39-win_amd64.whl (502.2 kB view details)

Uploaded CPython 3.9Windows x86-64

bilby.cython-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

bilby.cython-0.5.1-cp39-cp39-macosx_12_0_x86_64.whl (493.1 kB view details)

Uploaded CPython 3.9macOS 12.0+ x86-64

bilby.cython-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

bilby.cython-0.5.1-cp38-cp38-macosx_12_0_x86_64.whl (492.0 kB view details)

Uploaded CPython 3.8macOS 12.0+ x86-64

File details

Details for the file bilby_cython-0.5.1.tar.gz.

File metadata

  • Download URL: bilby_cython-0.5.1.tar.gz
  • Upload date:
  • Size: 328.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for bilby_cython-0.5.1.tar.gz
Algorithm Hash digest
SHA256 71c8ba01597a7c450c3a48629843582be17b6a4a81e8cde9b461f8c946152ded
MD5 72c626a5f83ddaf28e1395bbd7ff896f
BLAKE2b-256 55454b4b777021ac4a31aad686a2ab9b4c8ef4e9d277e62b4b5089736a116035

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 be562b8917c1e327622fede76e938e67d91b1f4dd667996876e8206c47c129ce
MD5 092ef2f61dae6f83172c92f6c64c7f86
BLAKE2b-256 da24964508ef50871adccbe08d5ac79c600ed4b0264b6314a8731e881dd2e300

See more details on using hashes here.

Provenance

The following attestation bundles were made for bilby_cython-0.5.1-cp314-cp314-win_amd64.whl:

Publisher: build-wheels.yml on ColmTalbot/windows-wheel-builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bilby_cython-0.5.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a5493652ef9038479623f89960431ef4eff60dbdf45acc35199cec56e61c9821
MD5 ff3adf1b8d7739329f0d791a95f417fe
BLAKE2b-256 df0804dfb9c23c449b1ca91cf006e3eb5684af28cfb20cf87095a5c11835e189

See more details on using hashes here.

Provenance

The following attestation bundles were made for bilby_cython-0.5.1-cp313-cp313-win_amd64.whl:

Publisher: build-wheels.yml on ColmTalbot/windows-wheel-builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bilby_cython-0.5.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5fb5d68fdcf27c3d8690f8d035790e94fc4157488dc2721d581cddb6214a778a
MD5 38384bb7179b7a4a1ea16b69ba3a135c
BLAKE2b-256 575d73461b3cd8785c436ae54ef8c65ac46a12f4f977711763d976f6f6e8a998

See more details on using hashes here.

Provenance

The following attestation bundles were made for bilby_cython-0.5.1-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on ColmTalbot/windows-wheel-builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bilby_cython-0.5.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 73a67dc163e1bae24b0508421b7bb87a43df99bd36a3030e41c6a6abb32c3425
MD5 131c98f52a55b3c7ebe4b15d25f9c74f
BLAKE2b-256 4cf2a6e9b9e4233dc37c94e43bc5b1334356e22a2645be0c59934008ead73e91

See more details on using hashes here.

Provenance

The following attestation bundles were made for bilby_cython-0.5.1-cp311-cp311-win_amd64.whl:

Publisher: build-wheels.yml on ColmTalbot/windows-wheel-builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bilby.cython-0.5.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a2163e896c6ab280a2b1e8cc7a414b802eceeafd631f96c3dd2b24c251bd34dd
MD5 4c036d09a77b56a5fe5f907e8bddcde4
BLAKE2b-256 aa8497a7544ac013bc9fda04e16774ae66d73a9fd571d5d4d3cbb60fb9ee7199

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6381e3479433b2d6e347c8ccaea0d2ba3dd23ca74081216b179a39ddd886cb33
MD5 39d4d22af907fa3cf6d5d3f984ef6902
BLAKE2b-256 535adb21de9297f9b0b053b075b991fd6b953df8aa79be5d0f9f920f95e204cf

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp312-cp312-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 21bd04b23abab72185a6884529aee7249fe1100c8cfa89798d9a78bc4cd996a0
MD5 c2df27273b59c11a063d0a2fca0143da
BLAKE2b-256 c912cbdb1e86ab2c5b873599d5bdae75d2bf94bbcfa4f4d1a786edf802778964

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5876bb77e71f5bd423af2ccc561a03e48f4534d0a84eaa817c1447606fd0c291
MD5 99937c61cf8847e6c67329737ea10428
BLAKE2b-256 faf3e3ae2ee4525d08a49c66907dbb3434883f609da4c006acf229d0fd85bd10

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9dd3fcb338db5e6b46fc1636e661c93f442028b3c71e0a2d0cab30df8df20cbd
MD5 7978121131ef2582143e8de28c408f7c
BLAKE2b-256 5a178749647ef592db717ebda748dd473b7f0523329de53fa672c0d016876741

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 7d0090575e4c7e6c6b7c014f89b6f16c0d61c70bb4722ef174cf1417ce038603
MD5 ef991570f69a2ea2787fb23a5c7bc031
BLAKE2b-256 3de7a41a67cb886a00cf8fe9891abfd0d9a2dcb585aeed7adcd9c6564a5884b7

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1508b14cb68a8db77647abea1240c5f9d53a4771108cf6448e383088598507ff
MD5 8d5741ac0880ddc99f0412e2c8f643f8
BLAKE2b-256 ec4c1f80f97472c2c5fcf23589a7243a3488b8e4247ecbd23364723a47e4ed2c

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae99da2d9e60613023d4515d6dc53c53f4100dd0c0057bddf1b4ad1df92621cf
MD5 c18961a451fed432826983a3e477a7fb
BLAKE2b-256 4974888c5845249e5374f3dfb86c93afc48a235974837e983b410f7d8d4b47b4

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 9280d5c6b4c92982feb490dd6e3ee3a56ec235b1feda097da554d3c8f8e9bf47
MD5 c3af4eb77b63666c5fd2fb486c4b06bf
BLAKE2b-256 a9a2a6422dc045d2ddaccb487bd4f441d04ef4be92f22d017aaa94687f31df72

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: bilby.cython-0.5.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 502.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for bilby.cython-0.5.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 28725eb3a60eebc1d76ab255626ed2ec6d0c3186848f4a57473a7e5e47b8c82d
MD5 54e8eda8f57b4eab7792738030de56c6
BLAKE2b-256 3946a5e1cdfeb2002ecce93a57cda57f9c3b2e797f4e84958e22455ec948e1d7

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8079ad5bbbcb675d3daef8993a2559ff16408f5b7c789927ddc9fde188cb6457
MD5 1c64bef3047f94c370ce3c6d46ea19ed
BLAKE2b-256 a87508a6f8df8ab6405958e0de09a154c2188e2d7e04b79590687ecf4bfa7864

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp39-cp39-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 440be80eb095384a6010e8a47ddb2686200d5fe089f890d0e8ca4739faf1840a
MD5 1365c392875be1c6f5d210d91df11fb6
BLAKE2b-256 a690df9bab173ee0d74ea8381fb18ed46d75eb0a14a59dc2507c1d3f2ee13126

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 736f1788c3bfd0bb465cb532548ebe2f9fbc6a2547a5828524213fe172fbc71c
MD5 d14c7c67de0e652217ba83f5a76a2a15
BLAKE2b-256 d0c789a117c827bfe7f59a98477dd8bac2dc229f2cd5eba81be89fdf3fae6d5b

See more details on using hashes here.

File details

Details for the file bilby.cython-0.5.1-cp38-cp38-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby.cython-0.5.1-cp38-cp38-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 66e5fdff04f44d07a78e91f85a9c3337cffb6b44241339a3f4641a340ecec409
MD5 59c9474f83f8ddc3b5443f3737573f87
BLAKE2b-256 39d7de3ea367d32bd23161a346115eab701be35e76f91ed1119df9e24fb881f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page