Skip to content

Commit

Permalink
Merge 4d7c85a into 5ec600a
Browse files Browse the repository at this point in the history
  • Loading branch information
alexamici committed Feb 25, 2019
2 parents 5ec600a + 4d7c85a commit 575ee8e
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 97 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Expand Up @@ -6,12 +6,11 @@ matrix:
fast_finish: true
include:
- env: ENV=py36-qc
- env: ENV=py36-without-xarray
- env: ENV=py36-old
- env: ENV=py27
- env: ENV=docs
- env: ENV=py36-old
- env: ENV=py36-without-xarray
- env: ENV=py37
# - env: ENV=py35

before_install:
- wget http://repo.continuum.io/miniconda/Miniconda3-3.16.0-Linux-x86_64.sh -O miniconda.sh;
Expand Down
60 changes: 28 additions & 32 deletions README.rst
Expand Up @@ -307,10 +307,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ...
>>> xr.open_dataset('nam.t00z.awp21100.tm00.grib2', engine='cfgrib',
... backend_kwargs={'filter_by_keys': {'typeOfLevel': 'heightAboveGround', 'level': 2}})
Expand All @@ -330,10 +330,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ...


Expand Down Expand Up @@ -366,10 +366,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -396,10 +396,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (isobaricInhPa: 19, x: 93, y: 65)
Coordinates:
Expand All @@ -416,14 +416,13 @@ Data variables:
r (isobaricInhPa, y, x) float32 ...
w (isobaricInhPa, y, x) float32 ...
u (isobaricInhPa, y, x) float32 ...
v (isobaricInhPa, y, x) float32 ...
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -438,14 +437,13 @@ Data variables:
t2m (y, x) float32 ...
r2 (y, x) float32 ...
u10 (y, x) float32 ...
v10 (y, x) float32 ...
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -461,10 +459,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -481,10 +479,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -502,10 +500,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (heightAboveGroundLayer: 2, x: 93, y: 65)
Coordinates:
Expand All @@ -521,10 +519,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -542,10 +540,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -560,14 +558,13 @@ Data variables:
pres (y, x) float32 ...
gh (y, x) float32 ...
u (y, x) float32 ...
v (y, x) float32 ...
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (x: 93, y: 65)
Coordinates:
Expand All @@ -584,10 +581,10 @@ Data variables:
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ..., <xarray.Dataset>
Dimensions: (pressureFromGroundLayer: 5, x: 93, y: 65)
Coordinates:
Expand All @@ -602,16 +599,15 @@ Data variables:
t (pressureFromGroundLayer, y, x) float32 ...
r (pressureFromGroundLayer, y, x) float32 ...
u (pressureFromGroundLayer, y, x) float32 ...
v (pressureFromGroundLayer, y, x) float32 ...
pli (y, x) float32 ...
4lftx (y, x) float32 ...
Attributes:
GRIB_edition: 2
GRIB_centre: kwbc
GRIB_centreDescription: US National Weather Service - NCEP...
GRIB_centreDescription: US National Weather Service - NCEP
GRIB_subCentre: 0
Conventions: CF-1.7
institution: US National Weather Service - NCEP...
institution: US National Weather Service - NCEP
history: ...]


Expand Down
37 changes: 37 additions & 0 deletions appveyor.yml
@@ -0,0 +1,37 @@
# CI on Windows via appveyor
# This file was based on Olivier Grisel's python-appveyor-demo
branches:
except:
- fix-docs

environment:

matrix:
- PYTHON: "C:\\Python36-conda64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
CONDA_ENV: "py36-qc"
- PYTHON: "C:\\Python37-conda64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
CONDA_ENV: "py37"

install:
# Install miniconda Python
- "powershell ./ci/install_python.ps1"

# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"

# install xarray and dependencies
- "conda env create --file ./ci/requirements-%CONDA_ENV%.yml"
- "activate test_env"
- "conda list"
- "python setup.py install"

build: false

test_script:
- "py.test --verbose"
97 changes: 97 additions & 0 deletions ci/install_python.ps1
@@ -0,0 +1,97 @@
# Sample script to install Python and pip under Windows
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/

$MINICONDA_URL = "https://repo.anaconda.com/miniconda/"
$BASE_URL = "https://www.python.org/ftp/python/"


function DownloadMiniconda ($python_version, $platform_suffix) {
$webclient = New-Object System.Net.WebClient
if ($python_version -match "2.7") {
$filename = "Miniconda2-latest-Windows-" + $platform_suffix + ".exe"
} else {
$filename = "Miniconda3-latest-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 jinja2 anaconda-client"
}

main
14 changes: 7 additions & 7 deletions ci/requirements-docs.yml
Expand Up @@ -2,12 +2,12 @@ name: test_env
channels:
- conda-forge
dependencies:
- python=3.6
- attrs
- cffi
- eccodes
- future
- nomkl
- python=3.6
- sphinx
- xarray
- eccodes
- cffi
- pip:
- future
- attrs
- sphinx

12 changes: 6 additions & 6 deletions ci/requirements-py27.yml
Expand Up @@ -2,21 +2,21 @@ name: test_env
channels:
- conda-forge
dependencies:
- attrs
- cffi
- click
- coveralls
- dask
- eccodes
- future
- nomkl
- numpy
- pytest
- pytest-cov
- pytest-flakes
- python=2.7
- scipy
- typing
- toolz
- xarray
- pip:
- attrs
- coveralls
- future
- pytest-cov
- pytest-flakes

0 comments on commit 575ee8e

Please sign in to comment.