Skip to content

Commit

Permalink
Merge pull request #357 from duckontheweb/version/1.0.0-beta.2
Browse files Browse the repository at this point in the history
v1.0.0 beta.2 main -> release branch
  • Loading branch information
Jon Duckworth authored May 24, 2021
2 parents 5158a4c + f715761 commit 6214193
Show file tree
Hide file tree
Showing 41 changed files with 552 additions and 418 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ name: CI
on:
push:
branches:
- develop
- master
- main
pull_request:

jobs:
build:
name: build
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
# Allow other matrix jobs to complete if 1 fails
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8"]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2

Expand All @@ -26,16 +28,28 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements-dev.txt') }}
restore-keys: pip-
# Cache based on OS, Python version, and dependency hash
key: pip-${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('requirements-dev.txt') }}

- name: Execute linters and test suites
run: ./scripts/cibuild



- name: Upload All coverage to Codecov
uses: codecov/codecov-action@v1
# Only upload this once...
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'}}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false
vanilla:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install without orjson
run: pip install '.[validation]'
- name: Run unittests
run: python -m unittest discover tests
2 changes: 0 additions & 2 deletions .style.yapf

This file was deleted.

23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,25 @@

### Changed

### Remove
### Fixed

### Removed

## [1.0.0-beta.2]

### Changed

- Split `DefaultStacIO`'s reading and writing into two methods to allow subclasses to use the default link resolution behavior ([#354](https://github.com/stac-utils/pystac/pull/354))
- Increased test coverage for the pointcloud extension ([#352](https://github.com/stac-utils/pystac/pull/352))

### Fixed

- Reading json without orjson ([#348](https://github.com/stac-utils/pystac/pull/348))

### Removed

- Removed type information from docstrings, since it is redundant with function type
annotations ([#342](https://github.com/stac-utils/pystac/pull/342))

## [1.0.0-beta.1]

Expand Down Expand Up @@ -295,7 +313,8 @@ use `Band.create`

Initial release.

[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.1..main>
[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.2..main>
[v1.0.0-beta.2]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.1..v1.0.0-beta.2>
[v1.0.0-beta.1]: <https://github.com/stac-utils/pystac/compare/v0.5.6..v1.0.0-beta.1>
[v0.5.6]: <https://github.com/stac-utils/pystac/compare/v0.5.5..v0.5.6>
[v0.5.5]: <https://github.com/stac-utils/pystac/compare/v0.5.4..v0.5.5>
Expand Down
6 changes: 3 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ STACError

.. autoclass:: pystac.STACError

ExtensionError
~~~~~~~~~~~~~~
ExtensionTypeError
~~~~~~~~~~~~~~~~~~

.. autoclass:: pystac.extensions.ExtensionError
.. autoclass:: pystac.ExtensionTypeError

Extensions
----------
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/creating-a-landsat-stac.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@
"source": [
"#### Add Ground Sample Distance to common metadata\n",
"\n",
"We'll add the Ground Sample Distance that is defined as part of the Item [Common Metadata](https://github.com/radiantearth/stac-spec/blob/v1.0.0-beta.2/item-spec/common-metadata.md). We define this on the Item leve as 30 meters, which is the GSD for most of the bands of Landsat 8. However, there are some bands that have a different resolution; we will account for this by setting the GSD explicitly for each of those bands below."
"We'll add the Ground Sample Distance that is defined as part of the Item [Common Metadata](https://github.com/radiantearth/stac-spec/blob/v1.0.0-beta.2/item-spec/common-metadata.md). We define this on the Item level as 30 meters, which is the GSD for most of the bands of Landsat 8. However, there are some bands that have a different resolution; we will account for this by setting the GSD explicitly for each of those bands below."
]
},
{
Expand Down Expand Up @@ -1361,7 +1361,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Here we see the tumbnail asset, which does not include the band information for the `eo` extension as it does not represent any of the Item's bands:"
"Here we see the thumbnail asset, which does not include the band information for the `eo` extension as it does not represent any of the Item's bands:"
]
},
{
Expand Down Expand Up @@ -1888,7 +1888,7 @@
"source": [
"### Write the catalog locally\n",
"\n",
"Now that we have our complete, validated STAC in memory, let's write it out. This is a simple as calling `save` on the Collection. We need to specify the type of catalog in order to property write out links - these types are described again in the STAC [Best Practices](https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#use-of-links) documentation.\n",
"Now that we have our complete, validated STAC in memory, let's write it out. This is as simple as calling `save` on the Collection. We need to specify the type of catalog in order to property write out links - these types are described again in the STAC [Best Practices](https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#use-of-links) documentation.\n",
"\n",
"We'll use the \"self contained\" type, which uses relative paths and does not specify absolute \"self\" links to any object. This makes the catalog more portable, as it remains valid even if you copy the STAC to new locations."
]
Expand Down Expand Up @@ -2242,7 +2242,7 @@
"source": [
"### Acknowledgements\n",
"\n",
"Credit to [sat-stac-landsat](https://github.com/sat-utils/sat-stac-landsat) off of which a lot of this code was based."
"Credit to [sat-stac-landsat](https://github.com/sat-utils/sat-stac-landsat) from which a lot of this code was based."
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/how-to-create-stac-catalogs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Using [rasterio](https://rasterio.readthedocs.io/en/stable/), we can pull out the bounding box of the image to use for the image metadata. If the image contained a NoData border, we would ideally pull out the footprint and save it as the geometry; in this case, we're working with a small chip the most likely has no NoData values."
"Using [rasterio](https://rasterio.readthedocs.io/en/stable/), we can pull out the bounding box of the image to use for the image metadata. If the image contained a NoData border, we would ideally pull out the footprint and save it as the geometry; in this case, we're working with a small chip that most likely has no NoData values."
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions pystac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def read_file(href: str) -> STACObject:
This is a convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`
Args:
href (str): The HREF to read the object from.
href : The HREF to read the object from.
Returns:
The specific STACObject implementation class that is represented
Expand All @@ -104,10 +104,10 @@ def write_file(
Convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`
Args:
obj (STACObject): The STACObject to save.
include_self_link (bool): If this is true, include the 'self' link with this object.
obj : The STACObject to save.
include_self_link : If this is true, include the 'self' link with this object.
Otherwise, leave out the self link.
dest_href (str): Optional HREF to save the file to. If None, the object will be saved
dest_href : Optional HREF to save the file to. If None, the object will be saved
to the object's self href.
"""
obj.save_object(include_self_link=include_self_link, dest_href=dest_href)
Expand All @@ -128,10 +128,10 @@ def read_dict(
This is a convenience method for :meth:`pystac.serialization.stac_object_from_dict`
Args:
d (dict): The dict to parse.
href (str): Optional href that is the file location of the object being
d : The dict to parse.
href : Optional href that is the file location of the object being
parsed.
root (Catalog or Collection): Optional root of the catalog for this object.
root : Optional root of the catalog for this object.
If provided, the root's resolved object cache can be used to search for
previously resolved instances of the STAC object.
stac_io: Optional StacIO instance to use for reading. If None, the
Expand Down
22 changes: 11 additions & 11 deletions pystac/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ class Asset:
can be downloaded or streamed.
Args:
href (str): Link to the asset object. Relative and absolute links are both
href : Link to the asset object. Relative and absolute links are both
allowed.
title (str): Optional displayed title for clients and users.
description (str): A description of the Asset providing additional details,
title : Optional displayed title for clients and users.
description : A description of the Asset providing additional details,
such as how it was processed or created. CommonMark 0.29 syntax MAY be used
for rich text representation.
media_type (str): Optional description of the media type. Registered Media Types
media_type : Optional description of the media type. Registered Media Types
are preferred. See :class:`~pystac.MediaType` for common media types.
roles ([str]): Optional, Semantic roles (i.e. thumbnail, overview,
roles : Optional, Semantic roles (i.e. thumbnail, overview,
data, metadata) of the asset.
properties (dict): Optional, additional properties for this asset. This is used
properties : Optional, additional properties for this asset. This is used
by extensions as a way to serialize and deserialize properties on asset
object JSON.
Attributes:
href (str): Link to the asset object. Relative and absolute links are both
href : Link to the asset object. Relative and absolute links are both
allowed.
title (str): Optional displayed title for clients and users.
description (str): A description of the Asset providing additional details,
title : Optional displayed title for clients and users.
description : A description of the Asset providing additional details,
such as how it was processed or created. CommonMark 0.29 syntax MAY be
used for rich text representation.
media_type (str): Optional description of the media type. Registered Media Types
media_type : Optional description of the media type. Registered Media Types
are preferred. See :class:`~pystac.MediaType` for common media types.
properties (dict): Optional, additional properties for this asset. This is used
properties : Optional, additional properties for this asset. This is used
by extensions as a way to serialize and deserialize properties on asset
object JSON.
owner: The Item or Collection this asset belongs to, or None if it has no owner.
Expand Down
22 changes: 11 additions & 11 deletions pystac/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class ResolvedObjectCache:
them with their copies.
Args:
id_keys_to_objects (Dict[str, STACObject]): Existing cache of
id_keys_to_objects : Existing cache of
a key made up of the STACObject and it's parents IDs mapped
to the cached STACObject.
hrefs_to_objects (Dict[str, STACObject]): STAC Object HREFs matched to
hrefs_to_objects : STAC Object HREFs matched to
their cached object.
ids_to_collections (Dict[str, Collection]): Map of collection IDs
ids_to_collections : Map of collection IDs
to collections.
"""

Expand All @@ -76,7 +76,7 @@ def get_or_cache(self, obj: "STACObject_Type") -> "STACObject_Type":
none exists, sets the cached object to the given object.
Args:
obj (STACObject): The given object who's cache key will be checked
obj : The given object who's cache key will be checked
against the cache.
Returns:
Expand All @@ -101,7 +101,7 @@ def get(self, obj: "STACObject_Type") -> Optional["STACObject_Type"]:
"""Get the cached object that has the same cache key as the given object.
Args:
obj (STACObject): The given object who's cache key will be checked against
obj : The given object who's cache key will be checked against
the cache.
Returns:
Expand All @@ -118,7 +118,7 @@ def get_by_href(self, href: str) -> Optional["STACObject_Type"]:
"""Gets the cached object at href.
Args:
href (str): The href to use as the key for the cached object.
href : The href to use as the key for the cached object.
Returns:
STACObject or None: Returns the STACObject if cached, otherwise None.
Expand All @@ -129,7 +129,7 @@ def get_collection_by_id(self, id: str) -> Optional["Collection_Type"]:
"""Retrieved a cached Collection by its ID.
Args:
id (str): The ID of the collection.
id : The ID of the collection.
Returns:
Collection or None: Returns the collection if there is one cached
Expand All @@ -141,7 +141,7 @@ def cache(self, obj: "STACObject_Type") -> None:
"""Set the given object into the cache.
Args:
obj (STACObject): The object to cache
obj : The object to cache
"""
key, is_href = get_cache_key(obj)
if is_href:
Expand All @@ -156,7 +156,7 @@ def remove(self, obj: "STACObject_Type") -> None:
"""Removes any cached object that matches the given object's cache key.
Args:
obj (STACObject): The object to remove
obj : The object to remove
"""
key, is_href = get_cache_key(obj)

Expand Down Expand Up @@ -194,9 +194,9 @@ def merge(
in the first will be cached in the resulting merged ResolvedObjectCache.
Args:
first (ResolvedObjectCache): The first cache to merge. This cache will be
first : The first cache to merge. This cache will be
the preferred cache for objects in the case of ID conflicts.
second (ResolvedObjectCache): The second cache to merge.
second : The second cache to merge.
Returns:
ResolvedObjectCache: The resulting merged cache.
Expand Down
Loading

0 comments on commit 6214193

Please sign in to comment.