Skip to content

Commit

Permalink
Merge branch 'master' into sed-flux-dep
Browse files Browse the repository at this point in the history
HUGE code update. Tests pass. The sed_flux_dep eroder is 100% ported
from the 2016 master, so may be troublesome with existing drivers from
2014.

# Conflicts:
#	.gitignore
#	landlab/components/stream_power/examples/drive_sp_params_storms.txt
#	landlab/components/stream_power/examples/perturb_sed_flux_dep.py
#	landlab/components/stream_power/examples/perturb_sp_driver.py
#	landlab/components/stream_power/examples/perturb_sp_storms.py
#	landlab/components/stream_power/examples/simple_sp_driver.py
#	landlab/components/stream_power/examples/test_sed_flux_dep.py
#	landlab/components/stream_power/sed_flux_dep_incision.py
#
landlab/components/transport_limited_fluvial/tl_fluvial_monodirectional_
v3.py
#	landlab/plot/channel_profile.py
  • Loading branch information
SiccarPoint committed Mar 25, 2016
1 parent 30d63cf commit 22ff8f5
Show file tree
Hide file tree
Showing 557 changed files with 65,556 additions and 20,871 deletions.
12 changes: 12 additions & 0 deletions .ci/appveyor/deploy_to_pypi.ps1
@@ -0,0 +1,12 @@
if (($env:appveyor_repo_tag -eq "true") -and ($env:appveyor_repo_tag_name.StartsWith("v"))) {
write-output "Deploying to PyPI..."
Invoke-Expression "twine upload -u mcflugen -p $env:PYPI_PASS dist/*"
write-output "OK"
} else {
write-output "Not deploying."
write-output "Is a tagged commit... $env:appveyor_repo_tag"
if (($env:appveyor_repo_tag -eq "true")) {
write-output "Tag name... $env:appveyor_repo_tag_name"
}
write-output "Branch name... $env:appveyor_repo_branch"
}
71 changes: 71 additions & 0 deletions .ci/appveyor/install-miniconda.ps1
@@ -0,0 +1,71 @@
# Sample script to install anaconda under windows
# Authors: Stuart Mumford
# Borrwed from: Olivier Grisel and Kyle Kastner
# License: BSD 3 clause

$MINICONDA_URL = "http://repo.continuum.io/miniconda/"

function DownloadMiniconda ($version, $platform_suffix) {
$webclient = New-Object System.Net.WebClient
$filename = "Miniconda-" + $version + "-Windows-" + $platform_suffix + ".exe"

$url = $MINICONDA_URL + $filename

$basedir = $pwd.Path + "\"
$filepath = $basedir + $filename
if (Test-Path $filename) {
Write-Host "Reusing" $filepath
return $filepath
}

# Download and retry up to 3 times in case of network transient errors.
Write-Host "Downloading" $filename "from" $url
$retry_attempts = 2
for($i=0; $i -lt $retry_attempts; $i++){
try {
$webclient.DownloadFile($url, $filepath)
break
}
Catch [Exception]{
Start-Sleep 1
}
}
if (Test-Path $filepath) {
Write-Host "File saved at" $filepath
} else {
# Retry once to get the error message if any at the last try
$webclient.DownloadFile($url, $filepath)
}
return $filepath
}

function InstallMiniconda ($python_version, $architecture, $python_home) {
Write-Host "Installing miniconda" $python_version "for" $architecture "bit architecture to" $python_home
if (Test-Path $python_home) {
Write-Host $python_home "already exists, skipping."
return $false
}
if ($architecture -eq "x86") {
$platform_suffix = "x86"
} else {
$platform_suffix = "x86_64"
}
$filepath = DownloadMiniconda $python_version $platform_suffix
Write-Host "Installing" $filepath "to" $python_home
$args = "/InstallationType=AllUsers /S /AddToPath=1 /RegisterPython=1 /D=" + $python_home
Write-Host $filepath $args
Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru
#Start-Sleep -s 15
if (Test-Path C:\conda) {
Write-Host "Miniconda $python_version ($architecture) installation complete"
} else {
Write-Host "Failed to install Python in $python_home"
Exit 1
}
}

function main () {
InstallMiniconda $env:MINICONDA_VERSION $env:PLATFORM $env:PYTHON
}

main
97 changes: 97 additions & 0 deletions .ci/appveyor/install.ps1
@@ -0,0 +1,97 @@
# Sample script to install Miniconda under Windows
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner, Robert McGibbon
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/

$MINICONDA_URL = "http://repo.continuum.io/miniconda/"


function DownloadMiniconda ($python_version, $platform_suffix) {
$webclient = New-Object System.Net.WebClient
if ($python_version -match "3.4") {
$filename = "Miniconda3-3.5.5-Windows-" + $platform_suffix + ".exe"
} else {
$filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe"
}
$url = $MINICONDA_URL + $filename

$basedir = $pwd.Path + "\"
$filepath = $basedir + $filename
if (Test-Path $filename) {
Write-Host "Reusing" $filepath
return $filepath
}

# Download and retry up to 3 times in case of network transient errors.
Write-Host "Downloading" $filename "from" $url
$retry_attempts = 2
for($i=0; $i -lt $retry_attempts; $i++){
try {
$webclient.DownloadFile($url, $filepath)
break
}
Catch [Exception]{
Start-Sleep 1
}
}
if (Test-Path $filepath) {
Write-Host "File saved at" $filepath
} else {
# Retry once to get the error message if any at the last try
$webclient.DownloadFile($url, $filepath)
}
return $filepath
}


function InstallMiniconda ($python_version, $architecture, $python_home) {
Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
if (Test-Path $python_home) {
Write-Host $python_home "already exists, skipping."
return $false
}
if ($architecture -match "32") {
$platform_suffix = "x86"
} else {
$platform_suffix = "x86_64"
}

$filepath = DownloadMiniconda $python_version $platform_suffix
Write-Host "Installing" $filepath "to" $python_home
$install_log = $python_home + ".log"
$args = "/S /D=$python_home"
Write-Host $filepath $args
Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru
if (Test-Path $python_home) {
Write-Host "Python $python_version ($architecture) installation complete"
} else {
Write-Host "Failed to install Python in $python_home"
Get-Content -Path $install_log
Exit 1
}
}


function InstallCondaPackages ($python_home, $spec) {
$conda_path = $python_home + "\Scripts\conda.exe"
$args = "install --yes " + $spec
Write-Host ("conda " + $args)
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
}

function UpdateConda ($python_home) {
$conda_path = $python_home + "\Scripts\conda.exe"
Write-Host "Updating conda..."
$args = "update --yes conda"
Write-Host $conda_path $args
Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru
}


function main () {
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
UpdateConda $env:PYTHON
InstallCondaPackages $env:PYTHON "conda-build=1.4.0 pip jinja2 binstar"
InstallCondaPackages $env:PYTHON "conda-build=1.4.0 scipy>=0.12 numpy nose>=1.3 matplotlib netCDF4 sympy pandas cython>=0.22 wheel"
}

main
36 changes: 36 additions & 0 deletions .ci/appveyor/run_with_env.cmd
@@ -0,0 +1,36 @@
@echo off
:: To build extensions for 64 bit Python 3, we need to configure environment
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
:: MS Windows SDK for Windows 7 and .NET Framework 4
::
:: More details at:
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
::
SET COMMAND_TO_RUN=%*
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
SET WINDOWS_SDK_VERSION="v7.0"
IF %MAJOR_PYTHON_VERSION%=="3" (
SET WINDOWS_SDK_VERSION="v7.1"
)
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION%

IF "%DISTUTILS_USE_SDK%"=="1" (

IF "%PLATFORM%"=="x64" (
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
SET MSSdk=1
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || EXIT 1
) ELSE (
ECHO Using default MSVC build environment for 32 bit architecture
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || EXIT 1
)
) ELSE (
ECHO Using default MSVC build environment
ECHO Executing: %COMMAND_TO_RUN%
call %COMMAND_TO_RUN% || EXIT 1
)
File renamed without changes.
18 changes: 18 additions & 0 deletions .ci/travis/deploy_to_pypi.sh
@@ -0,0 +1,18 @@
if [[ "$TRAVIS_TAG" == v* && "$TRAVIS_BRANCH" == "release" ]]; then
echo "Installing deployment requirements."
pip install twine wheel
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
echo "Creating a source distribution."
python setup.py sdist
else
echo "Creating a binary wheel distribution."
python setup.py bdist_wheel
fi
echo "Uploading to PyPI."
twine upload -u mcflugen -p$PYPI_PASS dist/*
echo "Done."
else
echo "Not deploying."
echo "Tag is... $TRAVIS_TAG"
echo "Branch name is... $TRAVIS_BRANCH"
fi
7 changes: 3 additions & 4 deletions .travis/install_python.sh → .ci/travis/install_python.sh
Expand Up @@ -5,17 +5,16 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
else
OS="Linux-x86_64";
fi
sudo apt-get update 2> /dev/null || echo "No apt-get"
if [[ "$TRAVIS_PYTHON_VERSION" == 2.* ]]; then
wget http://repo.continuum.io/miniconda/Miniconda-3.4.2-$OS.sh -O miniconda.sh;
wget http://repo.continuum.io/miniconda/Miniconda-latest-$OS.sh -O miniconda.sh;
else
wget http://repo.continuum.io/miniconda/Miniconda3-3.4.2-$OS.sh -O miniconda.sh;
wget http://repo.continuum.io/miniconda/Miniconda3-latest-$OS.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 update conda
# conda update conda
conda info -a
cat requirements.txt | grep -v numpydoc | xargs conda create -n test-env python=$TRAVIS_PYTHON_VERSION
source activate test-env
Expand Down
15 changes: 15 additions & 0 deletions .ci/travis/run_travis_test.sh
@@ -0,0 +1,15 @@
#! /bin/bash

PYTHON=${PYTHON:-python}

run_test()
{
mkdir -p _test
cd _test

INSTALLDIR=$($PYTHON -c "import os; import landlab; print(os.path.dirname(landlab.__file__))")

coverage run --source=$INSTALLDIR ../scripts/test-installed-landlab.py && (coverage report && cp .coverage ..)
}

run_test
8 changes: 8 additions & 0 deletions .codeclimate.yml
@@ -0,0 +1,8 @@
languages:
Python: true
exclude_paths:
- "docs/*"
- "scripts/*"
- "landlab/components/**/*"
- "landlab/examples/*"
- "landlab/**/test_*.py"
16 changes: 15 additions & 1 deletion .gitignore
Expand Up @@ -58,11 +58,25 @@ docs/_build/
*.swp
*.swo

landlab/test.pdf
test-results.xml

*.gif

*.p

*.pdf
!docs/**/*.pdf

*.png
!docs/**/*.png

*.aux

*.synctex.gz

installfiles.txt

# Ignore all .c files as, currently, they are all cython generated.
*.c

landlab/io/mysave.grid
7 changes: 7 additions & 0 deletions .landscape.yaml
@@ -0,0 +1,7 @@
ignore-patterns:
- ez_setup.py
- setup.py
ignore-paths:
- docs
strictness: veryhigh
doc-warnings: True
70 changes: 45 additions & 25 deletions .travis.yml
@@ -1,30 +1,50 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
env:
matrix:
- TRAVIS_PYTHON_VERSION="2.6" NUMPY_VERSION="1.9"
- TRAVIS_PYTHON_VERSION="2.7" NUMPY_VERSION="1.9"
- TRAVIS_PYTHON_VERSION="2.7" NUMPY_VERSION="1.10"
- TRAVIS_PYTHON_VERSION="3.3" NUMPY_VERSION="1.9"
- TRAVIS_PYTHON_VERSION="3.4" NUMPY_VERSION="1.9"
- TRAVIS_PYTHON_VERSION="3.4" NUMPY_VERSION="1.10"
- TRAVIS_PYTHON_VERSION="3.5" NUMPY_VERSION="1.9"
- TRAVIS_PYTHON_VERSION="3.5" NUMPY_VERSION="1.10"
global:
secure: UxPkdFKl0xtk+H+98CNHSnYN8SJrEq5xJjLtPUPR+5UF5lLKL7godwrOdYeO0B0fXPi2Plw0vtoIID6H1AV4x+8QD/AgAizoWIh8KLim3E7rDX0v0M3WnUHctvYwt76mGCYvIGH6qR2Ziml37Ec6nz2aTuz0oex27P6dq0BKkXs=
os:
- linux
- osx

- linux
- osx
matrix:
allow_failures:
- os: osx
env: TRAVIS_PYTHON_VERSION="2.6" NUMPY_VERSION="1.9"
sudo: false
install:
- echo "Build on $TRAVIS_OS_NAME for Python $TRAVIS_PYTHON_VERSION"
- bash .travis/install_python.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- source activate test-env
- pip install coveralls
- if [[ "$TRAVIS_PYTHON_VERSION" == 3.* ]]; then
bash .travis/convert_to_python_3.sh;
fi
- python setup.py install

script:
- (cd docs && make html)
- nosetests --with-coverage --cover-package=landlab

- echo "Build on $TRAVIS_OS_NAME for Python $TRAVIS_PYTHON_VERSION"
- bash .ci/travis/install_python.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- source activate test-env
- pip install coveralls
- conda install numpy=$NUMPY_VERSION
- conda install scipy
- python setup.py install
script:
- if [[ "$TRAVIS_PYTHON_VERSION" == 2.7 ]]; then (cd docs && make html 2> /dev/null); fi
- bash .ci/travis/run_travis_test.sh
virtualenv:
system_site_packages: false

after_success:
coveralls
- bash .ci/travis/deploy_to_pypi.sh
- coveralls
deploy:
provider: pypi
user: mcflugen
password:
secure: V15DceMv4DUmjgxToaxrP3KaQxsLbfrTkB1s6D8YNQZvYJiVvNlBpC1nF8yWbOt3IWJQSGjaQEnObd2ZhHe2Kq/H+QsEFyBKlYF7SNp35FyS5zLuf2qhnNhmzhqkspwBpiGe88c1PQPFzfqdIUQXp7ZAv6L8YRvNy2sbzvgxh6I=
on:
tags: true
branch: release
repo: landlab/landlab
distributions: sdist bdist_wheel
notifications:
slack:
secure: gRKbqjPgp0ZcFtecHOwjLAFbzzBr2zyFrxk7OAS/cea/9U8bLQNA0jZs3ZHtAgR53gdnFlx/GI10d/KD9XMKU55gQkO4FSvfYMK7Xzs2tfnEa5flTqQKRfjB1oJ2fmb81yshUe+xKsXBoedP7SPYv2mutMOY8srKwUcuE0yGmAw=

0 comments on commit 22ff8f5

Please sign in to comment.