Skip to content

Commit

Permalink
Merge pull request #12 from fermiPy/dmcat-dev
Browse files Browse the repository at this point in the history
Dmcat dev
  • Loading branch information
eacharles authored Sep 4, 2020
2 parents 1163313 + 1a07897 commit 515f943
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 61 deletions.
96 changes: 42 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,71 @@ services:
notifications:
email: false

python : 2.7

env:
global:
- FERMI_DIR=$HOME/ScienceTools/x86_64-unknown-linux-gnu-libc2.19-10
- SLAC_ST_BUILD=false
- PIP_DEPS='coverage pytest-cov coveralls'
- CONDA2='conda install -y -c conda-forge healpy'
- PIP_DEPS='coverage pytest-cov'
- INSTALL_CMD='python setup.py install'
- CONDA_CHANNELS=conda-forge
- CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'
- CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml fermipy'
- FERMI_CONDA_CHANNELS='-c conda-forge/label/cf201901 -c fermi -c fermi/label/beta'
- DMPIPE_CONDA_ENV='dmpipe'
- DOCKER_INSTALL=''

matrix:
include:

# The main build:
# Python 2, Fermi ST, all dependencies
- os: linux
env: NAME=fssc-st-10-00-05
env: NAME=main
PYTHON_VERSION=2.7
CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
ST_INSTALL='bash stinstall.sh force'
DOCKER_INSTALL=''

# The Sphinx docs build
# Python 3, no Fermi ST, all other dependencies
- os: linux
env: NAME=docs
PYTHON_VERSION=3.5
ST_INSTALL=''
DOCKER_INSTALL=''
CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml sphinx sphinx_rtd_theme'
CONDA_DOWNLOAD=Miniconda2-latest-Linux-x86_64.sh
CONDA_DEPS='gammapy=0.10 healpy=1.13.0 numpy astropy scipy matplotlib pyyaml fermipy'
ST_INSTALL="conda install -y --name $FERMIPY_CONDA_ENV -c conda-forge -c fermi -c fermi/label/beta fermitools"

# Python 3.5, no Fermi ST, all other dependencies
# The old build:
# Python 2, fixed tag of fermitools, all dependencies
- os: linux
env: NAME=py35_st-no_dep-yes
PYTHON_VERSION=3.5
ST_INSTALL=''
DOCKER_INSTALL=''
CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
env: NAME=old
PYTHON_VERSION=2.7
CONDA_DOWNLOAD=Miniconda2-latest-Linux-x86_64.sh
CONDA_DEPS='gammapy=0.10 healpy=1.13.0 numpy astropy scipy matplotlib pyyaml fermipy'
ST_INSTALL="conda install -y --name $FERMIPY_CONDA_ENV -c conda-forge/label/cf201901 -c fermi -c conda-forge fermitools=1.2.23"

# Python 3.6, no Fermi ST, all other dependencies
# Python 3.7, no Fermi ST, all other dependencies
- os: linux
env: NAME=py36_st-no_dep-yes
PYTHON_VERSION=3.6
ST_INSTALL=''
DOCKER_INSTALL=''
python : 3.7
dist : xenial
env: NAME=py37_st-no_dep-yes
PYTHON_VERSION=3.7
ST_INSTALL='echo'
CONDA2_DEPS='pytest'
CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh

# Python 2, no Fermi ST, all other dependencies
- os: linux
env: NAME=py2_st-no_dep-yes
PYTHON_VERSION=2.7
ST_INSTALL=''
DOCKER_INSTALL=''
CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
ST_INSTALL='echo'
CONDA_DEPS='gammapy=0.10 healpy=1.13.0 numpy astropy scipy matplotlib pyyaml fermipy'
CONDA_DOWNLOAD=Miniconda2-latest-Linux-x86_64.sh

allow_failures:
# The Sphinx docs build
# Python 3, no Fermi ST, all other dependencies
- os: linux
python : 3.7
env: NAME=docs
PYTHON_VERSION=3.7
ST_INSTALL='echo'
PIP_DEPS='coverage pytest-cov coveralls'
CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
CONDA2_DEPS='pytest sphinx sphinx_rtd_theme'


# # Python 3, no Fermi ST, only the required dependencies
# # TODO: This isn't working yet, need to handle imports for opt deps more carefully
# - os: linux
# env: PYTHON_VERSION=3.5
# ST_INSTALL=''
# CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
# CONDA_DEPS=''
# CONDA2=''

#before_install:
# - cat Dockerfile
Expand All @@ -85,27 +84,16 @@ matrix:
# Setup anaconda and install packages
install:
# Download and install the ST binaries
- if [[ $DOCKER_INSTALL == '' ]]; then
$ST_INSTALL;
source condainstall.sh;
else
$DOCKER_INSTALL;
docker exec fermipy-testing /bin/bash --login -c "cd /home/fermipy && python setup.py install";
fi
- $ST_INSTALL;
source condainstall.sh;

# Run test
script:
- if [[ $DOCKER_INSTALL == '' ]]; then
bash travistests.sh;
else
docker exec fermipy-testing /bin/bash --login -c "cd /home/fermipy;/bin/bash /home/fermipy/travistests.sh";
fi
- bash travistests.sh;

after_success:
- if [[ $NAME == 'main' ]]; then
coveralls --rcfile='fermipy/tests/coveragerc';
elif [[ $SLAC_ST_BUILD == 'true' ]]; then
docker exec fermipy-testing /bin/bash --login -c "cd /home/fermipy;source condasetup.sh;coveralls --rcfile='fermipy/tests/coveragerc'";
fi

#after_script:
Expand Down
4 changes: 4 additions & 0 deletions dmpipe/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def _map_arguments(self, args):
seed = sim_values.get('seed', 0)
nsims = sim_values.get('nsims', 20)
nsims_job = sim_values.get('nsims_job', 0)
non_null_src = sim_values.get('non_null_src', False)
do_find_src = sim_values.get('do_find_src', False)

sim_plotting = config_dict.get('sim_plotting')
plot_channels_default = config_dict.get('plot_channels', [])
Expand All @@ -273,6 +275,8 @@ def _map_arguments(self, args):
targetlist=targetlist,
config=config_localpath,
seed=seed, nsims=nsims,
non_null_src=non_null_src,
do_find_src=do_find_src,
nsims_job=nsims_job)
self._set_link('convert-castro',
ConvertCastro_SG,
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
'dmpipe-calc-sed-limits = dmpipe.scripts.calc_sed_limits:main',
]},
install_requires=[
'numpy >= 1.6.1',
'pyyaml >= 3.12',
'astropy >= 1.2.1',
'matplotlib >= 1.5.0',
'scipy >= 0.14',
'fermipy >= 0.17.3',
'numpy',
'pyyaml',
'astropy',
'matplotlib',
'scipy',
'fermipy',
'healpy',
'dmsky >= 0.2.3'
'dmsky'
],
extras_require=dict(
all=[],
Expand Down

0 comments on commit 515f943

Please sign in to comment.