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.
Install
Install phantom-build with pip
pip install phantombuild
Usage
Import phantom-build
>>> import phantombuild as pb
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.
Examples
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.
-
First, clone Phantom.
# Clone Phantom phantom_dir = pathlib.Path('~/repos/phantom').expanduser() pb.get_phantom(phantom_dir)
-
Now, check out a particular version of Phantom based on the git commit hash.
# Checkout particular commit required_phantom_git_commit_hash = '6666c55feea1887b2fd8bb87fbe3c2878ba54ed7' pb.checkout_phantom_version(phantom_dir, required_phantom_git_commit_hash)
-
Then, apply your patch.
# Apply patch phantom_patch = pathlib.Path('my-phantom.patch') pb.patch_phantom(phantom_dir, phantom_patch)
-
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 pb.build_phantom( phantom_dir, setup, system, hdf5_location, extra_makefile_options )
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.
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
Built Distribution
Hashes for phantombuild-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4763303d3a0414eca2bc74cc4ca010bb4d4b34d73f02b778d06d8ec6e461ff82 |
|
MD5 | 297e9d9196a66c5cf96bb7ca94db1359 |
|
BLAKE2b-256 | c4083c277a55823310284b5a2bfd3d2a68e2918800b9a868e845178b5d2f02d4 |