Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Phantom build

Project description

Phantom build

phantom-build is designed to make building Phantom easier.

The main aim is to have reproducible Phantom builds for writing reproducible papers.

Build Status Coverage Status PyPI


Install phantom-build with pip

pip install phantombuild


Import phantom-build

>>> import phantombuild

phantom-build has four main functions:

  • get_phantom is used to clone Phantom from the bitbucket repository, or to check if it is already cloned.
  • checkout_phantom_version is used to check out a particular Phantom version based on a git commit hash.
  • patch_phantom is used to apply patches.
  • build_phantom is for compiling Phantom with particular Makefile options.


A reproducible Phantom paper

Say you want to have a reproducible Phantom build for a paper. You want to work from a particular version of Phantom, and you need to apply patches to that version.

  1. First, clone Phantom.

    # Clone Phantom
    phantom_dir = pathlib.Path('~/repos/phantom').expanduser()
  2. Now, check out a particular version of Phantom based on the git commit hash.

    # Checkout particular commit
    required_phantom_git_commit_hash = '6666c55feea1887b2fd8bb87fbe3c2878ba54ed7'
  3. Then, apply your patch.

    # Apply patch
    phantom_patch = pathlib.Path('my-phantom.patch')
  4. Now, build Phantom with particular Makefile options.

    # Makefile options
    setup = 'dustybox'
    system = 'gfortran'
    extra_makefile_options = {'MAXP': '10000000'}
    hdf5_location = pathlib.Path('/usr/local/opt/hdf5')
    # Compile Phantom

You can write the above into a script included with the git repository of the paper to help make your paper reproducible. Of course, you also need to include all the Phantom .in and .setup files. For managing those files, see phantom-config. For setting up Phantom simulations, see phantom-setup.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for phantombuild, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size phantombuild-0.1.4-py3-none-any.whl (5.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size phantombuild-0.1.4.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page