Skip to content

Commit

Permalink
Merge pull request #104 from willu47/scaffold
Browse files Browse the repository at this point in the history
Replaced versioneer with PyScaffold
  • Loading branch information
willu47 committed Oct 9, 2016
2 parents 8856af6 + 795d0b5 commit 9075fc3
Show file tree
Hide file tree
Showing 42 changed files with 732 additions and 1,553 deletions.
2 changes: 0 additions & 2 deletions .checkignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
SALib/sample/directions.py
versioneer.py
SALib/_version.py
4 changes: 1 addition & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
[run]
branch = True
source = SALib
omit = */_version.py
omit = tests/*

[report]
omit = */tests/*

# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
Expand Down
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: pylBNeUbcFeKP3ZsJJuMlLJaWFkR2S4UP
49 changes: 38 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
*.egg-info
*.pyc
dist
model_input.txt
model_output.txt
y_rbf.txt
tests/*.txt
/build/
/dist/
# Temporary and binary files
*~
*.py[cod]
*.so
*.cfg
!setup.cfg
*.orig
*.log
.coveralls.yml
*.pot
__pycache__/*
.cache/*
.*.swp

# Project files
.ropeproject
.project
.pydevproject
.settings
.idea

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info

# Unittest and coverage
htmlcov/*
.coverage
./result_images/*
.tox
junit.xml
coverage.xml

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/api/*
docs/_build/*
cover/*
MANIFEST
51 changes: 20 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
# Travis config for SALib/SALib
sudo: false
language: python

python:
- "2.7"
- "3.3"

env:
# Workaround for image_comparison issue in v1.5.0 of matplotlib - fix matplotlib to 1.4.3
- DEPS="numpy scipy matplotlib=1.4.3"

virtualenv:
system_site_packages: true
services:
- postgresql
env:
matrix:
- DISTRIB="conda" PYTHON_VERSION="2.7" COVERAGE="true"
- DISTRIB="conda" PYTHON_VERSION="3.5" COVERAGE="false"
addons:
apt:
packages:
- git
- python-pip
install:
- sudo apt-get update
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget http://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"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda install -c conda conda-env
- conda update -q conda --no-deps
# Useful for debugging any issues with conda
- conda info -a

# Replace dep1 dep2 ... with your dependencies
- conda create -q -n testenv python=$TRAVIS_PYTHON_VERSION $DEPS pip
- source activate testenv
- python setup.py install
- pip install coveralls
- source tests/travis_install.sh
- pip install -r test-requirements.txt
script:
- coverage run --source=SALib --omit=SALib/_version.py setup.py test
- python setup.py test
after_success:
- coveralls
- if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi
cache:
- apt
notifications:
email: false
5 changes: 5 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
==========
Developers
==========

* Will Usher <william.usher@ouce.ox.ac.uk>
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=========
Changelog
=========

Version 0.1
===========

- Feature A added
- FIX: nasty bug #1729 fixed
- add your changes here!
11 changes: 5 additions & 6 deletions SALib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
__version__ = "0.1"
import pkg_resources

from ._version import get_versions


__version__ = get_versions()['version']
del get_versions
try:
__version__ = pkg_resources.get_distribution(__name__).version
except:
__version__ = 'unknown'
187 changes: 0 additions & 187 deletions SALib/_version.py

This file was deleted.

21 changes: 12 additions & 9 deletions SALib/analyze/morris.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def analyze(problem, X, Y,
"""Perform Morris Analysis on model outputs.
Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and 'mu_star_conf',
where each entry is a list of size D (the number of parameters) containing
where each entry is a list of size D (the number of eters) containing
the indices in the same order as the parameter file.
Parameters
----------
Arguments
---------
problem : dict
The problem definition
X : numpy.matrix
Expand Down Expand Up @@ -59,6 +59,7 @@ def analyze(problem, X, Y,
>>> Y = Ishigami.evaluate(X)
>>> Si = morris.analyze(problem, X, Y, conf_level=0.95,
>>> print_to_console=True, num_levels=4, grid_jump=2)
"""

# Assume that there are no groups
Expand Down Expand Up @@ -203,12 +204,14 @@ def get_decreased_values(op_vec, up, lo):
def compute_elementary_effects(model_inputs, model_outputs, trajectory_size, delta):
'''
Arguments:
- model_inputs - matrix of inputs to the model under analysis.
x-by-r where x is the number of variables and
r is the number of rows (a function of x and num_trajectories)
- model_outputs - an r-length vector of model outputs
- trajectory_size - a scalar indicating the number of rows in a
trajectory
----------
model_inputs : matrix of inputs to the model under analysis.
x-by-r where x is the number of variables and
r is the number of rows (a function of x and num_trajectories)
model_outputs
an r-length vector of model outputs
trajectory_size
a scalar indicating the number of rows in a trajectory
'''
num_vars = model_inputs.shape[1]
num_rows = model_inputs.shape[0]
Expand Down
Loading

0 comments on commit 9075fc3

Please sign in to comment.