-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add travis-ci/appveyor builds & various docs and tests updates
- Loading branch information
Showing
115 changed files
with
25,253 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,3 +113,6 @@ test-reports/ | |
|
||
# vscode | ||
.vscode/ | ||
|
||
# docs | ||
docs/doctrees/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#------------------------------------------------------------------------------- | ||
# System specifications for Travis CI | ||
#------------------------------------------------------------------------------- | ||
language: c | ||
os: | ||
- linux | ||
- osx | ||
env: | ||
# - PYTHON_VERSION="3.5" | ||
# geopandas has conflicts with python 3.5 | ||
- PYTHON_VERSION="3.6" | ||
# - PYTHON_VERSION="3.7" | ||
# datacube has dependency that is not available on python 3.7 | ||
notifications: | ||
email: false | ||
|
||
before_install: | ||
# Install minconda | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
wget -O miniconda.sh http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh; | ||
export CONDA_COMPILER="gxx_linux-64"; | ||
fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then | ||
curl -o miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh; | ||
export CONDA_COMPILER="clangxx_osx-64"; | ||
fi | ||
- bash miniconda.sh -b -p $HOME/miniconda | ||
- source $HOME/miniconda/etc/profile.d/conda.sh | ||
- conda activate | ||
- conda config --set always_yes True | ||
- conda update conda python | ||
- conda config --add channels conda-forge | ||
- conda config --add channels conda-forge | ||
# Create conda environment for geocube | ||
- conda create -n test python=$PYTHON_VERSION $CONDA_COMPILER datacube=1.6.* gdal=2.4.* geopandas libgdal=2.4.* rasterio=1.0.* scipy xarray | ||
- source activate test | ||
|
||
install: | ||
- pip install .[all] | ||
- pip install coveralls | ||
|
||
script: | ||
- py.test --cov-report term-missing --cov=geocube | ||
- make check | ||
|
||
after_success: | ||
# Coveralls stats for code coverage | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#------------------------------------------------------------------------------- | ||
#System specifications for Appveyor | ||
#------------------------------------------------------------------------------- | ||
|
||
environment: | ||
matrix: | ||
- PYTHON_VERSION: "3.6" | ||
MINICONDA: "C:\\Miniconda3-x64" | ||
|
||
install: | ||
- 'SET PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%' | ||
- conda config --set always_yes yes | ||
- conda config --add channels conda-forge | ||
- conda config --add channels conda-forge | ||
- conda update -q conda python | ||
|
||
#----------------------------------------------------------------------------- | ||
# Create conda environment for geocube | ||
#----------------------------------------------------------------------------- | ||
- conda create -n test python=%PYTHON_VERSION% datacube=1.6.* gdal=2.3.* geopandas libgdal=2.3.* rasterio=1.0.* scipy xarray | ||
- activate test | ||
|
||
#------------------------------------------------------------------------------- | ||
# Install geocube | ||
#------------------------------------------------------------------------------- | ||
- pip install -e .[all] | ||
|
||
build: false | ||
|
||
test_script: | ||
- pytest --cov-report term-missing --cov=geocube | ||
- flake8 --ignore=E731,W503,W504 --exclude --max-complexity 10 --max-line-length 88 geocube/ | ||
- flake8 --max-line-length 88 tests/unit/ tests/functional/ tests/integration | ||
- black --check . |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 2b1479816aaf3e0a31cd832ce94f91e2 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=Edge" /> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>geocube.api.core — geocube 0.0.2 documentation</title> | ||
<link rel="stylesheet" href="../../../_static/nature.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> | ||
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script> | ||
<script type="text/javascript" src="../../../_static/jquery.js"></script> | ||
<script type="text/javascript" src="../../../_static/underscore.js"></script> | ||
<script type="text/javascript" src="../../../_static/doctools.js"></script> | ||
<script type="text/javascript" src="../../../_static/language_data.js"></script> | ||
<link rel="index" title="Index" href="../../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../../search.html" /> | ||
</head><body> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../../genindex.html" title="General Index" | ||
accesskey="I">index</a></li> | ||
<li class="right" > | ||
<a href="../../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../../../index.html">geocube 0.0.2 documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body" role="main"> | ||
|
||
<h1>Source code for geocube.api.core</h1><div class="highlight"><pre> | ||
<span></span><span class="c1"># -- coding: utf-8 --</span> | ||
<span class="sd">"""</span> | ||
<span class="sd">GeoCube client core functionality</span> | ||
<span class="sd">"""</span> | ||
<span class="kn">from</span> <span class="nn">geocube.geo_utils.geobox</span> <span class="k">import</span> <span class="n">GeoBoxMaker</span> | ||
<span class="kn">from</span> <span class="nn">geocube.vector_to_cube</span> <span class="k">import</span> <span class="n">VectorToCube</span> | ||
|
||
|
||
<div class="viewcode-block" id="make_geocube"><a class="viewcode-back" href="../../../geocube.api.html#geocube.api.core.make_geocube">[docs]</a><span class="k">def</span> <span class="nf">make_geocube</span><span class="p">(</span> | ||
<span class="n">vector_data</span><span class="p">,</span> <span class="c1"># pylint: disable=too-many-arguments</span> | ||
<span class="n">measurements</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">datetime_measurements</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">output_crs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">resolution</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">align</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">geom</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">like</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">fill</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">group_by</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">interpolate_na_method</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="n">categorical_enums</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> | ||
<span class="p">):</span> <span class="c1"># NOSONAR</span> | ||
<span class="sd">"""</span> | ||
<span class="sd"> Rasterize vector data into an ``xarray`` object. Each attribute will be a data</span> | ||
<span class="sd"> variable in the :class:`xarray.Dataset`.</span> | ||
|
||
<span class="sd"> Parameters</span> | ||
<span class="sd"> ----------</span> | ||
<span class="sd"> vector_data: str or :obj:`geopandas.GeoDataFrame`</span> | ||
<span class="sd"> A file path to an OGR supported source or GeoDataFrame containing</span> | ||
<span class="sd"> the vector data.</span> | ||
<span class="sd"> measurements: list(str), optional</span> | ||
<span class="sd"> Attributes name or list of names to be included. If a list is specified,</span> | ||
<span class="sd"> the attributes will be returned in the order requested.</span> | ||
<span class="sd"> By default all available attributes are included.</span> | ||
<span class="sd"> datetime_measurements: list(str), optional</span> | ||
<span class="sd"> Attributes that are temporal in nature and should be converted to the datetime</span> | ||
<span class="sd"> format. These are only included if listed in 'measurements'.</span> | ||
<span class="sd"> output_crs: str, optional</span> | ||
<span class="sd"> The CRS of the returned data. If no CRS is supplied, the CRS of the</span> | ||
<span class="sd"> stored data is used.</span> | ||
<span class="sd"> resolution: (float,float), optional</span> | ||
<span class="sd"> A tuple of the spatial resolution of the returned data.</span> | ||
<span class="sd"> This includes the direction (as indicated by a positive or negative number).</span> | ||
<span class="sd"> Typically when using most CRSs, the first number would be negative.</span> | ||
<span class="sd"> align: (float,float), optional</span> | ||
<span class="sd"> Load data such that point 'align' lies on the pixel boundary.</span> | ||
<span class="sd"> Units are in the co-ordinate space of the output CRS.</span> | ||
<span class="sd"> Default is (0,0)</span> | ||
<span class="sd"> geom: str, optional</span> | ||
<span class="sd"> A GeoJSON string for the bounding box of the data used to construct the</span> | ||
<span class="sd"> grid.</span> | ||
<span class="sd"> like: :obj:`xarray.Dataset`, optional</span> | ||
<span class="sd"> Uses the output of a previous ``load()`` to form the basis of a request</span> | ||
<span class="sd"> for another product.</span> | ||
<span class="sd"> E.g.::</span> | ||
|
||
<span class="sd"> gcds = make_geocube(vector_data='my_vector.geopackage', like=other_gcds)</span> | ||
|
||
<span class="sd"> fill: float, optional</span> | ||
<span class="sd"> The value to fill in the grid with for nodata. Default is -9999.0.</span> | ||
<span class="sd"> group_by: str, optional</span> | ||
<span class="sd"> When specified, perform basic combining/reducing of the data on this column.</span> | ||
<span class="sd"> interpolate_na_method: {‘linear’, ‘nearest’, ‘cubic’}, optional</span> | ||
<span class="sd"> This is the method for interpolation to use to fill in the nodata with</span> | ||
<span class="sd"> :meth:`scipy.interpolate.griddata`.</span> | ||
<span class="sd"> categorical_enums: dict, optional</span> | ||
<span class="sd"> A dictionary of all categories for the table columns containing categorical</span> | ||
<span class="sd"> data.</span> | ||
<span class="sd"> E.g. {'column_name': ['a', 'b'], 'other_column': ['c', 'd']}</span> | ||
|
||
<span class="sd"> Returns</span> | ||
<span class="sd"> --------</span> | ||
<span class="sd"> :obj:`xarray.Dataset`:</span> | ||
<span class="sd"> Requested data in a :obj:`xarray.Dataset`.</span> | ||
|
||
<span class="sd"> """</span> | ||
<span class="n">geobox_maker</span> <span class="o">=</span> <span class="n">GeoBoxMaker</span><span class="p">(</span><span class="n">output_crs</span><span class="p">,</span> <span class="n">resolution</span><span class="p">,</span> <span class="n">align</span><span class="p">,</span> <span class="n">geom</span><span class="p">,</span> <span class="n">like</span><span class="p">)</span> | ||
|
||
<span class="k">return</span> <span class="n">VectorToCube</span><span class="p">(</span> | ||
<span class="n">vector_data</span><span class="o">=</span><span class="n">vector_data</span><span class="p">,</span> | ||
<span class="n">geobox_maker</span><span class="o">=</span><span class="n">geobox_maker</span><span class="p">,</span> | ||
<span class="n">fill</span><span class="o">=</span><span class="n">fill</span><span class="p">,</span> | ||
<span class="n">categorical_enums</span><span class="o">=</span><span class="n">categorical_enums</span><span class="p">,</span> | ||
<span class="p">)</span><span class="o">.</span><span class="n">make_geocube</span><span class="p">(</span> | ||
<span class="n">measurements</span><span class="o">=</span><span class="n">measurements</span><span class="p">,</span> | ||
<span class="n">datetime_measurements</span><span class="o">=</span><span class="n">datetime_measurements</span><span class="p">,</span> | ||
<span class="n">group_by</span><span class="o">=</span><span class="n">group_by</span><span class="p">,</span> | ||
<span class="n">interpolate_na_method</span><span class="o">=</span><span class="n">interpolate_na_method</span><span class="p">,</span> | ||
<span class="p">)</span></div> | ||
</pre></div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
<div class="sphinxsidebarwrapper"> | ||
<div id="searchbox" style="display: none" role="search"> | ||
<h3>Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../../../search.html" method="get"> | ||
<input type="text" name="q" /> | ||
<input type="submit" value="Go" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
</div> | ||
<script type="text/javascript">$('#searchbox').show(0);</script> | ||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../../genindex.html" title="General Index" | ||
>index</a></li> | ||
<li class="right" > | ||
<a href="../../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../../../index.html">geocube 0.0.2 documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li> | ||
</ul> | ||
</div> | ||
<div class="footer" role="contentinfo"> | ||
© Copyright 2019, Geocube Contributors. | ||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5. | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.