Skip to main content

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

Project description

McFAST v0.1.5

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.5.tar.gz (40.7 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.5-cp313-cp313-win_amd64.whl (322.0 kB view details)

Uploaded CPython 3.13Windows x86-64

mcfast-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl (422.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

mcfast-0.1.5-cp313-cp313-macosx_11_0_arm64.whl (369.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mcfast-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl (385.7 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

mcfast-0.1.5-cp312-cp312-win_amd64.whl (322.4 kB view details)

Uploaded CPython 3.12Windows x86-64

mcfast-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl (422.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

mcfast-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (369.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mcfast-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl (386.4 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

mcfast-0.1.5-cp311-cp311-win_amd64.whl (323.6 kB view details)

Uploaded CPython 3.11Windows x86-64

mcfast-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl (425.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

mcfast-0.1.5-cp311-cp311-macosx_11_0_arm64.whl (373.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mcfast-0.1.5-cp311-cp311-macosx_10_12_x86_64.whl (388.4 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

mcfast-0.1.5-cp310-cp310-win_amd64.whl (323.6 kB view details)

Uploaded CPython 3.10Windows x86-64

mcfast-0.1.5-cp310-cp310-manylinux_2_28_x86_64.whl (425.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

mcfast-0.1.5-cp310-cp310-macosx_11_0_arm64.whl (374.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mcfast-0.1.5-cp310-cp310-macosx_10_12_x86_64.whl (388.4 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: mcfast-0.1.5.tar.gz
  • Upload date:
  • Size: 40.7 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.5.tar.gz
Algorithm Hash digest
SHA256 e802fff022b258db92b9b8a24350e00282bb8634f4a04ba7c608ff17f83ddd3f
MD5 7cbb693f86f842d61f635b34f97a7461
BLAKE2b-256 347bacee2493cd3eca5998d5e1828b001af807c46c927fc112d0bf9458c82e02

See more details on using hashes here.

Provenance

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

Publisher: mac.yml on McFACTS/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.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 322.0 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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b98a92e06819330f087fc0f98487c00b82b4da131529290d06f0662924a42e7c
MD5 4e7213a6494616d442d9ff5fe1b32b0d
BLAKE2b-256 2a356f2e743244d2c14908395a220938f654f56812bb074848331fe53d16bdd9

See more details on using hashes here.

Provenance

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

Publisher: windows.yml on McFACTS/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.5-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 62ac947f7d31e8bc304c45a45a34d9a72e4e795351f8cfb267940cce0e09d450
MD5 29b7efe163c1da0d448a2ec95ace1fa4
BLAKE2b-256 6855ec132cebfbacb55dcefc50a87291ac1c80bba1a8d4b9bb741e02cedc59ff

See more details on using hashes here.

Provenance

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

Publisher: ubuntu.yml on McFACTS/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.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 edd8fb03257164366a36dbb151102ff3cb52c1b27ee29a3afedcd5c7a457d09c
MD5 ce1fca72e1cf815752289895b28fe23d
BLAKE2b-256 a4a91a8040ab7cb9875da31a7b6ed3fdd7c56086b2b13081e52fc399b02fa670

See more details on using hashes here.

Provenance

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

Publisher: mac.yml on McFACTS/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.5-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5bacb4a53bc7616421008a1a82582bfe83ee806ef512e404f9cee52f7e0bea7f
MD5 134923ed5e06d97e266fdc2397265c94
BLAKE2b-256 d42854e13e6258689f7127f248d95f8f8ddb612d6e2f33a57aa9c460dd5fa9e3

See more details on using hashes here.

Provenance

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

Publisher: mac_x86.yml on McFACTS/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.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 322.4 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e88d6b198d655bb71fa03c9fb8402dc7847617e08bdefb1add075657f43afe29
MD5 6ca535c264d4d40f25db99598c7f34e3
BLAKE2b-256 9454b0ae75d2a670ffbd4ff204c6a219d8d5a8c92ebac0dd62b9877d9dd4b447

See more details on using hashes here.

Provenance

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

Publisher: windows.yml on McFACTS/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.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 85ec812629889a6bc1af15e43071b689ad23cd2de8b6efc0f4345a46b19fbf83
MD5 a473d6dd110c81c0bc87e2de96f832fe
BLAKE2b-256 d881d753877302e0a578746a7c2cf0e874b8d5a4293c3b0716db28a21bac69bf

See more details on using hashes here.

Provenance

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

Publisher: ubuntu.yml on McFACTS/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.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16b8df48f3bc72c020dad5ef9fe829e507cd02accc998840acf85ac1db4af23f
MD5 cf31e9344aeaed271dba65cf9357a353
BLAKE2b-256 7fb8aacf4ca13f9f41192a7412f727ca71e36b3f1363ecdd20bf4bb78aecccf6

See more details on using hashes here.

Provenance

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

Publisher: mac.yml on McFACTS/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.5-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 71902e26dcf0587917fadb34535a5fa9c44ad343e97ea91b92182f504d64e49c
MD5 71933ab4261492315aa322799a119ffd
BLAKE2b-256 27c64b0ebaa1c78ada67bd041358b3b2004cd192e322b6db50c5d6a021dd30bc

See more details on using hashes here.

Provenance

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

Publisher: mac_x86.yml on McFACTS/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.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 323.6 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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fdd3ca9c65efb324011dee3cf886b421a64e8f7cfe60d40b94bfc8e534970f5d
MD5 c36a03a945bb67f9b2834e2d9b7e16ee
BLAKE2b-256 45bfce7475533cc8236f54301f266260278e9b868dc3b92b1c6f04371f3cc67a

See more details on using hashes here.

Provenance

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

Publisher: windows.yml on McFACTS/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.5-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2fa73b9dffcb60caa35c2326fe3609ec6aa1b767ba50f5d0f097da4c121d0b84
MD5 88417a0b2dec029226e3418dec2462b2
BLAKE2b-256 ede30b5bd3a43dc9be0b381aa43ba4cc239450bd9d026c3361d279c957a02b7a

See more details on using hashes here.

Provenance

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

Publisher: ubuntu.yml on McFACTS/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.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 64eb67b1e596d2da4ab33ac83086d82db496d714337660e875333c42d4be949e
MD5 6a3ff11ea29333a1af2bc193c62ddc6f
BLAKE2b-256 3f4651e9d01f4d3d0171f9cfbbd626c733842f8e3fd83f2ec075f21ccc1c0c0f

See more details on using hashes here.

Provenance

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

Publisher: mac.yml on McFACTS/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.5-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ab396ad9609c0b467cd1269efa672d2fce6e76f41e2fbfd5330f982689cfd8ee
MD5 8ce65a072c911a75f28b2da8a258f494
BLAKE2b-256 691b7e41b3d536c2a3d861c364aabc61422d30ce8cfaaa63f3ae83e8b5152811

See more details on using hashes here.

Provenance

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

Publisher: mac_x86.yml on McFACTS/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.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: mcfast-0.1.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 323.6 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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ec255e353508e93e0c5ee75b782c254ed879fe31b321ae327eb4b36f3694d9b4
MD5 d564fd60ce219b98e1796268334bae3d
BLAKE2b-256 a63facf9664c68dd8de34cdf5fa9a8453a9d78d71ce70654dcfde076bbfbcf67

See more details on using hashes here.

Provenance

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

Publisher: windows.yml on McFACTS/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.5-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c8805322e2b71bd2845473e1e377005551ba7dad946d7ef7399659ff26c30634
MD5 d94b2e2a9ad743449671ed64e19be876
BLAKE2b-256 d8f017e6a2f5352508fc6fd7fb6a9621d18b1e1f4a0824811c2c5ba3e88c20ef

See more details on using hashes here.

Provenance

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

Publisher: ubuntu.yml on McFACTS/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.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d030c9036803d0ec7b3d4908a1e05822b892a72ad80d3f006407fa4b8cc0b779
MD5 9ac45bca688cbdb1a11c32e518af8ebd
BLAKE2b-256 341656f5661ef1f51ebebe6823be658f5240950c37f13317efb2a491995c01a2

See more details on using hashes here.

Provenance

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

Publisher: mac.yml on McFACTS/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.5-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mcfast-0.1.5-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 19985ca934ae3c97fac3fa9e293ae330e90718514e64ed0c6d86d082c9943484
MD5 29ae4d3e329a397313cf4e60f6c7bbcb
BLAKE2b-256 cb273603c36f99b9304c4db4c945eadc85562074359f4d044d06102ae4ff0ea4

See more details on using hashes here.

Provenance

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

Publisher: mac_x86.yml on McFACTS/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