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.4.tar.gz (255.9 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.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp314-cp314t-macosx_15_0_arm64.whl (372.5 kB view details)

Uploaded CPython 3.14tmacOS 15.0+ ARM64

bilby_cython-0.5.4-cp314-cp314t-macosx_13_0_x86_64.whl (373.7 kB view details)

Uploaded CPython 3.14tmacOS 13.0+ x86-64

bilby_cython-0.5.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp314-cp314-macosx_13_0_x86_64.whl (365.9 kB view details)

Uploaded CPython 3.14macOS 13.0+ x86-64

bilby_cython-0.5.4-cp314-cp314-macosx_12_0_arm64.whl (361.6 kB view details)

Uploaded CPython 3.14macOS 12.0+ ARM64

bilby_cython-0.5.4-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp313-cp313-macosx_15_0_arm64.whl (360.6 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

bilby_cython-0.5.4-cp313-cp313-macosx_13_0_x86_64.whl (362.7 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

bilby_cython-0.5.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp312-cp312-macosx_13_0_x86_64.whl (363.3 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

bilby_cython-0.5.4-cp312-cp312-macosx_12_0_arm64.whl (357.3 kB view details)

Uploaded CPython 3.12macOS 12.0+ ARM64

bilby_cython-0.5.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp311-cp311-macosx_15_0_arm64.whl (362.6 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

bilby_cython-0.5.4-cp311-cp311-macosx_13_0_x86_64.whl (364.3 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

bilby_cython-0.5.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp310-cp310-macosx_13_0_x86_64.whl (364.1 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

bilby_cython-0.5.4-cp310-cp310-macosx_12_0_arm64.whl (360.0 kB view details)

Uploaded CPython 3.10macOS 12.0+ ARM64

bilby_cython-0.5.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (997.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

bilby_cython-0.5.4-cp39-cp39-macosx_15_0_arm64.whl (363.9 kB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

bilby_cython-0.5.4-cp39-cp39-macosx_13_0_x86_64.whl (365.3 kB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

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

File metadata

  • Download URL: bilby_cython-0.5.4.tar.gz
  • Upload date:
  • Size: 255.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for bilby_cython-0.5.4.tar.gz
Algorithm Hash digest
SHA256 34af013f232187f25308cbf25f096e8c2be1662da78c421b85ecceba4fb5358d
MD5 78b5f9442e7c8783dda4efd199b23f0c
BLAKE2b-256 5f603a384798c7df2462343028d37e6adb9079eb0b155a50736b88bdd668d825

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 932fb4e308565b33f989bfbd4d506a0ae37e5a9ef41802ac841e8cb8a4abfe7b
MD5 5ba0de81e3873dfe2dc46008a43ead88
BLAKE2b-256 597443cd1609d4348920258cd6fde9265a2b9ff8955df1bdc5bc0ca60d80bfc1

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp314-cp314t-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp314-cp314t-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 29ef89ef7c02a7a8aae3da2a0780a4c12d0036ba0d905660beced92388af0633
MD5 f84a3d270df8cb667a019d34810355fe
BLAKE2b-256 f9ab1ce6f90eb2b050ba0b971b9eca26d9ff8a5a6ec7ce6a0e077a57168c6b98

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp314-cp314t-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp314-cp314t-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1dd8e79afb2761d20dfa14b044f70af22e89270989dc869d0d0a395b272a726e
MD5 15610f28bef9dcc197db8e5d6d46cbbb
BLAKE2b-256 9954dbf2856d7fc4038070d6ef5165763dba2edbd8728cff7837f24abffe8b2e

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e6fa9fa4289749b92d1df5a1e74e552569c30bd67add0544d9c347cd7c13d9af
MD5 34b59511d8628e0f6604c0fca031c8ec
BLAKE2b-256 1ebf6fb82f2c32b925b356c6daacac9c7c9add8ec700916bd24d53392e82209f

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp314-cp314-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp314-cp314-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 03e1e510466bb268cff6dad147ce7ce2e80009567da8ba48f384a7153cb2ed70
MD5 752d2d02e87bb1607ad7bb7dc12994e2
BLAKE2b-256 31de3655df4f1d2e962a73daea71d533b19990c6593cbd2a2287eff808f8b282

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp314-cp314-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp314-cp314-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 0239d47206b5c79c612dbe5347c308c69c1b10337c3ed63b4958446238cf556c
MD5 c61c711623024685a050fb6e52840931
BLAKE2b-256 90760d45a1742c8f1fa4bff1755905f6513c1cf1340d284b7618b1fdac044dbf

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 92b7f985cf102d043d6ead018327f58e6bffc1166f2077dc4e2253cfd67a64c4
MD5 4f8bad809c38206e4dbc08bf7b2d112d
BLAKE2b-256 01810b0b5558b2e86642fe6e980898745f0b0471ff895ce82e32800f3b23acdb

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b28ff13b884eb727d91276d52220707162e4157258b15477a283c8936b156679
MD5 72886a93f696d3d579761d87fde5b1ea
BLAKE2b-256 40ff062a65c322e0dd4225a78627243b2925ebc902d5a6282871506d1d6767fd

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 799ccc984e0eb88a20127dc0218866eb22517a1b9e71fc737a89cfc868a8f13d
MD5 51622320142112c6015644b67f129bbf
BLAKE2b-256 0b78956c0eff488ec23402bcd0ff169b72909e43cb4bc1b0a9d9f1a7cc195cc7

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c9dd36128bfc48aacca3f0191babdbdf4ba17acc479c7bb2e24f5ba2d2a7f4c2
MD5 4784abad01da2830ce34508bb197f33d
BLAKE2b-256 d1eec371f1fa5963be4458acbeb6ac15d32fd07092234be871357069baad9535

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1599c1ed9f0f169370ab85a975c130447784c998f45f4a63418e0f677461d22f
MD5 2a1b4e4bc75cadac2056f94c4b034c21
BLAKE2b-256 2d0a1584b9f60741fd045b9fa57576a524256f31ac9e00162b2c5355f7ef2c80

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a059c40b5794f094a17c36e3034e5b84a8e92cfed965533577af576beaaff133
MD5 15375ec3c37820a07c46c3c73090232a
BLAKE2b-256 572f7bc651e30d1e9cea5ee4c35b92641c474d652471be49048e38c6512efbfb

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp312-cp312-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp312-cp312-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 04945e17d0a9c31f896bec88d4a1bfd8951e4337c2cfc22ef227dd9ece383078
MD5 e4f9cf4196c2faa71b5f2497ba32f996
BLAKE2b-256 2d32960859bf3552f3d0e303924d1ce8b02470c6dbf683d985f7377fde41681c

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d2aff524c0603111d55b9b24215bb708acad53adaa177493862eaaa10ce39b85
MD5 d9cc3b6ed4d0e7b14b112c60648bb210
BLAKE2b-256 f7994b8ed531febe5aca745b5522d19d5d2e18744e4cb0d9cd83c0eaad464fd5

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2526574d12ca7807bc5b7f19cf88829fc1b126a980de5e1969c027c1f11ccb34
MD5 b7b7823bac2392805eda82dc5b4313ed
BLAKE2b-256 66ffd7d033a7578c2b6030c86f2706bf1af051731a0b6aedd59475c18542f2c4

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a5ee0659d7896e91024650dfc77e304f5db43e307e452c91caa6864e4062e426
MD5 f6328f80d0bb0e154e89ad7ffd3392dc
BLAKE2b-256 ca18448999d244b985582af77471f2bb1a0399b554ffa4bfe3554a813dd026c6

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 58ac5126ed8422cecec00f85a8aa993602210757108dd88974858a1ff9c67eca
MD5 89e4a2f71af7b6f2b6cbb75dadb6818b
BLAKE2b-256 66d08e31ee74382d8ee22a5a0ef38921a59bba244228aa884d84dcaa28a67776

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d3ad3f2ea2a84b724c5e02baea7a01a562028ebdfd2c1b69df2ad7c6de082ecc
MD5 579566cd3708cb776f11de9988200d8c
BLAKE2b-256 f261b42e96de924605c72e07c216e45d4cfd42149a6f13ee8e9927f394de61ad

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp310-cp310-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp310-cp310-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 f1f0ea909b172c4c9a2de47445eda51c0122d15408aa08b89114ddf84b60a573
MD5 64d72cd2b0af18415cef3806b901bb7d
BLAKE2b-256 a3e2bb07655e06cc18ce18e32825d5541e92abbca1f9e5fd4261e95695c64b52

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b25f059f9ccf595fae461b4d8b6c2d8f22d86a1644d68d01270a3a80eefd4103
MD5 03ad47678a548c8c35b57cb3106614fc
BLAKE2b-256 3a1c625f29a244dcabc9acab6a08b8e21b1f4e619a55c306108bbcab6769b53b

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9cec193ecaf196460ec32349bd75b2fce6ce4c5ffbfdee4c71e8ddb4dd2688f4
MD5 7b6707888eec579ddd4fcd61e4f5b754
BLAKE2b-256 2be296b99fb87ec25ecc5d4d59062340fe3aac9d26ebe9a8f1ca5ea121132c0d

See more details on using hashes here.

File details

Details for the file bilby_cython-0.5.4-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for bilby_cython-0.5.4-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c5713b3d1996f94f6ee17ad492f6ba4311b0f8faed185cb25f28cb100406d80c
MD5 8864647516a70cc71787dd193641a52c
BLAKE2b-256 633d9925808700df5fd4f4cf25ce954a259d27db459c0d88c021ce7140fd6cc4

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