Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ jobs:
name: install Debian dependencies
command: |
sudo apt-get update
sudo apt-get install gfortran libblas3 liblapack3 cmake
sudo apt-get install gfortran libopenblas-dev liblapack-dev cmake

- run:
name: setup Python venv
command: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip

- run:
name: PolyChord install
command: |
. venv/bin/activate
git clone https://github.com/PolyChord/PolyChordLite PolyChord
cd PolyChord
make MPI= pypolychord
pip install numpy
python setup.py install
pip install numpy scipy
pip install . --global-option="--no-mpi"
cd ..

- run:
Expand Down Expand Up @@ -66,12 +67,6 @@ jobs:
. venv/bin/activate
flake8 pybambi tests

- run:
name: sphinx-build
command: |
. venv/bin/activate
sphinx-build docs/source docs/build -nW

- run:
name: pydocstyle
command: |
Expand Down
38 changes: 20 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# linux matrix
#language: python
#os: linux
#python:
# - "3.7"
# - "3.6"
# - "3.5"
#env:
# - MPI=
# - MPI=1
language: python
os: linux
python:
- "3.8"
- "3.7"
- "3.6"
env:
- MPI=0
- MPI=1

# OSX matrix
matrix:
include:
- os: osx
language: sh
env: TOXENV=py3 MPI=
env: TOXENV=py3 MPI=0

# System packages
addons:
Expand All @@ -38,19 +38,21 @@ before_install:
pip3 install virtualenv;
virtualenv -p python3 ~/venv;
source ~/venv/bin/activate;
pip install --upgrade pip;
pip install --upgrade "https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.1.0-cp37-cp37m-macosx_10_9_x86_64.whl";
fi

- pip install --upgrade pip

# PolyChord install
- pip install numpy
- git clone https://github.com/PolyChord/PolyChordLite PolyChord
- cd PolyChord
- make MPI=$MPI pypolychord
- if [ "$MPI" ]; then
CC=mpicc CXX=mpicxx python setup.py install;
- if [ "$MPI" -eq 1 ]; then
pip install . ;
else
python setup.py install;
fi
pip install . --global-option="--no-mpi";
fi;
- cd ..

# MultiNest install
Expand All @@ -59,7 +61,7 @@ before_install:
- mkdir -p MultiNest/build
- cd MultiNest/build
- cmake ..
- if [ "$MPI" ]; then
- if [ "$MPI" -eq 1 ]; then
make multinest_mpi_shared;
else
make multinest_shared;
Expand All @@ -79,7 +81,7 @@ install:
- pip install -r requirements.txt
- pip install pytest-cov codecov
- pip install flake8 pydocstyle sphinx sphinx_rtd_theme
- if [ "$MPI" ]; then pip install mpi4py; fi
- if [ "$MPI" -eq 1 ]; then pip install mpi4py; fi

before_script:
# Test for pep-compliance
Expand All @@ -93,7 +95,7 @@ before_script:

# Run tests
script:
- if [ "$MPI" ];
- if [ "$MPI" -eq 1 ];
then mpirun -np 2 python -m pytest tests;
else python -m pytest tests --cov=pybambi;
fi
Expand Down
4 changes: 2 additions & 2 deletions pybambi/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pybambi.neuralnetworks.kerasnet import KerasNetInterpolation
from pybambi.neuralnetworks.nearestneighbour \
import NearestNeighbourInterpolation
import keras.models
import tensorflow.keras.models


class BambiManager(object):
Expand Down Expand Up @@ -44,7 +44,7 @@ def make_learner(self, params, loglikes):
return KerasNetInterpolation(params, loglikes)
elif self._learner == 'nearestneighbour':
return NearestNeighbourInterpolation(params, loglikes)
elif issubclass(type(self._learner), keras.models.Model):
elif issubclass(type(self._learner), tensorflow.keras.models.Model):
return KerasNetInterpolation(params, loglikes, model=self._learner)
else:
raise NotImplementedError('learner %s is not implemented.'
Expand Down
6 changes: 3 additions & 3 deletions pybambi/neuralnetworks/kerasnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"""
import numpy
from pybambi.neuralnetworks.base import Predictor
from keras.models import Sequential
from keras.layers import Dense
from keras.callbacks import EarlyStopping
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.callbacks import EarlyStopping


class KerasNetInterpolation(Predictor):
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
tensorflow
keras
numpy