Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 55 additions & 44 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,77 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased
## [v0.7.0] - 2025-09-17

### ⚠️ Breaking Change

- ([#176]) Removed support for Python 3.9.

### Added

- ([#176]) Adds a `collection_matchers`
array to the payload process block to support deterministic order when collection
matching.
- ([#176]) Adds a `collection_options`
object to the payload process block to support collection-specific options such as
upload options.
- ([#176]) Adds a `collection_matchers` array to the payload process block to support
deterministic order when collection matching.
- ([#176]) Adds a `collection_options` object to the payload process block to support
collection-specific options such as upload options.
- ([#176]) Adds direct access to the payload dictionary through `self.payload` on
the Task class.
- ([#176]) Adds access to payload properties through `self.payload.<property>` on
the Task class.

### Changed

- ([#176]) Separated the payload
data model from the Task class.
- ([#176]) Direct access to the
payload dictionary is now through `self.payload` rather than `self._payload`
(deprecated).
- ([#176]) Payload properties are now
accessed through `self.payload.<property>` rather than `self.<property>` (deprecated).
- ([#176]) Removed support for Python
3.9.
- ([#176]) Separated the payload data model from the Task class.

### Deprecated

- ([#176]) Direct access to the payload dictionary through `self._payload` is
deprecated in favor of `self.payload`.
- ([#176]) Direct access to payload properties through `self.<property>` is
deprecated in favor of `self.payload.<property>`.
- ([#167]) The collection mapping in the `collections` field in `upload_options` is
deprecated in favor of `collection_matchers`.

## [0.6.1]
## [v0.6.1] - 2024-11-25

### Added

- ([#167]) Adds workflow-level
options to the ProcessDefinition object in a new `workflow_options` field. They are
combined with each task's options, giving precedence to the task options on conflict.
- ([#167]) Adds a `workflow_options`
property to the `Task` class that returns the `workflow_options` dictionary from the
`ProcessDefinition` object.
- ([#167]) Adds a `task_options`
property to the `Task` class that returns the task options from the `tasks` dictionary
in the `ProcessDefinition` object.
- ([#167]) Adds workflow-level options to the ProcessDefinition object in a new
`workflow_options` field. They are combined with each task's options, giving
precedence to the task options on conflict.
- ([#167]) Adds a `workflow_options` property to the `Task` class that returns the
`workflow_options` dictionary from the `ProcessDefinition` object.
- ([#167]) Adds a `task_options` property to the `Task` class that returns the task
options from the `tasks` dictionary in the `ProcessDefinition` object.

### Deprecated

- ([#166]) Bare `ProcessDefinition`
objects are deprecated in favor of arrays of `ProcessDefinition` objects.
- ([#166]) Bare `ProcessDefinition` objects are deprecated in favor of arrays of
`ProcessDefinition` objects.

## [0.6.0]
## [v0.6.0] - 2024-09-19

### ⚠️ Breaking Change

- ([#147]) Moved
`Task.validate` from class method to instance method, availing
- ([#147]) Moved `Task.validate` from class method to instance method, availing
implementers of other instance convenience methods (i.e. `self.parameters`).

## [0.5.1] - 2024-05-23
## [v0.5.1] - 2024-05-23

### Added

- download_item_assets and download_items_assets methods now accept a parameter `file_name` for configuring the filename to save the STAC Item as. If unset, it defaults to `item.json` and if set to `None` the filename is inferred from the ID.
- download_item_assets and download_items_assets methods now accept a parameter
`file_name` for configuring the filename to save the STAC Item as. If unset, it
defaults to `item.json` and if set to `None` the filename is inferred from the ID.

## [0.5.0] - 2024-05-08
## [v0.5.0] - 2024-05-08

### Deprecated

- Support for Python 3.8 has been removed.
- CLI flags `--skip-upload` and `--skip-validation` deprecated in favor of `--upload/--no-upload` and `--validate/no-validate`
- Task constructor arguments `skip_upload` and `skip_validation` deprecated in favor of `upload` and `validate`
- CLI flags `--skip-upload` and `--skip-validation` deprecated in favor of
`--upload/--no-upload` and `--validate/no-validate`
- Task constructor arguments `skip_upload` and `skip_validation` deprecated in favor of
`upload` and `validate`

### Fixed

Expand All @@ -80,7 +88,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- The `processing:software` field is no longer added to Items by default. This is
because the intention of the STAC Processing Extension is to add metadata about the
processing of the data, whereas stactask is frequently used only for processing
metadata. Users wishing to retain this field can call the method `Task.add_software_version_to_item(item)` on the resulting item to add it.
metadata. Users wishing to retain this field can call the method
`Task.add_software_version_to_item(item)` on the resulting item to add it.
- Task logging now identifies the task instance that is logging, e.g.,
`INFO:my-task-name:[my-collection/workflow-my-workflow/task-1] Task did a thing.`
- Collection assignment now assigns the first matching collection expression, rather
Expand All @@ -93,13 +102,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Utils method `find_collection` to allow the retrieval of the collection name for
an Item dict
- Task method `upload_local_item_assets_to_s3(item)` to upload all local assets to S3
- Added support for using stdin and stdout as input and output for task, e.g., `cat in.json | src/mytask/mytask.py run --local | tee out.json`
- Added support for using stdin and stdout as input and output for task, e.g., `cat
in.json | src/mytask/mytask.py run --local | tee out.json`

## [v0.4.2] - 2024-03-08

### Added

- ([#92]) Task.upload_item_assets_to_s3 and asset_io.upload_item_assets_to_s3 support explicitly specifying the boto3utils3.s3 object.
- ([#92]) Task.upload_item_assets_to_s3 and asset_io.upload_item_assets_to_s3 support
explicitly specifying the boto3utils3.s3 object.

## [v0.4.1] - 2024-03-06

Expand Down Expand Up @@ -161,11 +172,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

Initial release.

[unreleased]: <https://github.com/stac-utils/stac-task/compare/v0.6.1...main>
[0.6.1]: <https://github.com/stac-utils/stac-task/compare/v0.6.0...0.6.1>
[0.6.0]: <https://github.com/stac-utils/stac-task/compare/v0.5.1...0.6.0>
[0.5.1]: <https://github.com/stac-utils/stac-task/compare/v0.5.0...v0.5.1>
[0.5.0]: <https://github.com/stac-utils/stac-task/compare/v0.4.2...v0.5.0>
[v0.7.0]: <https://github.com/stac-utils/stac-task/compare/v0.6.1...0.7.0>
[v0.6.1]: <https://github.com/stac-utils/stac-task/compare/v0.6.0...0.6.1>
[v0.6.0]: <https://github.com/stac-utils/stac-task/compare/v0.5.1...0.6.0>
[v0.5.1]: <https://github.com/stac-utils/stac-task/compare/v0.5.0...v0.5.1>
[v0.5.0]: <https://github.com/stac-utils/stac-task/compare/v0.4.2...v0.5.0>
[v0.4.2]: <https://github.com/stac-utils/stac-task/compare/v0.4.1...v0.4.2>
[v0.4.1]: <https://github.com/stac-utils/stac-task/compare/v0.4.0...v0.4.1>
[v0.4.0]: <https://github.com/stac-utils/stac-task/compare/v0.3.0...v0.4.0>
Expand Down
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- omit from toc -->
# STAC Task (stac-task)

[![Build Status](https://github.com/stac-utils/stac-task/workflows/CI/badge.svg?branch=main)](https://github.com/stac-utils/stac-task/actions/workflows/continuous-integration.yml)
[![CI](https://github.com/stac-utils/stac-task/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/stac-utils/stac-task/actions/workflows/continuous-integration.yml)
[![PyPI version](https://badge.fury.io/py/stactask.svg)](https://badge.fury.io/py/stactask)
[![Documentation Status](https://readthedocs.org/projects/stac-task/badge/?version=latest)](https://stac-task.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/stac-utils/stac-task/branch/main/graph/badge.svg)](https://codecov.io/gh/stac-utils/stac-task)
Expand Down Expand Up @@ -76,19 +76,14 @@ Task input is referred to as a "payload" and has the following top-level fields.

Provides configuration for a Task.

| Field Name | Type | Description |
| ------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| description | string | Description of the process configuration |
| upload_options | UploadOptions Object | **CONDITIONAL.** An `UploadOptions` object |
| collection_matchers | [CollectionMatcher Object] | **CONDITIONAL.** An array of `CollectionMatcher` objects used for collection assignment. Mutually exclusive with `upload_options.collections` |
| collection_options | Map<string, Map<string, Any> | Dictionary of collection-specific configuration options |
| tasks | Map<string, Map<string, Any> | Dictionary of task configurations |
| workflow_options | Map<string, Any> | Dictionary of configuration options applied to all tasks in a workflow |

Either `collection_matchers` OR `upload_options.collections` must be provided for
collection assignment. When using `collection_matchers`, each referenced collection must
have upload options available either in `collection_options` or in the global
`upload_options`.
| Field Name | Type | Description |
| ------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| description | string | Description of the process configuration |
| upload_options | UploadOptions Object | An `UploadOptions` object |
| collection_matchers | [CollectionMatcher Object] | An array of `CollectionMatcher` objects used for collection assignment. Mutually exclusive with `upload_options.collections` |
| collection_options | Map<string, Map<string, Any> | Dictionary of collection-specific configuration options |
| tasks | Map<string, Map<string, Any> | Dictionary of task configurations |
| workflow_options | Map<string, Any> | Dictionary of configuration options applied to all tasks in a workflow |

### UploadOptions Object

Expand Down
32 changes: 16 additions & 16 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ containing a task parameter ``item_id`` and generates a STAC Item with this ID.
# override from Task
def process(self, **kwargs: Any) -> list[dict[str, Any]]:
item = Item(
id=self.task_options["item_id"],
geometry={
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0],
]
],
},
bbox=None,
datetime=datetime.now(timezone.utc),
properties={},
id=self.task_options["item_id"],
geometry={
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0],
]
],
},
bbox=None,
datetime=datetime.now(timezone.utc),
properties={},
)

self.logger.debug(f"Created Item with id '{item.id}'")
Expand Down