Skip to content

Commit 0b18c38

Browse files
author
Jon Duckworth
authored
Merge pull request #540 from stac-utils/main
Merge v1.0.0-rc.3 changes into 1.0 branch
2 parents 7f9fef4 + f2afd5a commit 0b18c38

Some content is hidden

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

86 files changed

+2335
-1061
lines changed

.coveragerc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
[report]
2-
fail_under = 91
2+
fail_under = 94
3+
exclude_lines =
4+
if TYPE_CHECKING:
5+
36

47
[run]
5-
source = pystac
8+
branch = true
9+
source =
10+
pystac
11+
tests

.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[flake8]
22
max-line-length = 88
3-
extend-ignore = E203, W503, E731, E722
3+
extend-ignore = E203, W503, E731, E722
4+
per-file-ignores = __init__.py:F401

.github/workflows/continuous-integration.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ jobs:
1414
test:
1515
name: test
1616
runs-on: ${{ matrix.os }}
17+
continue-on-error: ${{ startsWith(matrix.python-version, '3.10')}}
1718
strategy:
1819
# Allow other matrix jobs to complete if 1 fails
1920
fail-fast: false
2021
matrix:
2122
python-version:
22-
- "3.6"
2323
- "3.7"
2424
- "3.8"
2525
- "3.9"
26+
- "3.10.0-beta.3"
2627
os:
2728
- ubuntu-latest
2829
- windows-latest
@@ -36,6 +37,18 @@ jobs:
3637
with:
3738
python-version: ${{ matrix.python-version }}
3839

40+
- uses: actions-rs/toolchain@v1
41+
# No wheels exist for orjson on Python 3.10 on MacOS or Windows, and the Linux
42+
# wheels are sometimes not uploaded until after the package is initially
43+
# published. This sets up the Rust nightly toolchain so we can build the orjson
44+
# wheel.
45+
if: ${{ startsWith(matrix.python-version, '3.10')}}
46+
with:
47+
toolchain: nightly
48+
override: true
49+
default: true
50+
profile: minimal
51+
3952
- name: Cache dependencies (Linux)
4053
if: startsWith(runner.os, 'Linux')
4154
uses: actions/cache@v2
@@ -97,11 +110,14 @@ jobs:
97110
pip install -e ".[validation]"
98111
99112
- name: Execute test suite
100-
# --fail-under=0 ensures we publish the coverage regardless of whether it meets
101-
# the minimum so we can use Codecov to evaluate gaps
102-
run: |
103-
coverage run --source=pystac/ -m unittest discover tests/
104-
coverage xml --fail-under=0
113+
run: ./scripts/test
114+
env:
115+
CHECK_COVERAGE: true
116+
117+
- name: Prepare ./coverage.xml
118+
# Ignore the configured fail-under to ensure we upload the coverage report. We
119+
# will trigger a failure for coverage drops in a later job
120+
run: coverage xml --fail-under 0
105121

106122
- name: Upload All coverage to Codecov
107123
uses: codecov/codecov-action@v1
@@ -111,16 +127,22 @@ jobs:
111127
file: ./coverage.xml
112128
fail_ci_if_error: false
113129

130+
- name: Check for coverage drop
131+
# This will use the configured fail-under, causing this job to fail if the
132+
# coverage drops.
133+
run: coverage report
134+
114135
lint:
115136
runs-on: ubuntu-latest
116137
strategy:
117138
# Allow other matrix jobs to complete if 1 fails
118139
fail-fast: false
119140
matrix:
120141
python-version:
121-
- "3.6"
122142
- "3.7"
123143
- "3.8"
144+
- "3.9"
145+
- "3.10.0-beta.3"
124146

125147
steps:
126148
- uses: actions/checkout@v2

CHANGELOG.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,52 @@
44

55
### Added
66

7+
### Removed
8+
9+
### Changed
10+
11+
### Deprecated
12+
13+
## [v1.0.0-rc.3]
14+
15+
### Added
16+
17+
- (Experimental) support for Python 3.10 ([#473](https://github.com/stac-utils/pystac/pull/473))
18+
- `LabelTask` enum in `pystac.extensions.label` with recommended values for
19+
`"label:tasks"` field ([#484](https://github.com/stac-utils/pystac/pull/484))
20+
- `LabelMethod` enum in `pystac.extensions.label` with recommended values for
21+
`"label:methods"` field ([#484](https://github.com/stac-utils/pystac/pull/484))
22+
- Label Extension summaries ([#484](https://github.com/stac-utils/pystac/pull/484))
23+
- Timestamps Extension summaries ([#513](https://github.com/stac-utils/pystac/pull/513))
24+
- Define equality and `__repr__` of `RangeSummary` instances based on `to_dict`
25+
representation ([#513](https://github.com/stac-utils/pystac/pull/513))
26+
- Sat Extension summaries ([#509](https://github.com/stac-utils/pystac/pull/509))
27+
- `Catalog.get_collections` for getting all child
28+
`Collections` for a catalog, and `Catalog.get_all_collections` for recursively getting
29+
all child `Collections` for a catalog and its children ([#511](https://github.com/stac-utils/pystac/pull/))
30+
731
### Changed
832

33+
- Renamed `Asset.properties` -> `Asset.extra_fields` and `Link.properties` ->
34+
`Link.extra_fields` for consistency with other STAC objects
35+
([#510](https://github.com/stac-utils/pystac/pull/510))
36+
937
### Fixed
1038

39+
- Bug in `pystac.serialization.identify_stac_object_type` where invalid objects with
40+
`stac_version == 1.0.0` were incorrectly identified as Catalogs
41+
([#487](https://github.com/stac-utils/pystac/pull/487))
42+
- `Link` constructor classes (e.g. `Link.from_dict`, `Link.canonical`, etc.) now return
43+
the calling class instead of always returning the `Link` class
44+
([#512](https://github.com/stac-utils/pystac/pull/512))
45+
- Sat extension now includes all fields defined in v1.0.0
46+
([#509](https://github.com/stac-utils/pystac/pull/509))
47+
1148
### Removed
1249

13-
### Deprecated
50+
- `STAC_IO` class in favor of `StacIO`. This was deprecated in v1.0.0-beta.1 and has
51+
been removed in this release. ([#490](https://github.com/stac-utils/pystac/pull/490))
52+
- Support for Python 3.6 ([#500](https://github.com/stac-utils/pystac/pull/500))
1453

1554
## [v1.0.0-rc.2]
1655

@@ -131,7 +170,7 @@
131170
- Removed `LinkMixin`, and implemented those methods on `STACObject` directly. STACObject was the only class using LinkMixin and this should not effect users ([#309](https://github.com/stac-utils/pystac/pull/309)
132171
- Removed `single-file-stac` extension; this extension is being removed in favor of ItemCollection usage ([#309](https://github.com/stac-utils/pystac/pull/309)
133172

134-
# Deprecated
173+
### Deprecated
135174

136175
- Deprecated `STAC_IO` in favor of new `StacIO` class. `STAC_IO` will be removed in
137176
v1.0.0. ([#309](https://github.com/stac-utils/pystac/pull/309))
@@ -397,7 +436,8 @@ use `Band.create`
397436

398437
Initial release.
399438

400-
[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.0.0-rc.2..main>
439+
[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.0.0-rc.3..main>
440+
[v1.0.0-rc.3]: <https://github.com/stac-utils/pystac/compare/v1.0.0-rc.2..v1.0.0-rc.3>
401441
[v1.0.0-rc.2]: <https://github.com/stac-utils/pystac/compare/v1.0.0-rc.1..v1.0.0-rc.2>
402442
[v1.0.0-rc.1]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.3..v1.0.0-rc.1>
403443
[v1.0.0-beta.3]: <https://github.com/stac-utils/pystac/compare/v1.0.0-beta.2..v1.0.0-beta.3>

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@
66
[![Gitter](https://badges.gitter.im/SpatioTemporal-Asset-Catalog/python.svg)](https://gitter.im/SpatioTemporal-Asset-Catalog/python?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
77
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
88

9-
PySTAC is a library for working with [SpatialTemporal Asset Catalog](https://stacspec.org) in Python 3.
9+
PySTAC is a library for working with [SpatioTemporal Asset Catalog](https://stacspec.org) in Python 3.
1010

1111
## Installation
1212

13+
PySTAC requires Python >= 3.7. This project follows the recommendations of
14+
[NEP-29](https://numpy.org/neps/nep-0029-deprecation_policy.html) in deprecating support
15+
for Python versions. This means that users can expect support for Python 3.7 to be
16+
removed from the `main` branch after Dec 26, 2021 and therefore from the next release
17+
after that date.
18+
19+
*Support for Python >= 3.10 should be considered experimental
20+
until further notice.*
21+
1322
PySTAC has a single required dependency (`python-dateutil`).
1423
PySTAC can be installed from pip or the source repository.
1524

@@ -34,6 +43,10 @@ optional `orjson` requirements:
3443
> pip install pystac[orjson]
3544
```
3645

46+
> *`orjson` wheels are only available for Linux in Python 3.10. If you are using the
47+
> `orjson` extra with Python 3.10 you will need to have the Rust nightly toolchain
48+
> installed as your default toolchain in order to build the package wheel.*
49+
3750
From source repository:
3851

3952
```bash

docs/api.rst

Lines changed: 67 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ TemporalExtent
8686
:members:
8787
:undoc-members:
8888

89+
ProviderRole
90+
~~~~~~~~~~~~
91+
92+
.. autoclass:: pystac.ProviderRole
93+
:members:
94+
:undoc-members:
95+
:show-inheritance:
96+
8997
Provider
9098
~~~~~~~~
9199

@@ -185,16 +193,6 @@ DuplicateKeyReportingMixin
185193
:members:
186194
:show-inheritance:
187195

188-
STAC_IO
189-
~~~~~~~
190-
191-
.. deprecated:: 1.0.0-beta.1
192-
Use :class:`pystac.StacIO` instead. This class will be removed in v1.0.0.
193-
194-
.. autoclass:: pystac.stac_io.STAC_IO
195-
:members:
196-
:undoc-members:
197-
198196
Layout
199197
------
200198

@@ -501,6 +499,45 @@ RasterExtension
501499
:show-inheritance:
502500
:inherited-members:
503501

502+
Satellite Extension
503+
-------------------
504+
505+
OrbitState
506+
~~~~~~~~~~
507+
508+
.. autoclass:: pystac.extensions.sat.OrbitState
509+
:members:
510+
:show-inheritance:
511+
:undoc-members:
512+
513+
SatExtension
514+
~~~~~~~~~~~~
515+
516+
.. autoclass:: pystac.extensions.sat.SatExtension
517+
:members:
518+
:show-inheritance:
519+
520+
ItemSatExtension
521+
~~~~~~~~~~~~~~~~
522+
523+
.. autoclass:: pystac.extensions.sat.ItemSatExtension
524+
:members:
525+
:show-inheritance:
526+
527+
AssetSatExtension
528+
~~~~~~~~~~~~~~~~~
529+
530+
.. autoclass:: pystac.extensions.sat.AssetSatExtension
531+
:members:
532+
:show-inheritance:
533+
534+
SummariesSatExtension
535+
~~~~~~~~~~~~~~~~~~~~~
536+
537+
.. autoclass:: pystac.extensions.sat.SummariesSatExtension
538+
:members:
539+
:show-inheritance:
540+
504541
Scientific Extension
505542
--------------------
506543

@@ -538,17 +575,29 @@ ItemScientificExtension
538575
Timestamps Extension
539576
--------------------
540577

541-
Implements the :stac-ext:`Timestamps Extension <timestamps>`.
578+
These classes are representations of the :stac-ext:`Timestamps Extension Spec
579+
<timestamps>`.
542580

543-
TimestampsItemExt
544-
~~~~~~~~~~~~~~~~~
581+
TimestampsExtension
582+
~~~~~~~~~~~~~~~~~~~
545583

546-
**TEMPORARILY REMOVED**
584+
.. autoclass:: pystac.extensions.timestamps.TimestampsExtension
585+
:members:
586+
:show-inheritance:
547587

548-
.. .. autoclass:: pystac.extensions.timestamps.TimestampsItemExt
549-
.. :members:
550-
.. :undoc-members:
551-
.. :show-inheritance:
588+
ItemTimestampsExtension
589+
~~~~~~~~~~~~~~~~~~~~~~~
590+
591+
.. autoclass:: pystac.extensions.timestamps.ItemTimestampsExtension
592+
:members:
593+
:show-inheritance:
594+
595+
AssetTimestampsExtension
596+
~~~~~~~~~~~~~~~~~~~~~~~~
597+
598+
.. autoclass:: pystac.extensions.timestamps.AssetTimestampsExtension
599+
:members:
600+
:show-inheritance:
552601

553602
SAR Extension
554603
-------------

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# This file does only contain a selection of the most common options. For a
66
# full list see the documentation:
7-
# http://www.sphinx-doc.org/en/master/config
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
88

99
# -- Path setup --------------------------------------------------------------
1010

docs/contributing.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ or the entire project using:
3939
4040
./scripts/test
4141
42+
The last command will also check test coverage. To view the coverage report, you can run
43+
`coverage report` (to view the report in the terminal) or `coverage html` (to generate
44+
an HTML report that can be opened in a browser).
45+
4246
More details on using ``unittest`` are `here
4347
<https://docs.python.org/3/library/unittest.html>`_.
4448

@@ -53,7 +57,7 @@ PySTAC uses
5357
- `black <https://github.com/psf/black>`_ for Python code formatting
5458
- `codespell <https://github.com/codespell-project/codespell/>`_ to check code for common misspellings
5559
- `doc8 <https://github.com/pycqa/doc8>`__ for style checking on RST files in the docs
56-
- `flake8 <http://flake8.pycqa.org/en/latest/>`_ for Python style checks
60+
- `flake8 <https://flake8.pycqa.org/en/latest/>`_ for Python style checks
5761
- `mypy <http://www.mypy-lang.org/>`_ for Python type annotation checks
5862

5963
Run all of these with ``pre-commit run --all-files`` or a single one using

docs/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if errorlevel 9009 (
2121
echo.may add the Sphinx directory to PATH.
2222
echo.
2323
echo.If you don't have Sphinx installed, grab it from
24-
echo.http://sphinx-doc.org/
24+
echo.https://www.sphinx-doc.org/
2525
exit /b 1
2626
)
2727

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@
988988
"cell_type": "markdown",
989989
"metadata": {},
990990
"source": [
991-
"This would be a good time to check our work - we can print out the GeoJSON and use [geojson.io](http://geojson.io/) to check and make sure we're using scenes that overlap our location. If this footprint is somewhere unexpected in the world, make sure the Lat/Long coordinates are correct and in the right order!"
991+
"This would be a good time to check our work - we can print out the GeoJSON and use [geojson.io](https://geojson.io/) to check and make sure we're using scenes that overlap our location. If this footprint is somewhere unexpected in the world, make sure the Lat/Long coordinates are correct and in the right order!"
992992
]
993993
},
994994
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
}
127127
],
128128
"source": [
129-
"url = ('http://spacenet-dataset.s3.amazonaws.com/'\n",
129+
"url = ('https://spacenet-dataset.s3.amazonaws.com/'\n",
130130
" 'spacenet/SN5_roads/train/AOI_7_Moscow/MS/'\n",
131131
" 'SN5_roads_train_AOI_7_Moscow_MS_chip996.tif')\n",
132132
"urllib.request.urlretrieve(url, img_path)"
@@ -1435,7 +1435,7 @@
14351435
}
14361436
],
14371437
"source": [
1438-
"url2 = ('http://spacenet-dataset.s3.amazonaws.com/'\n",
1438+
"url2 = ('https://spacenet-dataset.s3.amazonaws.com/'\n",
14391439
" 'spacenet/SN5_roads/train/AOI_7_Moscow/MS/'\n",
14401440
" 'SN5_roads_train_AOI_7_Moscow_MS_chip997.tif')\n",
14411441
"img_path2 = os.path.join(tmp_dir.name, 'image.tif')\n",

0 commit comments

Comments
 (0)