Crates.io | bilby_rust |
lib.rs | bilby_rust |
version | 0.1.0 |
source | src |
created_at | 2024-08-21 21:43:31.961334 |
updated_at | 2024-08-21 21:43:31.961334 |
description | Rust implementation of domain-specific geometrical operations for Bilby to mirror the functionality in bilby-cython using PyO3. |
homepage | |
repository | https://github.com/ColmTalbot/bilby_rust |
max_upload_size | |
id | 1346955 |
size | 67,722 |
Rust implementation of domain-specific geometrical operations for Bilby to mirror the functionality in bilby-cython using PyO3.
To compile the project and install the python bindings you can use maturin
$ maturin develop
This will install an unoptimized version, if you want to test benchmarking, be sure to install with
$ maturin develop --release
On MacOS, you may need to install additional dependencies:
rustup target add x86_64-apple-darwin
mamba install -c conda-forge clang
The python code can then be used directly in python
>>> from bilby_rust.time import greenwich_mean_sidereal_time
>>> greenwich_mean_sidereal_time(1e9)
26930.069103915423
The API doesn't completely match bilby-cython
:
numpy
ufuncs
using PyO3
so the vectorized version of greenwich_mean_sidereal_time
is implemented as bilby_rust.time.greenwich_mean_sidereal_time_vectorized
.bilby_rust.geometry.{time_dependent_polarization_tensor,time_delay_from_geocenter_vectorized,frequency_dependent_detector_tensor}
. This was translated from an implementation by @jacobgolomb for bilby-cython
.bilby_rust.geometry.zenith_azimuth_to_theta_phi_optimized
.bilby_rust.geometry.{antenna_response,antenna_response_all_model,antenna_response_tensor_modes}
.