Contains
- BXA
- MultiNest
- PyMultiNest
- Sherpa
- Xspec
| import progressbar | |
| pbar = progressbar.ProgressBar(widgets=[progressbar.Percentage(), | |
| progressbar.Counter('%5d'), progressbar.Bar(), progressbar.ETA()]) | |
| for obj in pbar(to_handle): | |
| # deal with object | |
| import joblib | |
| import os | |
| cachedir = 'cache' | |
| if not os.path.isdir(cachedir): os.mkdir(cachedir) | |
| mem = joblib.Memory(cachedir=cachedir, verbose=True) | |
| @mem.cache | |
| def my_long_function(i): | |
| return i + i |
| #!/bin/bash | |
| # | |
| # necessary packages: | |
| # sudo apt-get install python-{scipy,numpy,matplotlib,progressbar} ipython libblas{3,-dev} liblapack{3,-dev} libatlas{3-base,-dev} cmake build-essential git gfortran r-base r-base-dev | |
| # | |
| echo 'checking installed software requirements' | |
| for c in R cmake; do | |
| if ! hash $c; then echo "install '$c' first"; exit 1; fi |
| #!/bin/bash | |
| # Author: Johannes Buchner (C) 2013 | |
| # tool for publishing sphinx documentation on github | |
| # and releasing packages on PyPI | |
| case "$1" in | |
| doc) | |
| # see https://help.github.com/articles/creating-project-pages-manually | |
| make -C doc/ html && | |
| git checkout gh-pages && |
| Follow https://developer.mozilla.org/en-US/docs/Simple_Thunderbird_build | |
| comm-central/.mozconfig: | |
| ac_add_options --enable-application=mail | |
| ac_add_options --with-ccache=/usr/bin/ccache | |
| ac_add_options --enable-calendar | |
| #ac_add_options --disable-debug | |
| ac_add_options --enable-debug |
| import subprocess | |
| def runscript(name): | |
| args = ('./interact', name,) | |
| p = subprocess.Popen(args) | |
| # p.communicate() # set stdin/stdout/stderr=subprocess.PIPE | |
| if p.wait() != 0: | |
| raise Exception('return value of startup script was non-zero') |
| #!/bin/bash | |
| #rm /usr/portage/distfiles/* | |
| renice +20 -p $$ | |
| ionice -c3 -p $$ | |
| pgrep emerge >/dev/null || rm /var/tmp/portage/*-* -rf | |
| emerge-webrsync && eix-update | |
| ARGS="--quiet-build --load-average=10 --jobs=3" |
| """Estimate Time until completion of a process. | |
| Usage: <statusprog> | howlong.py <n> | |
| <statusprog> is a program that writes a line to stdout from time to time. | |
| The line is the number of items completed so far. | |
| <n> is the total number of items to complete. | |
| Example: | |
| for((i=0;i<20;i++)); do echo $i; sleep 1; done | python howlong.py 20 |
| import numpy | |
| from numpy import log, isnan, isfinite, sin, cos, tan, abs, any, pi | |
| import scipy, scipy.stats | |
| import pymultinest | |
| import json | |
| import sys | |
| import matplotlib.pyplot as plt | |
| numpy.random.seed(1) | |
| outputfiles_basename = "mnchains_toy_" |