-
Notifications
You must be signed in to change notification settings - Fork 8
Release v0.8.4 #303
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
Release v0.8.4 #303
Changes from all commits
fb51cc2
3e1466a
e6c9418
324a1b2
a8e9b41
9f75e49
dcfa229
e7e7735
647b2a6
9cb982b
bd74cd9
8dcacf0
2d44369
bcd2188
94abeb7
663f9b4
1845795
e79661a
202778e
e719691
1bc66b8
59beafd
d0fa324
ab3b68b
11521f8
1847a55
be02a8c
1a41273
6046068
41a3502
c2e6442
d7dfada
0e1ff7b
abeb3d6
648a71d
36daa2f
636913c
c0cfbad
594ed36
59c6f1f
a714c0c
061159f
0d4a0ce
ef086f0
9ca6cee
0f18cd2
0407c6d
171a63e
d3a8131
386be72
c374816
3ac2292
3ab88bf
32b7d93
de9c4d4
680a707
fd52836
67845fc
c5ef421
2ad717d
9be849c
a69ded7
7a5909a
7b91945
874ad76
a68efb4
8515d1b
b386b0a
f0080f1
8561a9f
8ce4922
47defef
3ad4ae3
b2f90db
28c8684
c849077
e3ccc42
511adb7
abfc6c3
9c27969
d51057b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # These owners will be requested for review when someone opens a pull request. | ||
| * @ASFHyP3/plugins | ||
| * @ASFHyP3/Tools @ASFHyP3/SciDev |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ jobs: | |
| finish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.TOOLS_BOT_PAK }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,10 +5,10 @@ | ||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||
| # Docs: https://github.com/ASFHyP3/actions | |||||||||||||||||||||||
| call-secrets-analysis-workflow: | |||||||||||||||||||||||
| uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.15.0 | |||||||||||||||||||||||
| uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.20.0 | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| call-ruff-workflow: | |||||||||||||||||||||||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
|||||||||||||||||||||||
| uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.15.0 | |||||||||||||||||||||||
| uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.20.0 | |||||||||||||||||||||||
|
|
|||||||||||||||||||||||
| call-mypy-workflow: | |||||||||||||||||||||||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
|||||||||||||||||||||||
| uses: ASFHyP3/actions/.github/workflows/reusable-mypy.yml@v0.15.0 | |||||||||||||||||||||||
| uses: ASFHyP3/actions/.github/workflows/reusable-mypy.yml@v0.20.0 | |||||||||||||||||||||||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Copilot AutofixAI 4 months ago The best way to fix this problem is to add a
Suggested changeset
1
.github/workflows/static-analysis.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,6 @@ | |
|
|
||
| jobs: | ||
| call-bump-version-workflow: | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.15.0 | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.20.0 | ||
| secrets: | ||
| USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }} | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,30 +3,38 @@ name: Test and build | |
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| tags: | ||
| - 'v*' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - develop | ||
|
|
||
| jobs: | ||
| call-pytest-workflow: | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.15.0 | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.20.0 | ||
| permissions: | ||
| contents: read | ||
| with: | ||
| local_package_name: asf_tools | ||
| python_versions: >- # Optional; default shown | ||
| ["3.10", "3.11"] | ||
|
|
||
| call-version-info-workflow: | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.15.0 | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.20.0 | ||
| permissions: | ||
| contents: read | ||
| with: | ||
| python_version: "3.10" | ||
|
|
||
| call-docker-ghcr-workflow: | ||
| needs: call-version-info-workflow | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.15.0 | ||
| uses: ASFHyP3/actions/.github/workflows/reusable-docker-ghcr.yml@v0.20.0 | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| with: | ||
| version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }} | ||
| secrets: | ||
| USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }} | ||
| USER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |
| and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) | ||
| and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [0.8.4] | ||
|
|
||
| ### Changed | ||
| - Various dependencies have been upgraded. | ||
|
|
||
| ### Fixed | ||
| - Support rasters with `nan` nodata values in `read_as_masked_array` | ||
| - Upgraded to [Actions v0.20.0](https://github.com/ASFHyP3/actions/releases/tag/v0.20.0) so that Docker image `latest` tag will correspond to the actual version tag. See https://github.com/ASFHyP3/actions/issues/278 | ||
|
|
||
| ## [0.8.3] | ||
|
|
||
| ### Changed | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,16 +9,14 @@ dependencies: | |
| # For packaging, and testing | ||
| # - arcpy # windows only | ||
| - python-build | ||
| - ruff | ||
| - mypy | ||
| - setuptools>=61 | ||
| - setuptools_scm>=6.2 | ||
| - pytest | ||
| - pytest-console-scripts | ||
| - pytest-cov | ||
| # For running | ||
| - astropy | ||
| - boto3<1.36.0 # FIXME: remove top pin when tests no longer fail | ||
| - boto3>=1.36.0 | ||
| - fiona | ||
| - gdal>=3.7 | ||
| - geopandas | ||
|
|
@@ -33,5 +31,6 @@ dependencies: | |
| - shapely | ||
| - tqdm | ||
| - pip: | ||
| - -r requirements-static.txt | ||
| # for testing | ||
| - gdal-utils | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ classifiers=[ | |
| ] | ||
| dependencies = [ | ||
| "astropy", | ||
| "boto3>=1.36.0", | ||
| "fiona", | ||
| "gdal>=3.3", | ||
| "geopandas", | ||
|
|
@@ -105,6 +106,12 @@ convention = "google" | |
| case-sensitive = true | ||
| lines-after-imports = 2 | ||
|
|
||
| [tool.ruff.lint.flake8-annotations] | ||
| suppress-dummy-args = true | ||
|
|
||
| [tool.ruff.lint.extend-per-file-ignores] | ||
| "tests/*" = ["D1", "ANN"] | ||
|
|
||
| [tool.mypy] | ||
| python_version = "3.10" | ||
| warn_redundant_casts = true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ruff==0.12.3 | ||
| mypy==1.16.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ def prepare_dem_vrt(vrt: str | Path, geometry: ogr.Geometry | BaseGeometry): | |
| if isinstance(geometry, BaseGeometry): | ||
| geometry = ogr.CreateGeometryFromWkb(geometry.wkb) | ||
|
|
||
| assert isinstance(geometry, ogr.Geometry) | ||
| min_lon, max_lon, _, _ = geometry.GetEnvelope() | ||
| if min_lon < -160.0 and max_lon > 160.0: | ||
| raise ValueError(f'asf_tools does not currently support geometries that cross the antimeridian: {geometry}') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
| from collections.abc import Callable | ||
| from pathlib import Path | ||
| from shutil import make_archive | ||
| from typing import Literal | ||
| from typing import Any, Literal | ||
|
|
||
| import numpy as np | ||
| from osgeo import gdal | ||
|
|
@@ -164,7 +164,7 @@ def estimate_flood_depth( | |
|
|
||
| if estimator.lower() == 'nmad': | ||
| hand_mean = np.nanmean(hand[flood_labels == label]) | ||
| hand_std = stats.median_abs_deviation(hand[flood_labels == label], scale='normal', nan_policy='omit') | ||
| hand_std: Any = stats.median_abs_deviation(hand[flood_labels == label], scale='normal', nan_policy='omit') | ||
|
|
||
| if estimator.lower() == 'numpy': | ||
| hand_mean = np.nanmean(hand[flood_labels == label]) | ||
|
|
@@ -260,7 +260,9 @@ def make_flood_map( | |
| padding_mask = vv_array.mask | ||
| del vv_array | ||
|
|
||
| labeled_flood_mask, num_labels = ndimage.label(flood_mask) | ||
| # The return type annotation for ndimage.label is int, which seems incorrect, | ||
| # since the documentation shows an example of unpacking the return value, like we do here. | ||
| labeled_flood_mask, num_labels = ndimage.label(flood_mask) # type: ignore[misc] | ||
| object_slices = ndimage.find_objects(labeled_flood_mask) | ||
| log.info(f'Detected {num_labels} waterbodies...') | ||
| if estimator.lower() == 'iterative': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ def prepare_hand_vrt(vrt: str | Path, geometry: ogr.Geometry | BaseGeometry): | |
| if isinstance(geometry, BaseGeometry): | ||
| geometry = ogr.CreateGeometryFromWkb(geometry.wkb) | ||
|
|
||
| assert isinstance(geometry, ogr.Geometry) | ||
| min_lon, max_lon, _, _ = geometry.GetEnvelope() | ||
| if min_lon < -160.0 and max_lon > 160.0: | ||
| raise ValueError(f'asf_tools does not currently support geometries that cross the antimeridian: {geometry}') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ def _make_histogram(image): | |
| del indices | ||
| size = image.size | ||
| maximum = int(np.ceil(np.amax(image)) + 1) | ||
| histogram = np.zeros((1, maximum)) | ||
| histogram: np.ndarray = np.zeros((1, maximum)) | ||
| for i in range(0, size): | ||
| floor_value = np.floor(image[i]).astype(np.uint8) | ||
| if 0 < floor_value < maximum - 1: | ||
|
|
||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 4 months ago
To fix the problem, add a
permissionsblock at the root level of the workflow or within the specific job that calls the reusable workflow. Since the job only invokes a reusable workflow, and to follow the principle of least privilege, start with the minimal permissions block, such ascontents: read. This limits the permissions granted to the GITHUB_TOKEN for this workflow and any jobs (unless individually overridden). Edit.github/workflows/changelog.ymland insert the permissions block immediately after the workflow'snameand beforeon:so it applies to all jobs by default. No additional imports or definitions are required for this YAML file change.