Skip to content

Commit

Permalink
Merge branch 'main' into 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
duckontheweb committed Nov 12, 2021
2 parents 0e4a87e + 2f42fbc commit a8896ff
Show file tree
Hide file tree
Showing 50 changed files with 1,254 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
- [ ] Tests pass (run `scripts/test`)
- [ ] Documentation has been updated to reflect changes, if applicable
- [ ] This PR maintains or improves overall codebase code coverage.
- [ ] Changes are added to the [CHANGELOG](https://github.com/stac-utils/pystac/blob/develop/CHANGELOG.md). See [the docs](https://pystac.readthedocs.io/en/latest/contributing.html#changelog) for information about adding to the changelog.
- [ ] Changes are added to the [CHANGELOG](https://github.com/stac-utils/pystac/blob/main/CHANGELOG.md). See [the docs](https://pystac.readthedocs.io/en/latest/contributing.html#changelog) for information about adding to the changelog.
15 changes: 6 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
test:
name: test
runs-on: ${{ matrix.os }}
continue-on-error: ${{ startsWith(matrix.python-version, '3.10')}}
strategy:
# Allow other matrix jobs to complete if 1 fails
fail-fast: false
Expand All @@ -23,7 +22,7 @@ jobs:
- "3.7"
- "3.8"
- "3.9"
- "3.10.0-beta.3"
- "3.10"
os:
- ubuntu-latest
- windows-latest
Expand All @@ -38,13 +37,11 @@ jobs:
python-version: ${{ matrix.python-version }}

- uses: actions-rs/toolchain@v1
# No wheels exist for orjson on Python 3.10 on MacOS or Windows, and the Linux
# wheels are sometimes not uploaded until after the package is initially
# published. This sets up the Rust nightly toolchain so we can build the orjson
# wheel.
# Wheels for orjson on Python 3.10 are still spotty on MacOS or Windows. This sets up the Rust
# toolchain so we can build the orjson wheel.
if: ${{ startsWith(matrix.python-version, '3.10')}}
with:
toolchain: nightly-2021-04-27
toolchain: stable
override: true
default: true
profile: minimal
Expand Down Expand Up @@ -120,7 +117,7 @@ jobs:
run: coverage xml --fail-under 0

- name: Upload All coverage to Codecov
uses: codecov/codecov-action@v2.0.2
uses: codecov/codecov-action@v2.1.0
if: ${{ env.GITHUB_REPOSITORY }} == 'stac-utils/pystac'
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -142,7 +139,7 @@ jobs:
- "3.7"
- "3.8"
- "3.9"
- "3.10.0-beta.3"
- "3.10"

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
Expand Down
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@

### Deprecated

## [v1.2.0]

### Added

- Added Table-extension ([#646](https://github.com/stac-utils/pystac/pull/646))
- Stable support for Python 3.10 ([#656](https://github.com/stac-utils/pystac/pull/656))
- `.python-version` files are now ignored by Git ([#647](https://github.com/stac-utils/pystac/pull/647))
- Added a flag to allow users to skip transforming hierarchical link HREFs based on root catalog type ([#663](https://github.com/stac-utils/pystac/pull/663))

### Removed

- Exclude `tests` from package distribution. This should make the package lighter ([#604](https://github.com/stac-utils/pystac/pull/604))

### Changed

- Enable [strict
mode](https://mypy.readthedocs.io/en/latest/command_line.html?highlight=strict%20mode#cmdoption-mypy-strict)
for `mypy` ([#591](https://github.com/stac-utils/pystac/pull/591))
- Links will get their `title` from their target if no `title` is provided ([#607](https://github.com/stac-utils/pystac/pull/607))
- Relax typing on `LabelClasses` from `List` to `Sequence` ([#627](https://github.com/stac-utils/pystac/pull/627))
- Upgraded datacube-extension to version 2.0.0 ([#645](https://github.com/stac-utils/pystac/pull/645))
- By default, ItemCollections will not modify Item HREFs based on root catalog type to avoid performance costs of root link reads ([#663](https://github.com/stac-utils/pystac/pull/663))

### Fixed

- `generate_subcatalogs` can include multiple template values in a single subfolder layer
([#595](https://github.com/stac-utils/pystac/pull/595))
- Avoid implicit re-exports ([#591](https://github.com/stac-utils/pystac/pull/591))
- Fix issue that caused incorrect root links when constructing multi-leveled catalogs ([#658](https://github.com/stac-utils/pystac/pull/658))
- Regression where string `Enum` values were not serialized properly in methods like `Link.to_dict` ([#654](https://github.com/stac-utils/pystac/pull/654))

## [v1.1.0]

### Added
Expand Down Expand Up @@ -494,7 +525,8 @@ use `Band.create`

Initial release.

[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.1.0..main>
[Unreleased]: <https://github.com/stac-utils/pystac/compare/v1.2.0..main>
[v1.2.0]: <https://github.com/stac-utils/pystac/compare/v1.1.0..v1.2.0>
[v1.1.0]: <https://github.com/stac-utils/pystac/compare/v1.0.1..v1.1.0>
[v1.0.1]: <https://github.com/stac-utils/pystac/compare/v1.0.0..v1.0.1>
[v1.0.0]: <https://github.com/stac-utils/pystac/compare/v1.0.0-rc.3..v1.0.0>
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ for Python versions. This means that users can expect support for Python 3.7 to
removed from the `main` branch after Dec 26, 2021 and therefore from the next release
after that date.

*Support for Python >= 3.10 should be considered experimental
until further notice.*
Note that while we support Python 3.10.\*, wheels for the `orjson` library are not always immediately available for all
platforms. If you install PySTAC with the `orjson` extra, you may need to have the Rust toolchain installed (e.g. via [rustup](https://rustup.rs/)) in order to
build the package from source.

PySTAC has a single required dependency (`python-dateutil`).
PySTAC can be installed from pip or the source repository.
Expand Down
49 changes: 49 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,22 @@ AdditionalDimension
:show-inheritance:
:inherited-members:

VariableType
~~~~~~~~~~~~

.. autoclass:: pystac.extensions.datacube.VariableType
:members:
:show-inheritance:
:inherited-members:

Variable
~~~~~~~~

.. autoclass:: pystac.extensions.datacube.Variable
:members:
:show-inheritance:
:inherited-members:

DatacubeExtension
~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -793,6 +809,39 @@ ItemScientificExtension
:members:
:show-inheritance:

Table Extension
---------------

These classes are representations of the :stac-ext:`Table Extension Spec <tables>`.

TableExtension
~~~~~~~~~~~~~~

.. autoclass:: pystac.extensions.table.TableExtension
:members:
:show-inheritance:

CollectionTableExtension
~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: pystac.extensions.table.CollectionTableExtension
:members:
:show-inheritance:

ItemTableExtension
~~~~~~~~~~~~~~~~~~

.. autoclass:: pystac.extensions.table.ItemTableExtension
:members:
:show-inheritance:

AssetTableExtension
~~~~~~~~~~~~~~~~~~~

.. autoclass:: pystac.extensions.table.AssetTableExtension
:members:
:show-inheritance:

Timestamps Extension
--------------------

Expand Down
6 changes: 4 additions & 2 deletions docs/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To use them you can pass in a strategy to the normalize_hrefs call.
Using templates
'''''''''''''''

You can utilze template strings to determine the file paths of HREFs set on Catalogs,
You can utilize template strings to determine the file paths of HREFs set on Catalogs,
Collection or Items. These templates use python format strings, which can name
the property or attribute of the item you want to use for replacing the template
variable. For example:
Expand All @@ -84,7 +84,9 @@ variable. For example:
The above code will save items in subfolders based on the collection ID, year and month
of it's datetime (or start_datetime if a date range is defined and no datetime is
defined).
defined). Note that the forward slash (``/``) should be used as path separator in the
template string regardless of the system path separator (thus both in POSIX-compliant
and Windows environments).

You can use dot notation to specify attributes of objects or keys in dictionaries for
template variables. PySTAC will look at the object, it's ``properties`` and its
Expand Down
14 changes: 1 addition & 13 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
[mypy]
check_untyped_defs = True
disallow_any_generics = True
disallow_incomplete_defs = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
disallow_untyped_defs = True
no_implicit_optional = True
show_error_codes = True
strict_equality = True
warn_redundant_casts = True
warn_return_any = True
warn_unused_configs = True
warn_unused_ignores = True
strict = True

[mypy-jsonschema.*]
ignore_missing_imports = True
Expand Down
45 changes: 42 additions & 3 deletions pystac/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
"""
PySTAC is a library for working with SpatioTemporal Asset Catalogs (STACs)
"""
__all__ = [
"__version__",
"STACError",
"STACTypeError",
"DuplicateObjectKeyError",
"ExtensionAlreadyExistsError",
"ExtensionNotImplemented",
"ExtensionTypeError",
"RequiredPropertyMissing",
"STACValidationError",
"MediaType",
"RelType",
"StacIO",
"STACObject",
"STACObjectType",
"Link",
"HIERARCHICAL_LINKS",
"Catalog",
"CatalogType",
"Collection",
"Extent",
"SpatialExtent",
"TemporalExtent",
"Summaries",
"CommonMetadata",
"RangeSummary",
"Item",
"Asset",
"ItemCollection",
"Provider",
"ProviderRole",
"read_file",
"read_dict",
"write_file",
"get_stac_version",
"set_stac_version",
]

from pystac.errors import (
STACError,
Expand Down Expand Up @@ -30,11 +67,11 @@
Extent,
SpatialExtent,
TemporalExtent,
Summaries,
)
from pystac.common_metadata import CommonMetadata
from pystac.summaries import RangeSummary
from pystac.item import Item, Asset
from pystac.summaries import RangeSummary, Summaries
from pystac.asset import Asset
from pystac.item import Item
from pystac.item_collection import ItemCollection
from pystac.provider import ProviderRole, Provider
import pystac.validation
Expand All @@ -50,6 +87,7 @@
import pystac.extensions.sar
import pystac.extensions.sat
import pystac.extensions.scientific
import pystac.extensions.table
import pystac.extensions.timestamps
import pystac.extensions.version
import pystac.extensions.view
Expand All @@ -66,6 +104,7 @@
pystac.extensions.sar.SAR_EXTENSION_HOOKS,
pystac.extensions.sat.SAT_EXTENSION_HOOKS,
pystac.extensions.scientific.SCIENTIFIC_EXTENSION_HOOKS,
pystac.extensions.table.TABLE_EXTENSION_HOOKS,
pystac.extensions.timestamps.TIMESTAMPS_EXTENSION_HOOKS,
pystac.extensions.version.VERSION_EXTENSION_HOOKS,
pystac.extensions.view.VIEW_EXTENSION_HOOKS,
Expand Down
Loading

0 comments on commit a8896ff

Please sign in to comment.