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

Autoupdate pre-commit #57

Merged
merged 3 commits into from
Apr 18, 2023
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
78 changes: 0 additions & 78 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,81 +56,3 @@ jobs:
run: conda env update -f environment.yml -n test
- name: Execute linters and test suites
run: ./scripts/cibuild
docker:
name: docker
needs:
- codecov
- python-matrix
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run rename script if in the template repo
run: |
if [[ "$GITHUB_REPOSITORY" == */template ]]; then
scripts/rename
fi
- name: Source build args
run: |
source ./docker_env
STACTOOLS_VERSION=$(python scripts/stactools-version.py)
echo "stactools_version=$STACTOOLS_VERSION" >> $GITHUB_ENV
echo "docker_workdir=$DOCKER_WORKDIR" >> $GITHUB_ENV
echo "docker_namespace_package_dir=$DOCKER_NAMESPACE_PACKAGE_DIR" >> $GITHUB_ENV
- name: Docker meta main
id: meta-main
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push main
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
# Don't try to push if the event is a PR from a fork
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
tags: ${{ steps.meta-main.outputs.tags }}
labels: ${{ steps.meta-main.outputs.labels }}
- name: Docker meta dev
id: meta-dev
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
flavor: |
suffix=-dev
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push dev
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile-dev
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
# Don't try to push if the event is a PR from a fork
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
tags: ${{ steps.meta-dev.outputs.tags }}
labels: ${{ steps.meta-dev.outputs.labels }}
80 changes: 0 additions & 80 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,83 +32,3 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
run: |
scripts/publish
docker:
name: docker
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: "3.x"
-
name: Checkout
uses: actions/checkout@v2
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Source build args
run: |
source ./docker_env
STACTOOLS_VERSION=$(python scripts/stactools-version.py)
echo "stactools_version=$STACTOOLS_VERSION" >> $GITHUB_ENV
echo "docker_workdir=$DOCKER_WORKDIR" >> $GITHUB_ENV
echo "docker_namespace_package_dir=$DOCKER_NAMESPACE_PACKAGE_DIR" >> $GITHUB_ENV
- name: Run rename script if in the template repo
run: |
if [[ "$GITHUB_REPOSITORY" == */template ]]; then
scripts/rename
fi
-
name: Docker meta main
id: meta-main
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
flavor: |
latest=true
tags: |
type=pep440,pattern={{version}}
-
name: Build and push main
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
push: true
tags: ${{ steps.meta-main.outputs.tags }}
labels: ${{ steps.meta-main.outputs.labels }}
-
name: Docker meta dev
id: meta-dev
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
flavor: |
latest=true
suffix=-dev,onlatest=true
tags: |
type=pep440,pattern={{version}}
-
name: Build and push dev
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile-dev
build-args: |
STACTOOLS_VERSION=${{ env.stactools_version }}
DOCKER_WORKDIR=${{ env.docker_workdir }}
DOCKER_NAMESPACE_PACKAGE_DIR=${{ env.docker_namespace_package_dir }}
push: true
tags: ${{ steps.meta-dev.outputs.tags }}
labels: ${{ steps.meta-dev.outputs.labels }}
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MD013: false
MD041: false
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

repos:
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.4
hooks:
- id: codespell
args: [--ignore-words=.codespellignore]
Expand All @@ -17,15 +17,15 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.2.0
hooks:
- id: mypy
additional_dependencies:
- click != 8.1.0
- stactools
- types-python-dateutil
- repo: https://github.com/pycqa/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/igorshubovych/markdownlint-cli
Expand Down
16 changes: 9 additions & 7 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- Added support for the Grid Extension `grid:code` field ((#56)[https://github.com/stactools-packages/landsat/pull/56])
- Added support for the Projection Extension `proj:centroid` field ((#56)[https://github.com/stactools-packages/landsat/pull/56])
- Added support for the Grid Extension `grid:code` field ([#56](https://github.com/stactools-packages/landsat/pull/56))
- Added support for the Projection Extension `proj:centroid` field ([#56](https://github.com/stactools-packages/landsat/pull/56))

### Removed

Expand Down Expand Up @@ -84,10 +84,10 @@ NOTE: For backwards compatibility, all items under the Added, Changed, and Fixed
### Added

- Collection 2 Level-1 and Level-2 Items from additional instruments and platforms:
- Landsat 1-5 Multispectral Scanner System (MSS, Level-1)
- Landsat 4-5 Thematic Mapper (TM, Level-2)
- Landsat 7 Enhanced Thematic Mapper Plus (ETM+, Level-2)
- Landsat 8*-9 Operational Land Imager and Thermal Infrared Sensor (OLI-TIRS, Level-2)
- Landsat 1-5 Multispectral Scanner System (MSS, Level-1)
- Landsat 4-5 Thematic Mapper (TM, Level-2)
- Landsat 7 Enhanced Thematic Mapper Plus (ETM+, Level-2)
- Landsat 8*-9 Operational Land Imager and Thermal Infrared Sensor (OLI-TIRS, Level-2)
- Collection 2 Level-1 and Level-2 STAC Collections
- Item links to corresponding USGS STAC Items
- Item and Collection DOI links (`scientific` extension) specific to the instrument
Expand All @@ -98,7 +98,7 @@ NOTE: For backwards compatibility, all items under the Added, Changed, and Fixed
### Changed

- Decrease Asset verbosity by moving redundant `projection` extension and `gsd` information from the Assets to Item properties.
- Assets having a different `gsd` than specified in the Item properties now override the Item properties `gsd` with their own `gsd` value (i.e., the thermal bands).
- Assets having a different `gsd` than specified in the Item properties now override the Item properties `gsd` with their own `gsd` value (i.e., the thermal bands).
- Update the `landsat` extension from `v1.1.0` to `v1.1.1`
- Include non-zero `off_nadir` angles for Landsat 8-9
- Switch to [common EO band names](https://github.com/stac-extensions/eo#common-band-names) for Asset keys to address existence of different band numbers for the same EO band between instruments or platforms
Expand All @@ -122,3 +122,5 @@ NOTE: For backwards compatibility, all items under the Added, Changed, and Fixed
[0.2.2]: <https://github.com/stactools-packages/landsat/compare/v0.2.1..v0.2.2>
[0.2.1]: <https://github.com/stactools-packages/landsat/compare/v0.2.0..v0.2.1>
[0.2.0]: <https://github.com/stactools-packages/landsat/releases/tag/v0.2.0>

<!-- markdownlint-disable-file MD024 -->
8 changes: 4 additions & 4 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Contributing
# Contributing

Pull Requests are the primary method of contributing to stactools-packages. Everyone is welcome to submit a stactools-package to describe their data. The intent with this project to get data which can be described by [STAC](https://stacspec.org/) to be built in an open and interoperable manner.

Expand All @@ -23,8 +23,8 @@ of things.
- Make a ticket in the stactools-package data specific repository which is tracked on the [project management board](https://github.com/orgs/stactools-packages/projects/1).
- Highlight if the PR makes breaking changes to the code.


---
Attribution:
- https://docs.github.com/en/communities/
- https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md

- <https://docs.github.com/en/communities/>
- <https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md>
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

- Name: landsat
- Package: `stactools.landsat`
- PyPI: https://pypi.org/project/stactools-landsat/
- PyPI: <https://pypi.org/project/stactools-landsat/>
- Owners:
- @lossyrob
- @pjhartzell
- @gadomski
- Dataset homepages:
- https://www.usgs.gov/landsat-missions
- https://landsat.gsfc.nasa.gov/
- <https://www.usgs.gov/landsat-missions>
- <https://landsat.gsfc.nasa.gov/>
- STAC extensions used:
- [classification](https://github.com/stac-extensions/classification)
- [eo](https://github.com/stac-extensions/eo)
Expand All @@ -23,10 +23,11 @@

This repository will assist you in the generation of STAC files for Landsat datasets. The table below provides an overview on Landsat Mission's sensors and band wavelengths.

<!-- markdownlint-disable MD033 -->
<img width="1147" alt="Landsat Missions - Sensors and Band Wavelengths" src="https://user-images.githubusercontent.com/1312546/190440352-0b6e2c81-f1b4-48ff-bcf1-5b5addba1bd9.png">
<!-- markdownlint-enable MD033 -->

Source: https://pubs.usgs.gov/fs/2015/3081/fs20153081.pdf

Source: <https://pubs.usgs.gov/fs/2015/3081/fs20153081.pdf>

## Examples

Expand Down
5 changes: 4 additions & 1 deletion tests/test_create_stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ def test_item() -> None:

grid = GridExtension.ext(item)
assert grid.code == "WRS2-017036"
assert grid.code == f"WRS{item.properties['landsat:wrs_type']}-{item.properties['landsat:wrs_path']}{item.properties['landsat:wrs_row']}"
assert (
grid.code == f"WRS{item.properties['landsat:wrs_type']}-"
f"{item.properties['landsat:wrs_path']}{item.properties['landsat:wrs_row']}"
)

# non-zero roll handled
assert item.to_dict()["properties"]["view:off_nadir"] != 0
Expand Down