Skip to main content

Package with some fast Rust functions for use with FRC resolution determination for microscopy. TU Delft BEP 2021-2022.

Project description

rustfrc

GitHub release License

rustfrc is a Python package with some fast Rust functions for use with FRC resolution determination for microscopy. It is in development for use during a Bachelor end project for the TU Delft in 2021-2022.

Since rustfrc contains compiled extensions and is not pure Python, it is not available for all platforms, but only for those with available compiled wheels. As of version 1.0.1, they are available for Windows (x86_64), macOS (x86_64 and universal2, which includes Apple Silicon) and Linux (x86_64). However, since Rust and Python are supported on many platforms, it is not difficult to compile for other platforms (see below).

Features

Currently, rustfrc does not have many features. The primary one is binom_split(x: np.ndarray) -> np.ndarray which samples Binom ~ (n, 0.5) with n as the array element value.

Requirements

  • Python 3.7 or greater
  • numpy 1.18 or greater

Installation

You can most easily install rustfrc as follows:

pip install rustfrc

However, for an optimal Python experience, use poetry and install it using poetry add rustfrc.

From source (using maturin)

rustfrc uses poetry as its Python dependency manager. For best results, create a poetry virtualenv (be sure to install virtualenv as a systems package) with the pyproject.toml and run poetry update to install the required packages. Installing maturin manually should also work. It is also necessary to have a Rust toolchain installed on your computer. Rust can be easily installed using rustup.

Build a wheel file like this (if using poetry, append poetry run before the command) from the project directory:

maturin build --release

If you want to choose which versions of Python to build for, you can append e.g. maturin build --release -i python3.9 python3.8 python3.7. Here python3.7 should be an available Python command installed on your computer.

This generates .whl files in \target\wheels. Then, create a Python environment of your choosing (with numpy ^1.18 and python ^3.7), drop the .whl file in it and run pip install <.whl filename>, for example: pip install rustfrc-0.1.0-cp39-none-win_amd64.whl. Then, use import rustfrc in your Python script to be able to use the Rust functions. This should be generally valid for all platforms. The only real requirement is the availability of a Rust toolchain and Python for your platform.

Take a look at PyO3 for other installation options as the only true requirement for building is using a tool that understands PyO3 bindings, as those are used in the Rust code.

Manylinux

If you want to build .whl files that are compatible with a wide range of Linux distributions and can be uploaded to PyPI, using a manylinux container is necessary.

This example assumes a manylinux2014 (x86_64) target, using other docker base images should work to compile for other targets. Go into the rustfrc/docker directory and run:

docker pull quay.io/pypa/manylinux2014_x86_64
docker build --no-cache -t tmtenbrink/manylinux2014-rustfrc --build-arg PY_ABI=cp39-cp39 .

After the image is built, run it as a container:

docker run -it tmtenbrink/manylinux2014-rustfrc

The repository should now be installed at /opt/rustfrc, with its dependencies and maturin installed. Then follow the same steps as above, but when the wheels are built run the following, which should resolve any issues:

find . -name '*.whl' -exec auditwheel repair {} \;

The complete wheel files can now be found in a /wheelhouse directory.

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

rustfrc-1.0.2.tar.gz (12.9 kB view details)

Uploaded Source

Built Distributions

rustfrc-1.0.2-cp310-none-win_amd64.whl (180.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

rustfrc-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (986.1 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

rustfrc-1.0.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.6 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustfrc-1.0.2-cp310-cp310-macosx_10_7_x86_64.whl (288.7 kB view details)

Uploaded CPython 3.10 macOS 10.7+ x86-64

rustfrc-1.0.2-cp39-none-win_amd64.whl (180.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

rustfrc-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (985.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

rustfrc-1.0.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.4 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustfrc-1.0.2-cp39-cp39-macosx_10_7_x86_64.whl (288.5 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

rustfrc-1.0.2-cp38-none-win_amd64.whl (180.7 kB view details)

Uploaded CPython 3.8 Windows x86-64

rustfrc-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (986.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

rustfrc-1.0.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (568.0 kB view details)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustfrc-1.0.2-cp38-cp38-macosx_10_7_x86_64.whl (288.8 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

rustfrc-1.0.2-cp37-none-win_amd64.whl (180.6 kB view details)

Uploaded CPython 3.7 Windows x86-64

rustfrc-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (986.3 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

rustfrc-1.0.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (567.6 kB view details)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

rustfrc-1.0.2-cp37-cp37m-macosx_10_7_x86_64.whl (288.7 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

File details

Details for the file rustfrc-1.0.2.tar.gz.

File metadata

  • Download URL: rustfrc-1.0.2.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7e0b74a1c653c5ff4ff20c799332ef3095d478b05713e851f3916f9aa2bae1f6
MD5 a0e9121d845a60f4461eb822fcae3dc9
BLAKE2b-256 fa9941e35c55644250a1c44a44339f91af16aa079788476bf22e40b5a81c9ba1

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp310-none-win_amd64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 180.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 256318fb3d7d0083e33ddb52e21cfabd1d618cc6d6fd85945b23f40576e7a382
MD5 bf80fa3fba3ea4159aa9f2ed271eeb0e
BLAKE2b-256 0f4499e51163a7ec8534e27329fb0d6aef9ee5c03b860743f14d3f4fd9356d33

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fcde69d3d2446cbbea6e224e0571e02f84052dc4f28ba1cef36871a8307fe8ea
MD5 df504390486df06e8425aa373282953b
BLAKE2b-256 f41659a10e95237ac2241f3142929ebcbb6a1d74a6de30a6eaaf0d8e5449dbb1

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 4d078c9118aa51e681fde37714b6a45d66ff740b30a70771ca4119440d662262
MD5 1121836b56df34c5257a66cbab50edce
BLAKE2b-256 c04bc086ae99579382cb4b605f0822223a5b598b8781d6e7a8fc8b435285677a

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp310-cp310-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 288.7 kB
  • Tags: CPython 3.10, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5aba3f92eec2131ce53d011c81a5febd5b082f12c134cbbe26f77c45ad037e2c
MD5 be1519f0b958628d376cfcb17e7f3cb4
BLAKE2b-256 d25d9605750ba0fda7a4e8f017e16ee93a881dfb0b2c1c6f3a809fbf127c1b4d

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp39-none-win_amd64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 180.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 e981889684440a63271e1eea3b4a858d0421d3f13fb042167e436e051738081a
MD5 5c8f5d1e3acfe8cdf7fd02f40972837a
BLAKE2b-256 2b46015f6263125327bec53dbd7b2b11b7b56831f91102d6c067aa8adfe1d6e7

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 af8d7e6472e8b8882c1d44ac12eb68e1125838829e0b989b74a9021c7a2df9d6
MD5 1b8b5a804884037269fb791e292ed786
BLAKE2b-256 c4c6ce8991bc1efa9c39cf3cf051ead1895c9c2b65e2592a580a84bf69acde21

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1dd2513726ff79fb398c1765376afcbf770535a7ac182a0e23fc078d1865573c
MD5 93303b1c9f3d93ff1757269f218bfbf9
BLAKE2b-256 c31306f4ba97e2044873fb2b134c1714fa4c4d4db9b8bc0bd070af48baba2189

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp39-cp39-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 288.5 kB
  • Tags: CPython 3.9, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8ea9107904198a231067b83b43dbd313f9a3fa14ada413154cfe7a2feb33187c
MD5 e4a3028fb3cd032f00e48eef6450b18f
BLAKE2b-256 16839150dfa201cb8df384ee6cc51fe4cc85f4d65fbe7e8439ee8616539c8e29

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp38-none-win_amd64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 180.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 d28bec49079d948b058905b8965bd248aa04d127aa0efe6f7f235b9f4945aa2a
MD5 71ba39370739be66189c68579803278c
BLAKE2b-256 66b9cb6ee9471e7981a8409b105b26ffc16f0f8c1ec8cbcc02dd8c1cae0f1774

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41f158a89684fcba0120a4de32267be5d21091b031181cb8904f9faf67cf9eeb
MD5 7a1242bc0a0ba1c98c1331f790baca2e
BLAKE2b-256 7e4ee1b937c8dcdc0c5c33740dc3cdc62156c1b06b4cc5e6d81459b72e4cce21

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b56b0b231566ac25b1730928b8404539eab4dee5a443a2d03e539219c047e9d3
MD5 c8c8def41bf9456e78729149fab9977f
BLAKE2b-256 4d1850e5b6d70fadca1f05d8070e269dd940d1f0997bd360597c98b4d5cbfb3d

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp38-cp38-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 288.8 kB
  • Tags: CPython 3.8, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 9a9d75e239a177973b6efef8a2063330bf24e3dd68d09853c0682853955c87cb
MD5 67bf1be63469837eeebbf6dc9de8cbbc
BLAKE2b-256 da2376edb4938a2cdb3387a98756318ad4deefae66fba6317eaac51748cac448

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp37-none-win_amd64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 180.6 kB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 568cf4e5d978a1d38a41a815a241fc22d9ff84d83d4133e4a4e20ea1d1de42d6
MD5 d1ccbce16ef73b3c18e66ea256252dc4
BLAKE2b-256 50213b3088367382277f4b88fc6566c179791ec952a7c9f10ae90065d1d9fdf9

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ebd5642434c9224fdc66fa1ca273d8fef7c184b89bfc4879f1f5c95ec7832ab
MD5 095384b06208393f2228df9591204dd9
BLAKE2b-256 b30fed433bfe49ac59ef7f1801fb9c42aa7823c1da89dbb1481674a80c372829

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for rustfrc-1.0.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d6e0c4a79d160aa66842064f34ba4bf2daf20030e3fd4f9528cd354c93d2507b
MD5 a65543f3b36542846c2b678ab5f8fd28
BLAKE2b-256 3428109026191217037ad1f44653fea90329482b3acd6f91595f7c28e6268bda

See more details on using hashes here.

File details

Details for the file rustfrc-1.0.2-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: rustfrc-1.0.2-cp37-cp37m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 288.7 kB
  • Tags: CPython 3.7m, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for rustfrc-1.0.2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 28425d9c7b648e12173338e2f6fa263e1f40387ffb66aceafe38b222b4574ee6
MD5 0b17e106794c6cb7248e3c5615dbad51
BLAKE2b-256 3ab2beb3eae553ce74c7aebaa6fa0232f5e6728c2abe5b3eb59a63ec91ea0a61

See more details on using hashes here.

Supported by

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