Skip to content

Commit

Permalink
Merge pull request #5 from cosmo-ethz/r060
Browse files Browse the repository at this point in the history
R060
  • Loading branch information
cosmo-ethz committed Aug 15, 2016
2 parents 399295c + 3094135 commit 08556b2
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 200 deletions.
23 changes: 16 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
language: python
python:
- "2.7"
- "3.3"
- "3.4"

before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libatlas-dev libatlas-base-dev liblapack-dev gfortran
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- sudo apt-get update
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get -qq update
- sudo apt-get -qq install g++-4.8 gcc-4.8
- sudo ln -sf /usr/bin/gcc-4.8 /usr/bin/gcc
- sudo ln -sf /usr/bin/g++-4.8 /usr/bin/g++
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update --yes conda
- travis_retry conda install --yes python=$TRAVIS_PYTHON_VERSION pip numpy scipy

Expand Down
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
History
-------

0.6.0 (2016-08-15)
++++++++++++++++++
- Order preserving parameter objects
- Fixing logging issue
- Prettified examples


0.5.0 (2015-05-12)
++++++++++++++++++
- Flat package structure
Expand Down
2 changes: 1 addition & 1 deletion cosmoHammer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This is the CosmoHammer package.
"""

__version__ = '0.5.0'
__version__ = '0.6.0'
__author__ = 'Joel Akeret'
__credits__ = 'Institute for Astronomy ETHZ, Institute of 4D Technologies FHNW'

Expand Down
1 change: 0 additions & 1 deletion cosmoHammer/pso/BestFitPositionGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import numpy
from cosmoHammer.pso.ParticleSwarmOptimizer import ParticleSwarmOptimizer
from cosmoHammer.pso.ParaboloidFitter import ParaboloidFitter
from cosmoHammer.pso.CurvatureFitter import CurvatureFitter

class BestFitPositionGenerator(object):
Expand Down
175 changes: 0 additions & 175 deletions cosmoHammer/pso/ParaboloidFitter.py

This file was deleted.

17 changes: 8 additions & 9 deletions doc/source/user/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ To run CosmoHammer in order to sample the WMAP 9 year likelihood, you would do s
from pycambWrapper import PyCambCoreModule

#parameter start center, min, max, start width
params = np.array(
[[70, 40, 100, 3],
[0.0226, 0.005, 0.1, 0.001],
[0.122, 0.01, 0.99, 0.01],
[2.1e-9, 1.48e-9, 5.45e-9, 1e-10],
[0.96, 0.5, 1.5, 0.02],
[0.09, 0.01, 0.8, 0.03],
[1,0,2,0.4] ])
params = Params(("hubble", [70, 65, 80, 3]),
("ombh2", [0.0226, 0.01, 0.03, 0.001]),
("omch2", [0.122, 0.09, 0.2, 0.01]),
("scalar_amp", [2.1e-9, 1.8e-9, 2.35e-9, 1e-10]),
("scalar_spectral_index", [0.96, 0.8, 1.2, 0.02]),
("re_optical_depth", [0.09, 0.01, 0.1, 0.03]),
("sz_amp", [1,0,2,0.4]))

chain = LikelihoodComputationChain(
min=params[:,1],
max=params[:,2])
Expand Down
7 changes: 4 additions & 3 deletions examples/DerivedParamterFileUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
'''
from cosmoHammer.util import SampleFileUtil

VALUE_1_KEY = "value1"
VALUE_2_KEY = "value2"
VALUE_1_KEY = "derived_params_key"
VALUE_2_KEY = "derived_params_key"

OUTPUT_ORDER = [VALUE_2_KEY, VALUE_1_KEY]

Expand All @@ -35,7 +35,8 @@ def persistValues(self, posFile, probFile, pos, prob, data):

#handle special parameters
for derParams in data:
self.paramsFile.write("\t".join(derParams[key] for key in OUTPUT_ORDER))
if len(derParams) > 0:
self.paramsFile.write("\t".join([str(derParams[key]) for key in OUTPUT_ORDER]))
self.paramsFile.write("\n")

self.paramsFile.flush();
2 changes: 1 addition & 1 deletion examples/wmap_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


pyCambCore = PyCambCoreModule.PyCambCoreModule()
cambCore = CambCoreModule.CambCoreModule()
cambCore = CambCoreModule()
wmap3Likelihood = wmap3.WmapLikelihoodModule()
wmap5Likelihood = wmap5.WmapLikelihoodModule()
wmap7Likelihood = wmap7.WmapLikelihoodModule()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run_tests(self):

setup(
name="cosmoHammer",
version='0.5.0',
version='0.6.0',
author='Joel Akeret',
author_email="jakeret@phys.ethz.ch",
url="http://www.cosmology.ethz.ch/research/software-lab/cosmohammer.html",
Expand All @@ -60,6 +60,6 @@ def run_tests(self):
'Natural Language :: English',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py26, py27, docs-ci
envlist = py26, py27, py34, docs-ci

[testenv]
setenv =
Expand Down

0 comments on commit 08556b2

Please sign in to comment.