Skip to content

Commit 6214193

Browse files
author
Jon Duckworth
authored
Merge pull request #357 from duckontheweb/version/1.0.0-beta.2
v1.0.0 beta.2 main -> release branch
2 parents 5158a4c + f715761 commit 6214193

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+552
-418
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ name: CI
33
on:
44
push:
55
branches:
6-
- develop
7-
- master
6+
- main
87
pull_request:
98

109
jobs:
1110
build:
1211
name: build
13-
runs-on: ubuntu-latest
12+
runs-on: ${{ matrix.os }}
1413
strategy:
14+
# Allow other matrix jobs to complete if 1 fails
15+
fail-fast: false
1516
matrix:
1617
python-version: ["3.6", "3.7", "3.8"]
18+
os: [ubuntu-latest, windows-latest, macos-latest]
1719
steps:
1820
- uses: actions/checkout@v2
1921

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

3234
- name: Execute linters and test suites
3335
run: ./scripts/cibuild
34-
35-
36+
3637
- name: Upload All coverage to Codecov
3738
uses: codecov/codecov-action@v1
39+
# Only upload this once...
40+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'}}
3841
with:
3942
token: ${{ secrets.CODECOV_TOKEN }}
4043
file: ./coverage.xml
4144
fail_ci_if_error: false
45+
vanilla:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v2
49+
- uses: actions/setup-python@v2
50+
with:
51+
python-version: "3.8"
52+
- name: Install without orjson
53+
run: pip install '.[validation]'
54+
- name: Run unittests
55+
run: python -m unittest discover tests

.style.yapf

Lines changed: 0 additions & 2 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,25 @@
66

77
### Changed
88

9-
### Remove
9+
### Fixed
10+
11+
### Removed
12+
13+
## [1.0.0-beta.2]
14+
15+
### Changed
16+
17+
- 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))
18+
- Increased test coverage for the pointcloud extension ([#352](https://github.com/stac-utils/pystac/pull/352))
19+
20+
### Fixed
21+
22+
- Reading json without orjson ([#348](https://github.com/stac-utils/pystac/pull/348))
23+
24+
### Removed
25+
26+
- Removed type information from docstrings, since it is redundant with function type
27+
annotations ([#342](https://github.com/stac-utils/pystac/pull/342))
1028

1129
## [1.0.0-beta.1]
1230

@@ -295,7 +313,8 @@ use `Band.create`
295313

296314
Initial release.
297315

298-
[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.1..main>
316+
[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.2..main>
317+
[v1.0.0-beta.2]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.1..v1.0.0-beta.2>
299318
[v1.0.0-beta.1]: <https://github.com/stac-utils/pystac/compare/v0.5.6..v1.0.0-beta.1>
300319
[v0.5.6]: <https://github.com/stac-utils/pystac/compare/v0.5.5..v0.5.6>
301320
[v0.5.5]: <https://github.com/stac-utils/pystac/compare/v0.5.4..v0.5.5>

docs/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ STACError
178178

179179
.. autoclass:: pystac.STACError
180180

181-
ExtensionError
182-
~~~~~~~~~~~~~~
181+
ExtensionTypeError
182+
~~~~~~~~~~~~~~~~~~
183183

184-
.. autoclass:: pystac.extensions.ExtensionError
184+
.. autoclass:: pystac.ExtensionTypeError
185185

186186
Extensions
187187
----------

docs/tutorials/creating-a-landsat-stac.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@
10801080
"source": [
10811081
"#### Add Ground Sample Distance to common metadata\n",
10821082
"\n",
1083-
"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."
1083+
"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."
10841084
]
10851085
},
10861086
{
@@ -1361,7 +1361,7 @@
13611361
"cell_type": "markdown",
13621362
"metadata": {},
13631363
"source": [
1364-
"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:"
1364+
"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:"
13651365
]
13661366
},
13671367
{
@@ -1888,7 +1888,7 @@
18881888
"source": [
18891889
"### Write the catalog locally\n",
18901890
"\n",
1891-
"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",
1891+
"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",
18921892
"\n",
18931893
"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."
18941894
]
@@ -2242,7 +2242,7 @@
22422242
"source": [
22432243
"### Acknowledgements\n",
22442244
"\n",
2245-
"Credit to [sat-stac-landsat](https://github.com/sat-utils/sat-stac-landsat) off of which a lot of this code was based."
2245+
"Credit to [sat-stac-landsat](https://github.com/sat-utils/sat-stac-landsat) from which a lot of this code was based."
22462246
]
22472247
}
22482248
],

docs/tutorials/how-to-create-stac-catalogs.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
"cell_type": "markdown",
296296
"metadata": {},
297297
"source": [
298-
"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."
298+
"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."
299299
]
300300
},
301301
{

pystac/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def read_file(href: str) -> STACObject:
7979
This is a convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`
8080
8181
Args:
82-
href (str): The HREF to read the object from.
82+
href : The HREF to read the object from.
8383
8484
Returns:
8585
The specific STACObject implementation class that is represented
@@ -104,10 +104,10 @@ def write_file(
104104
Convenience method for :meth:`STACObject.from_file <pystac.STACObject.from_file>`
105105
106106
Args:
107-
obj (STACObject): The STACObject to save.
108-
include_self_link (bool): If this is true, include the 'self' link with this object.
107+
obj : The STACObject to save.
108+
include_self_link : If this is true, include the 'self' link with this object.
109109
Otherwise, leave out the self link.
110-
dest_href (str): Optional HREF to save the file to. If None, the object will be saved
110+
dest_href : Optional HREF to save the file to. If None, the object will be saved
111111
to the object's self href.
112112
"""
113113
obj.save_object(include_self_link=include_self_link, dest_href=dest_href)
@@ -128,10 +128,10 @@ def read_dict(
128128
This is a convenience method for :meth:`pystac.serialization.stac_object_from_dict`
129129
130130
Args:
131-
d (dict): The dict to parse.
132-
href (str): Optional href that is the file location of the object being
131+
d : The dict to parse.
132+
href : Optional href that is the file location of the object being
133133
parsed.
134-
root (Catalog or Collection): Optional root of the catalog for this object.
134+
root : Optional root of the catalog for this object.
135135
If provided, the root's resolved object cache can be used to search for
136136
previously resolved instances of the STAC object.
137137
stac_io: Optional StacIO instance to use for reading. If None, the

pystac/asset.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ class Asset:
1414
can be downloaded or streamed.
1515
1616
Args:
17-
href (str): Link to the asset object. Relative and absolute links are both
17+
href : Link to the asset object. Relative and absolute links are both
1818
allowed.
19-
title (str): Optional displayed title for clients and users.
20-
description (str): A description of the Asset providing additional details,
19+
title : Optional displayed title for clients and users.
20+
description : A description of the Asset providing additional details,
2121
such as how it was processed or created. CommonMark 0.29 syntax MAY be used
2222
for rich text representation.
23-
media_type (str): Optional description of the media type. Registered Media Types
23+
media_type : Optional description of the media type. Registered Media Types
2424
are preferred. See :class:`~pystac.MediaType` for common media types.
25-
roles ([str]): Optional, Semantic roles (i.e. thumbnail, overview,
25+
roles : Optional, Semantic roles (i.e. thumbnail, overview,
2626
data, metadata) of the asset.
27-
properties (dict): Optional, additional properties for this asset. This is used
27+
properties : Optional, additional properties for this asset. This is used
2828
by extensions as a way to serialize and deserialize properties on asset
2929
object JSON.
3030
3131
Attributes:
32-
href (str): Link to the asset object. Relative and absolute links are both
32+
href : Link to the asset object. Relative and absolute links are both
3333
allowed.
34-
title (str): Optional displayed title for clients and users.
35-
description (str): A description of the Asset providing additional details,
34+
title : Optional displayed title for clients and users.
35+
description : A description of the Asset providing additional details,
3636
such as how it was processed or created. CommonMark 0.29 syntax MAY be
3737
used for rich text representation.
38-
media_type (str): Optional description of the media type. Registered Media Types
38+
media_type : Optional description of the media type. Registered Media Types
3939
are preferred. See :class:`~pystac.MediaType` for common media types.
40-
properties (dict): Optional, additional properties for this asset. This is used
40+
properties : Optional, additional properties for this asset. This is used
4141
by extensions as a way to serialize and deserialize properties on asset
4242
object JSON.
4343
owner: The Item or Collection this asset belongs to, or None if it has no owner.

pystac/cache.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ class ResolvedObjectCache:
5050
them with their copies.
5151
5252
Args:
53-
id_keys_to_objects (Dict[str, STACObject]): Existing cache of
53+
id_keys_to_objects : Existing cache of
5454
a key made up of the STACObject and it's parents IDs mapped
5555
to the cached STACObject.
56-
hrefs_to_objects (Dict[str, STACObject]): STAC Object HREFs matched to
56+
hrefs_to_objects : STAC Object HREFs matched to
5757
their cached object.
58-
ids_to_collections (Dict[str, Collection]): Map of collection IDs
58+
ids_to_collections : Map of collection IDs
5959
to collections.
6060
"""
6161

@@ -76,7 +76,7 @@ def get_or_cache(self, obj: "STACObject_Type") -> "STACObject_Type":
7676
none exists, sets the cached object to the given object.
7777
7878
Args:
79-
obj (STACObject): The given object who's cache key will be checked
79+
obj : The given object who's cache key will be checked
8080
against the cache.
8181
8282
Returns:
@@ -101,7 +101,7 @@ def get(self, obj: "STACObject_Type") -> Optional["STACObject_Type"]:
101101
"""Get the cached object that has the same cache key as the given object.
102102
103103
Args:
104-
obj (STACObject): The given object who's cache key will be checked against
104+
obj : The given object who's cache key will be checked against
105105
the cache.
106106
107107
Returns:
@@ -118,7 +118,7 @@ def get_by_href(self, href: str) -> Optional["STACObject_Type"]:
118118
"""Gets the cached object at href.
119119
120120
Args:
121-
href (str): The href to use as the key for the cached object.
121+
href : The href to use as the key for the cached object.
122122
123123
Returns:
124124
STACObject or None: Returns the STACObject if cached, otherwise None.
@@ -129,7 +129,7 @@ def get_collection_by_id(self, id: str) -> Optional["Collection_Type"]:
129129
"""Retrieved a cached Collection by its ID.
130130
131131
Args:
132-
id (str): The ID of the collection.
132+
id : The ID of the collection.
133133
134134
Returns:
135135
Collection or None: Returns the collection if there is one cached
@@ -141,7 +141,7 @@ def cache(self, obj: "STACObject_Type") -> None:
141141
"""Set the given object into the cache.
142142
143143
Args:
144-
obj (STACObject): The object to cache
144+
obj : The object to cache
145145
"""
146146
key, is_href = get_cache_key(obj)
147147
if is_href:
@@ -156,7 +156,7 @@ def remove(self, obj: "STACObject_Type") -> None:
156156
"""Removes any cached object that matches the given object's cache key.
157157
158158
Args:
159-
obj (STACObject): The object to remove
159+
obj : The object to remove
160160
"""
161161
key, is_href = get_cache_key(obj)
162162

@@ -194,9 +194,9 @@ def merge(
194194
in the first will be cached in the resulting merged ResolvedObjectCache.
195195
196196
Args:
197-
first (ResolvedObjectCache): The first cache to merge. This cache will be
197+
first : The first cache to merge. This cache will be
198198
the preferred cache for objects in the case of ID conflicts.
199-
second (ResolvedObjectCache): The second cache to merge.
199+
second : The second cache to merge.
200200
201201
Returns:
202202
ResolvedObjectCache: The resulting merged cache.

0 commit comments

Comments
 (0)