Skip to main content

A set of utilities and Rust-accelerated functions for the McFACTS AGN disk simulation project

Project description

McFAST v0.1.4

Utilities and accelerated functions designed for use by the McFACTS team at CUNY.

Still under early alpha development. Modules and functions that are not explicitly documented here are not yet ready for use.

Tau Incline/Eccentricity

In order to accelerate the tau_inc_dyn and tau_ecc_dyn functions in mcfacts/physics/disk_capture.py, we provide tau_inc_dyn_helper and tau_ecc_dyn_helper functions that perform the vectorized array calculations in an optimized Rust function. The example implementation for tau_inc_dyn_optimized follows: it has the same call signature, takes the same inputs, and provides the same output as tau_inc_dyn, but is 2-3x faster.

This function and its ecc variant can be further optimized by speeding up or eliminating the calls to si_from_r_g, which now make up the bulk of the runtime in each function (approximately 2/3rds).

In particular, the tau_semi_lat functionality in tau_ecc_dyn is sped up at least 120x, with tau_semi_lat initially being timed at 6 seconds, while the tau_ecc_dyn_helper functionality that subsumes it is timed at 0.05 seconds.

def tau_inc_dyn_optimized(smbh_mass, disk_bh_retro_orbs_a, disk_bh_retro_masses, omega, ecc, inc, disk_surf_density_func, r_g_in_meters):
    """Computes inclination damping timescale from actual variables; used only for scaling.
    Uses Rust-accelerated helper functions for the calculation: compare to tau_inc_dyn
    """
    # throw most things into SI units (that's right, ENGINEER UNITS!)
    #    or more locally convenient variable names
    SI_smbh_mass = smbh_mass * u.Msun.to("kg")  # kg
    SI_semi_maj_axis = si_from_r_g(smbh_mass, disk_bh_retro_orbs_a, r_g_defined=r_g_in_meters).to("m").value
    SI_orbiter_mass = disk_bh_retro_masses * u.Msun.to("kg")  # kg
    cos_omega = np.cos(omega)

    disk_surf_res = disk_surf_density_func(disk_bh_retro_orbs_a)

    tau_i_dyn = tau_inc_dyn_helper(SI_smbh_mass, SI_orbiter_mass, ecc, inc, cos_omega, disk_surf_res, SI_semi_maj_axis)

    assert np.isfinite(tau_i_dyn).all(), \
        "Finite check failure: tau_i_dyn"

    return tau_i_dyn

Merge Tree

For M. McCarthy's black hole merge tracking feature.

import mcfast
from mcfast import MergeForest

# creates a forest of all black holes
forest = MergeForest("./data/", "galaxy_state_*")

bh_uuid: str = "2b422064-0a84-4687-a542-395dcb61cd4f"

# get the immediate child of a given UUID, if the UUID is valid
descendant_uuid = forest.get_descendant(bh_uuid)

# get the immediate parents of a given UUID, if the UUID is valid
(parent1_uuid, parent2_uuid) = forest.get_parents(bh_uuid)

# get the full ancestry list of a given UUID (in DFS order), 
# assuming the UUID has ancestors
ancestor_list = forest.get_ancestors(bh_uuid)


# get the full list of black holes between the UUID and 
# the final product (root)
descent_path = forest.get_lineage_to_root(bh_uuid)

# get the generation of a given UUID, where an initialized BH is generation 0
# note: implementation doesn't fully line up with existing
# reference implementation, under review
generation = forest.get_generation(bh_uuid)

# get all 'root' black holes (products remaining at the final tick)
roots = forest.roots()

# get all 'leaf' black holes (initialized BHs with no ancestors)
leaves = forest.leaves()

# get all 'singleton' black holes (neither ancestors nor children)
singletons = forest.singletons()

if forest.contains(bh_uuid):
    print("It exists!")
else:
    print("It doesn't exist!")

# get total number of nodes in the 'forest'
total = len(forest)

# serialize and deserialize with pickle
import pickle
 
# Save now
with open("forest.pkl", "wb") as f:
    pickle.dump(forest, f)

# Load later
with open("forest.pkl", "rb") as f:
    restored = pickle.load(f)

# sample: 330-node forest serializes down to 16kb

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

mcfast-0.1.4.tar.gz (26.3 kB view details)

Uploaded Source

Built Distributions

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

mcfast-0.1.4-cp313-cp313-win_amd64.whl (297.1 kB view details)

Uploaded CPython 3.13Windows x86-64

mcfast-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl (399.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

mcfast-0.1.4-cp313-cp313-macosx_11_0_arm64.whl (349.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mcfast-0.1.4-cp313-cp313-macosx_10_12_x86_64.whl (369.2 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

mcfast-0.1.4-cp312-cp312-win_amd64.whl (297.0 kB view details)

Uploaded CPython 3.12Windows x86-64

mcfast-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl (399.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

mcfast-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (349.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mcfast-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl (369.8 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

mcfast-0.1.4-cp311-cp311-win_amd64.whl (297.1 kB view details)

Uploaded CPython 3.11Windows x86-64

mcfast-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl (400.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

mcfast-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (352.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mcfast-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl (371.8 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

mcfast-0.1.4-cp310-cp310-win_amd64.whl (297.1 kB view details)

Uploaded CPython 3.10Windows x86-64

mcfast-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl (400.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

mcfast-0.1.4-cp310-cp310-macosx_11_0_arm64.whl (351.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mcfast-0.1.4-cp310-cp310-macosx_10_12_x86_64.whl (371.8 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file mcfast-0.1.4.tar.gz.

File metadata

  • Download URL: mcfast-0.1.4.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcfast-0.1.4.tar.gz
Algorithm Hash digest
SHA256 916711cce0890cca36d3620c6ea6bb359da5ca9ea64e72cd84bb18f613d72940
MD5 226e5f4e38a2851cbcecc7cad07f682d
BLAKE2b-256 4b250500e06e2264a5a6dd536a78507728105cd66335ec9abfd77566c9e732c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4.tar.gz:

Publisher: mac.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 297.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcfast-0.1.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1b810867097ea4061ede2d7e7ea77349af48c7f6332cccaa599f73ede40f2000
MD5 fd79d75009ad115e67763d657ff79283
BLAKE2b-256 dc90cd5bbc0bdef2acd9995063d56efdf7a1c8cf2e9bcf3c5a05b379169bddad

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp313-cp313-win_amd64.whl:

Publisher: windows.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 122b7b3078aae8a023b05345260bea46b6a3d4eeea464bbdbf84e778b6c89103
MD5 65263e80d01b9c3ab6b49135762c2dd4
BLAKE2b-256 597f0c50635a5e026da77a6390294ef7923886cc765eeb2243fc082bfe9bed40

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: ubuntu.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 937c9ebf75f1e14aa2fad9e57af10fc10e9b49b5fe4f02ee0f8a86ad9c59a881
MD5 a1ee0ef9d8851fc5acd3cc57da8b11c3
BLAKE2b-256 3cbf5c022a7b9598a95e11b1ea844132ec8120887f838dad404ebcd37437682e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: mac.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fa22d0bb63929e8bffcd2256990b806d06a78bc977a2543a475ce12eaa5c4334
MD5 b8e4c6a557f791b49b7ff5ce5fdf14dc
BLAKE2b-256 8d7e51e0479a0206a609affb59b6f7ecbfdebfb84ecb7d0982cdf1d65ea1e3a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: mac_x86.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 297.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcfast-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 885bf1f8a701a4e799ace1370af146e3023b0d4bb601a572f343c486a8c59a18
MD5 17102f5b5aacebd2caf4d845cf6ad8c7
BLAKE2b-256 8723b0f18aa26afeeae108144fc779ba80c65650602769ddf87b3174a1350da6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp312-cp312-win_amd64.whl:

Publisher: windows.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6c622fcfe65e10c2a9f19fe80d98149faa5ec82e0e0d8ae4c0cad94f3288b77
MD5 301a7c3fd9fb153a9520c05031800138
BLAKE2b-256 ea985cc3450c80f5c9fc12447e1aa63b18d763e0d1b4b55bd01a7fe32870c357

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: ubuntu.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0268a892804f50f16f244fbc9c726ff08880dddd17a22fb2346ac5283e0918a
MD5 1c6b6c158c9199bc1cd828803873bc04
BLAKE2b-256 ae79705ac6ad85728c8aaa100d52846f15d88d32d4ef0fa081e1d51364d656fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: mac.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9721afc5614eceb3672e6aa6d12fb0a69e69cf47e412e6731018143a280314d4
MD5 a280d894339c40503b045e0c751c9585
BLAKE2b-256 517eeb574bf97f2feb5767a6a84bde9a90ab41bf3ee6b5bb8720bcba715f6473

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: mac_x86.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 297.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcfast-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f44141de96fe70871d74ccaa98817c3470bdfe961b6e76b5507263213df3e0ab
MD5 3da50371d518d5d9ef32434beacf44dd
BLAKE2b-256 37153b98c59199ee97b07406879fce5beeafbf1fa026c25a3ab1d61f225b4c68

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp311-cp311-win_amd64.whl:

Publisher: windows.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce1bb2abd50b73120f3eea1fd8b3bf7fd54041b44ae1bcc1ed5cbd0ea18ab56c
MD5 b8bf048646f12cfa786298ba1f8114a8
BLAKE2b-256 7abe05b8de8034a8f552fb222d290f4fee3a8ce3979c585cd0d9325bf0a735e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: ubuntu.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39b0af822cf9d310e76d05d43b491a5b3397d2e6ec8c9e9927c363f07d74f53b
MD5 238daf13a2833393dfd5c9602c53d7e0
BLAKE2b-256 c142d31c37c91b3594426fdebb6bfc286727e3ff0841214a310a6ab59d55831b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: mac.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 436b1b7652e2bdf5f8a358481f9b3df391315d0f2ac8c093ec43b1d8341422ef
MD5 4b8f39e344c43374038d63663cdacbe7
BLAKE2b-256 2d6ab84c317d3a1491319b0127abb554ada7a95318a271b72e673bfb343a5591

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: mac_x86.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 297.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcfast-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6154fba0098c6d476939d90f86afd74fba65bc6e3b6da33601f0f80de90afd2b
MD5 622bacb417f0187e15d96b510a3aea56
BLAKE2b-256 29e7a693c2641727a8fb5c5699675c10bbe144de2c4559b7521d445d8b5a019b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp310-cp310-win_amd64.whl:

Publisher: windows.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a838db6be717cb3376ebad7cfc3d505f435dbd82584d5ea9daeca72a62d9c08e
MD5 32dcf88ec5b494b97dee85537832deeb
BLAKE2b-256 02bb05b22f8d083722e3a4171d7f2e0768160f08fafc1a308deeab84a5ce31c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: ubuntu.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ae1a197657fc6cda03eb1c1535d6663db59cf9522ce897b764ef485b0f72657
MD5 cf24f869f725e38dcca67513a699aa9e
BLAKE2b-256 8fbae4a31a47cef569395f241d3eff9004479a617f055652fb96be893c652ab3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: mac.yml on nrposner/mcfast

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

File details

Details for the file mcfast-0.1.4-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.4-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 08b1b65dbb8f7942a2ee206fdacd98364c551aff95f733eb5a709f761a6407f3
MD5 07a5315a46364c25a8e5c3a83cb54166
BLAKE2b-256 148d14c18523144b35ecdc48e56eff45c58324ee53f0d2e468300980002dd735

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcfast-0.1.4-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: mac_x86.yml on nrposner/mcfast

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

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