Skip to main content

BubbleBarrier

PyPI version License: MIT Python 3.7+ GitHub Actions Workflow Status

A Python package for barrier calculations in cosmic reionization models, providing essential tools for modeling the physics of ionized bubbles in the early universe.

Overview

The BubbleBarrier package provides a framework for calculating the density barrier (δ_v) required for cosmic structure formation within ionized regions during the Epoch of Reionization. It implements self-consistent models for ionization balance, halo mass functions, and feedback mechanisms.

This tool is designed for researchers and students in cosmology and astrophysics studying the 21cm signal, reionization simulations, and the interplay between galaxies and the intergalactic medium.

Core Features

  • Barrier Function Calculation: Computes the critical density barrier δ_v for different halo masses.
  • Ionization Modeling: Self-consistent calculation of ionizing photon production (N_ion).
  • Minihalo Effects: Includes options to model the impact of X-ray heating from minihalos.
  • Custom Power Spectrum: Utilizes camb for cosmological calculations and allows for custom power spectrum models.
  • Efficient & Cached: Caches intermediate results to disk (.npy files) for significantly faster subsequent calculations.

Installation

Install the package directly from PyPI:

pip install bubblebarrier

Quick Start

Here is a simple example of how to calculate the barrier height for a given halo mass.

import numpy as np
from bubblebarrier import Barrier

# 1. Initialize the barrier model for a specific redshift
#    (fesc, qion, etc., have default values but can be specified)
barrier_model = Barrier(z_v=10.0)

# 2. Define a halo mass in solar masses
halo_mass = 1e15  # M_sun

# 3. Calculate the barrier height
delta_v = barrier_model.Calcul_deltaVM(halo_mass)
print(f"For a halo of {halo_mass:.1e} M_sun at z={barrier_model.z:.1f}, the barrier height is δ_v = {delta_v:.3f}")

# 4. Calculate the barrier including effects from minihalo X-ray heating
delta_v_minihalo = barrier_model.Calcul_deltaVM_Minihalo(halo_mass)
print(f"Including minihalo effects, the barrier is δ_v = {delta_v_minihalo:.3f}")

Dependencies

This package relies on a standard scientific Python stack:

  • numpy
  • scipy
  • astropy
  • matplotlib
  • pandas
  • filelock
  • camb: For cosmological power spectra.
  • massfunc: For halo mass function calculations.

Citation

If you use BubbleBarrier in your research, please cite the repository.

@misc{bubblebarrier2025,
  author = {Hajime Hinata},
  title = {BubbleBarrier: A Python package for reionization bubble modeling},
  year = {2025},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/SOYONAOC/BubbleBarrier}}
}

Contributing

Contributions are welcome! Please feel free to fork the repository, create a feature branch, and open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for bubblebarrier 1.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bubblebarrier 1.2.7
File Size Uploaded
bubblebarrier-1.2.7.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bubblebarrier 1.2.7
File Interpreter ABI Platform
bubblebarrier-1.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / bubblebarrier-1.2.7.tar.gz

Download URL bubblebarrier-1.2.7.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8f372cc9b0e1eb2ff8280be6ad10f3bb03927943afe8634e1c75e71ebf462236
BLAKE2b-256 checksum
How to use checksums
c5c7b5a69f7a2a27295b2ade47a73bd60853f353f142abd177aed8ab68a3613b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2025.

Transparency log

Release files / bubblebarrier-1.2.7-py3-none-any.whl

Download URL bubblebarrier-1.2.7-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
778e6e5db19860131534fc29dc86d2c080fa62d88d4084705079f864120123e1
BLAKE2b-256 checksum
How to use checksums
8cb723deb0151c2c87db362cc9e2a8b92420de381efce99bc097c87f614f213f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.7 This release

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page