Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bands #5

Merged
merged 5 commits into from
Apr 26, 2024
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Steps to reproduce the behavior:

### Environment

* OS: [e.g. Linux / Windows / macOS]
* OS: (e.g. Linux / Windows / macOS)
* Python version
* stac-model version

Expand Down
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ assignees:

## :sound: Motivation

<!-- Please describe the motivation for this proposal, such as the problem it solves, the intended users for the feature and what does success look like and how we can measure that. -->
<!--
Please describe the motivation for this proposal, such as the problem it solves,
the intended users for the feature and what does success look like and how we can measure that.
-->

## :satellite: Alternatives

Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assignees:

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [ ] I've searched the project's [`issues`][1], looking for the following terms:
- [ ] I've searched the project's [`issues`](..), looking for the following terms:
- [...]

## :question: Question
Expand All @@ -24,5 +24,3 @@ Is it possible to [...]?
## :paperclip: Additional context

<!-- Add any other context or screenshots about the feature request here. -->

[1]: https://github.com/crim-ca/stac-model/issues
5 changes: 1 addition & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->

- [ ] I've read the [`CONTRIBUTING.md`][2] guide;
- [ ] I've read the [`CONTRIBUTING.md`](../CONTRIBUTING.md) guide;
- [ ] I've updated the code style using `make codestyle`;
- [ ] I've written tests for all new methods and classes that I created;
- [ ] I've written the docstring in `Google` format for all the methods and classes that I used.

[1]: https://github.com/rbavery/stac-model/blob/master/CODE_OF_CONDUCT.md
[2]: https://github.com/rbavery/stac-model/blob/master/CONTRIBUTING.md
19 changes: 13 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/crim-ca/dlm-extension/tree/main)
## [Unreleased](https://github.com/crim-ca/mlm-extension/tree/main)

### Added
- n/a
- Add pattern for `mlm:framework`, needing at least one alphanumeric character,
without leading or trailing non-alphanumeric characters.
- Add [`examples/item_eo_and_raster_bands.json`](examples/item_eo_and_raster_bands.json) demonstrating the original
use case represented by the previous [`examples/item_eo_bands.json`](examples/item_eo_bands.json) contents.
- Add a `description` field for `mlm:input` and `mlm:output` definitions.

### Changed
- n/a
- Adjust `scikit-learn` and `Hugging Face` framework names to match the format employed by the official documentation.

### Deprecated
- n/a

### Removed
- n/a
- Removed combination of `mlm:input` with `bands: null` that could never occur due to pre-requirement of `type: array`.

### Fixed
- n/a
- Fix `AnyBands` definition and use in the JSON schema to better consider possible use cases with `eo` extension.
- Fix [`examples/item_eo_bands.json`](examples/item_eo_bands.json) that was incorrectly also using `raster` extension.
This is not fundamentally wrong, but it did not allow to validate the `eo` extension use case properly, since
the `raster:bands` reference caused a bypass for the `mlm:input[*].bands` to succeed validation.

## [0.1.1.alpha4](https://github.com/crim-ca/dlm-extension/tree/0.1.1.alpha4)
## [v1.0.0](https://github.com/crim-ca/mlm-extension/tree/v1.0.0)

### Added
- more [Task Enum](README.md#task-enum) tasks
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@ format: codestyle
test:
PYTHONPATH=$(PYTHONPATH) poetry run pytest -c pyproject.toml --cov-report=html --cov=stac_model tests/

.PHONY: check
check: check-examples check-markdown check-lint check-mypy check-safety

.PHONY: check-all
check-all: check

.PHONY: mypy
mypy:
poetry run mypy --config-file pyproject.toml ./

.PHONY: check-mypy
check-mypy: mypy

.PHONY: check-safety
check-safety:
poetry check
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ to use common names when applicable. Below are a few notable entries.

- `PyTorch`
- `TensorFlow`
- `Scikit-learn`
- `Huggingface`
- `scikit-learn`
- `Hugging Face`
- `Keras`
- `ONNX`
- `rgee`
Expand Down Expand Up @@ -209,9 +209,10 @@ set to `true`, there would be no `accelerator` to contain against. To avoid conf

| Field Name | Type | Description |
|-------------------------|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | string | **REQUIRED** Name of the input variable defined by the model. If no explicit name is defined by the model, an informative name (e.g.: `"RGB Time Series"`) can be used instead. |
| name | string | **REQUIRED** Name of the input variable defined by the model. If no explicit name is defined by the model, an informative name (e.g.: `"RGB Time Series"`) can be used instead. |
| bands | \[string] | **REQUIRED** The names of the raster bands used to train or fine-tune the model, which may be all or a subset of bands available in a STAC Item's [Band Object](#bands-and-statistics). If no band applies for one input, use an empty array. |
| input | [Input Structure Object](#input-structure-object) | **REQUIRED** The N-dimensional array definition that describes the shape, dimension ordering, and data type. |
| description | string | Additional details about the input such as describing its purpose or expected source that cannot be represented by other properties. |
| norm_by_channel | boolean | Whether to normalize each channel by channel-wise statistics or to normalize by dataset statistics. If True, use an array of `statistics` of same dimensionality and order as the `bands` field in this object. |
| norm_type | [Normalize Enum](#normalize-enum) \| null | Normalization method. Select an appropriate option or `null` when none applies. Consider using `pre_processing_function` for custom implementations or more complex combinations. |
| norm_clip | \[number] | When `norm_type = "clip"`, this array supplies the value for each `bands` item, which is used to divide each band before clipping values between 0 and 1. |
Expand Down Expand Up @@ -400,6 +401,7 @@ the following formats are recommended as alternative scripts and function refere
| name | string | **REQUIRED** Name of the output variable defined by the model. If no explicit name is defined by the model, an informative name (e.g.: `"CLASSIFICATION"`) can be used instead. |
| tasks | \[[Task Enum](#task-enum)] | **REQUIRED** Specifies the Machine Learning tasks for which the output can be used for. This can be a subset of `mlm:tasks` defined under the Item `properties` as applicable. |
| result | [Result Structure Object](#result-structure-object) | **REQUIRED** The structure that describes the resulting output arrays/tensors from one model head. |
| description | string | Additional details about the output such as describing its purpose or expected result that cannot be represented by other properties. |
| classification:classes | \[[Class Object](#class-object)] | A list of class objects adhering to the [Classification Extension](https://github.com/stac-extensions/classification). |
| post_processing_function | [Processing Expression](#processing-expression) \| null | Custom postprocessing function where normalization and rescaling, and any other significant operations takes place. |

Expand Down
8 changes: 8 additions & 0 deletions examples/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
"href": "item_eo_bands.json",
"rel": "item"
},
{
"href": "item_eo_and_raster_bands.json",
"rel": "item"
},
{
"href": "item_eo_bands_summarized.json",
"rel": "item"
},
{
"href": "item_raster_bands.json",
"rel": "item"
Expand Down
Loading
Loading