Skip to content

Commit

Permalink
Merge pull request #52 from scottyhq/sat-stac-bump
Browse files Browse the repository at this point in the history
requirements bump, update and improve readme
  • Loading branch information
scottyhq authored Aug 21, 2020
2 parents 4f98ca8 + 08f703a commit f4e636d
Show file tree
Hide file tree
Showing 11 changed files with 662 additions and 179 deletions.
48 changes: 19 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
# Intake-stac
# Intake-STAC

![CI](https://github.com/pangeo-data/intake-stac/workflows/CI/badge.svg)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pangeo-data/intake-stac/master?filepath=examples?urlpath=lab)
[![PyPI version](https://badge.fury.io/py/intake-stac.svg)](https://badge.fury.io/py/intake-stac)
[![Documentation Status](https://readthedocs.org/projects/intake-stac/badge/?version=latest)](https://intake-stac.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/pangeo-data/intake-stac/branch/master/graph/badge.svg)](https://codecov.io/gh/pangeo-data/intake-stac)

This is an [intake](https://intake.readthedocs.io/en/latest) data source for [SpatioTemporal Asset Catalogs (STAC)](https://stacspec.org/). The STAC specification provides a common metadata specification, API, and catalog format to describe geospatial assets, so they can more easily indexed and discovered. A 'spatiotemporal asset' is any file that represents information about the earth captured in a certain space and time.
This is an [Intake](https://intake.readthedocs.io/en/latest) data source for [SpatioTemporal Asset Catalogs (STAC)](https://stacspec.org/). The STAC specification provides a common metadata specification, API, and catalog format to describe geospatial assets, so they can more easily indexed and discovered. A 'spatiotemporal asset' is any file that represents information about the earth captured in a certain space and time.

Two examples of STAC catalogs are:

- https://planet.stac.cloud/?t=catalogs
- https://landsat-stac.s3.amazonaws.com/catalog.json

[Radiant Earth](https://radiant.earth) keeps track of a more complete listing of STAC implementations [here](https://github.com/radiantearth/stac-spec/blob/master/implementations.md).

This project provides an opinionated way for users to load datasets from these catalogs into the scientific Python ecosystem. It uses the intake-xarray plugin and supports several file formats including GeoTIFF, netCDF, GRIB, and OpenDAP.
Intake-STAC provides an opinionated way for users to load Assets from STAC catalogs into the scientific Python ecosystem. It uses the [intake-xarray](https://github.com/intake/intake-xarray) plugin and supports several file formats including GeoTIFF, netCDF, GRIB, and OpenDAP.

## Installation

intake-stac has a few [requirements](requirements.txt), such as [Intake](https://intake.readthedocs.io), [intake-xarray](https://intake-xarray.readthedocs.io/) and [sat-stac](https://github.com/sat-utils/sat-stac). Intake-stac can be installed in any of the following ways:
Intake-STAC has a few [requirements](requirements.txt), such as [Intake](https://intake.readthedocs.io), [intake-xarray](https://intake-xarray.readthedocs.io/) and [sat-stac](https://github.com/sat-utils/sat-stac). Intake-stac can be installed in any of the following ways:

Using conda:
We recommend installing the latest release with `conda`:

```bash
$ conda install -c conda-forge intake-stac
```

Using Pip:
Or the latest development version with `pip`:

```bash
$ pip install intake-stac
$ pip install git+https://github.com/intake/intake-stac
```

Or from the source repository:
## Examples

```bash
$ pip install git+https://github.com/pangeo-data/intake-stac
```python
from intake import open_stac_catalog
catalog_url = 'https://raw.githubusercontent.com/cholmes/sample-stac/master/stac/catalog.json'
cat = open_stac_catalog(catalog_url)
cat['Houston-East-20170831-103f-100d-0f4f-RGB'].metadata
da = cat['Houston-East-20170831-103f-100d-0f4f-RGB']['thumbnail'].to_dask()
da
```

The [examples/](examples/) directory contains some example Jupyter Notebooks that can be used to test the functionality.
Expand All @@ -51,18 +49,10 @@ pip install intake-stac==0.1.0

The table below shows the corresponding versions between intake-stac and STAC:

| sat-stac | STAC |
| --------- | ----- |
| 0.[1,2].x | 0.6.x |

### Running the tests

To run the tests some additional packages need to be installed from the `requirements-dev.txt` file.

```
$ pip install -r requirements-dev.txt
$ pytest -v -s --cov intake-stac --cov-report term-missing
```
| intake-stac | STAC |
| ----------- | ----- |
| 0.2.x | 0.6.x |
| 0.3.x | 1.0.x |

## About

Expand Down
14 changes: 8 additions & 6 deletions ci/environment-dev-3.6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: intake-stac-dev
channels:
- conda-forge
dependencies:
- aiohttp
- autopep8
- black
- boto3
Expand All @@ -10,9 +11,13 @@ dependencies:
- dask
- distributed
- flake8
- geopandas
- intake
- intake-geopandas
- intake-parquet
- intake-xarray
- ipykernel
- ipywidgets
- isort
- make
- nbsphinx
Expand All @@ -28,17 +33,14 @@ dependencies:
- python=3.6
- pytoml
- pyyaml
- rasterio
- recommonmark
- sat-search
- requests
- sat-stac
- scikit-image
- sphinx_rtd_theme
- sphinx>=1.6
- xarray
- rasterio
- ipywidgets
- geopandas
- intake-geopandas
- intake-parquet
- pip:
- sat-search==0.3.0rc1
- sphinx_copybutton
8 changes: 5 additions & 3 deletions ci/environment-dev-3.7-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: intake-stac-dev
channels:
- conda-forge
dependencies:
- aiohttp
- autopep8
- black
- boto3
Expand All @@ -10,7 +11,9 @@ dependencies:
- dask
- distributed
- flake8
- geopandas
- ipykernel
- ipywidgets
- isort
- make
- nbsphinx
Expand All @@ -26,14 +29,13 @@ dependencies:
- python=3.7
- pytoml
- pyyaml
- rasterio
- recommonmark
- requests
- scikit-image
- sphinx_rtd_theme
- sphinx>=1.6
- xarray
- rasterio
- ipywidgets
- geopandas
- pip:
- sphinx_copybutton
- git+https://github.com/sat-utils/sat-stac.git
Expand Down
14 changes: 8 additions & 6 deletions ci/environment-dev-3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: intake-stac-dev
channels:
- conda-forge
dependencies:
- aiohttp
- autopep8
- black
- boto3
Expand All @@ -10,9 +11,13 @@ dependencies:
- dask
- distributed
- flake8
- geopandas
- intake
- intake-geopandas
- intake-parquet
- intake-xarray
- ipykernel
- ipywidgets
- isort
- make
- nbsphinx
Expand All @@ -28,17 +33,14 @@ dependencies:
- python=3.7
- pytoml
- pyyaml
- rasterio
- recommonmark
- sat-search
- requests
- sat-stac
- scikit-image
- sphinx_rtd_theme
- sphinx>=1.6
- xarray
- rasterio
- ipywidgets
- geopandas
- intake-geopandas
- intake-parquet
- pip:
- sat-search==0.3.0rc1
- sphinx_copybutton
26 changes: 16 additions & 10 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Feature requests and feedback
Do you like intake-stac? Share some love on Twitter or in your blog posts!

We'd also like to hear about your propositions and suggestions. Feel free to
`submit them as issues <https://github.com/pangeo-data/intake-stac>`_ and:
`submit them as issues <https://github.com/intake/intake-stac>`_ and:

* Explain in detail how they should work.
* Keep the scope as narrow as possible. This will make it easier to implement.
Expand All @@ -28,7 +28,7 @@ We'd also like to hear about your propositions and suggestions. Feel free to
Report bugs
-----------

Report bugs for intake-stac in the `issue tracker <https://github.com/pangeo-data/intake-stac>`_.
Report bugs for intake-stac in the `issue tracker <https://github.com/intake/intake-stac>`_.

If you are reporting a bug, please include:

Expand All @@ -48,7 +48,7 @@ fix the bug itself.
Fix bugs
--------

Look through the `GitHub issues for bugs <https://github.com/pangeo-data/intake-stac/labels/type:%20bug>`_.
Look through the `GitHub issues for bugs <https://github.com/intake/intake-stac/labels/type:%20bug>`_.

Talk to developers to find out how you can fix specific bugs.

Expand All @@ -70,7 +70,7 @@ without using a local copy. This can be convenient for small fixes.

.. code:: bash
$ conda env update -f ci/environment-dev-3.7.yml
$ conda env create -f ci/environment-dev-3.7.yml
$ cd docs
$ make html
Expand All @@ -86,10 +86,11 @@ Preparing Pull Requests


#. Fork the
`intake-stac GitHub repository <https://github.com/pangeo-data/intake-stac>`__. It's
`intake-stac GitHub repository <https://github.com/intake/intake-stac>`__. It's
fine to use ``intake-stac`` as your fork repository name because it will live
under your user.


#. Clone your fork locally using `git <https://git-scm.com/>`_ and create a branch::

$ git clone [email protected]:YOUR_GITHUB_USERNAME/intake-stac.git
Expand All @@ -100,6 +101,13 @@ Preparing Pull Requests
$ git checkout -b your-bugfix-feature-branch-name master


#. Install development version in a conda environment::

$ conda env create -f ci/environment-dev-3.7.yml
$ conda activate intake-stac-dev
$ pip install . -e


#. Install `pre-commit <https://pre-commit.com>`_ and its hook on the intake-stac repo::

$ pip install --user pre-commit
Expand All @@ -109,25 +117,23 @@ Preparing Pull Requests

https://pre-commit.com/ is a framework for managing and maintaining multi-language pre-commit hooks
to ensure code-style and code formatting is consistent.
#. Install dependencies into a new conda environment::

$ conda env update -f ci/environment-dev-3.7.yml


#. Run all the tests

Now running tests is as simple as issuing this command::

$ conda activate intake-stac-dev
$ pytest --junitxml=test-reports/junit.xml --cov=./ --verbose


This command will run tests via the "pytest" tool against Python 3.7.


#. You can now edit your local working copy and run the tests again as necessary. Please follow PEP-8 for naming.

When committing, ``pre-commit`` will re-format the files if necessary.


#. Commit and push once your tests pass and you are happy with your change(s)::

$ git commit -a -m "<commit message>"
Expand All @@ -139,5 +145,5 @@ Preparing Pull Requests
head-fork: YOUR_GITHUB_USERNAME/intake-stac
compare: your-branch-name

base-fork: pangeo-data/intake-stac
base-fork: intake/intake-stac
base: master
Loading

0 comments on commit f4e636d

Please sign in to comment.