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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ indent_size = unset

[*.yml]
indent_size = 2

[*.yaml]
indent_size = 2
21 changes: 3 additions & 18 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ on:
pull_request:

jobs:
codecov:
name: codecov
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: true
steps:
- uses: actions/checkout@v2
- name: Execute linters and test suites
run: ./docker/cibuild
- name: Upload All coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false
python-matrix:
name: python-matrix
runs-on: ubuntu-latest
Expand All @@ -32,15 +17,15 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5
- name: Set up conda cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ hashFiles('**/environment.yml') }}
restore-keys: ${{ runner.os }}-conda-
- name: Set up pip cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg', '**/requirements-dev.txt') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v5

- name: Set up Python 3.x
uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
rev: v1.14.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ mypy
pre-commit
pytest
pytest-cov
requests
10 changes: 6 additions & 4 deletions src/stactools/sentinel3/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def product_type(source, datatype):


def get_array_shape(
asset_shape: List[Dict[str, int]], item_shape: List[int]
asset_shape: Optional[List[Dict[str, int]]], item_shape: List[int]
) -> List[int]:
asset_reshaped: Dict[str, int]
if asset_shape is None:
Expand All @@ -130,7 +130,7 @@ def get_array_shape(
asset_reshaped = dict(*zip(*[a.items() for a in asset_shape]))
else:
logger.debug(
"structure of asset level 's3:shape' doesn't match " "expectation: %s",
"structure of asset level 's3:shape' doesn't match expectation: %s",
asset_shape,
)
asset_reshaped = {}
Expand Down Expand Up @@ -283,7 +283,9 @@ def create_item(
asset.extra_fields.pop("file:local_path", None)

# ensure shape is set at asset level
asset_shape = asset.extra_fields.get("s3:shape", None)
asset_shape: Optional[List[Dict[str, int]]] = asset.extra_fields.get(
"s3:shape", None
)
s3shape: List[int] = []
if asset_shape or item_shape and asset_key != "safe-manifest":
s3shape = get_array_shape(asset_shape, item_shape)
Expand Down Expand Up @@ -334,7 +336,7 @@ def create_item(
geometry_dict["coordinates"] = [coords[::-1]]
elif winding is None:
logger.warning(
"Could not determine winding order of polygon in " f"Item: '{item.id}'"
f"Could not determine winding order of polygon in Item: '{item.id}'"
)

geometry = shapely.geometry.shape(geometry_dict)
Expand Down
Loading