Skip to content

Commit

Permalink
Merge branch 'develop' into merge_safe
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestfwilliams committed Jul 18, 2024
2 parents 2d050dd + a7f1882 commit 6176b5c
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 29 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ on:
jobs:
call-changelog-check-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
secrets:
USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ASFHyP3/actions/.github/workflows/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/create-jira-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
call-create-jira-issue-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ on:
jobs:
call-labeled-pr-check-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
2 changes: 1 addition & 1 deletion .github/workflows/release-checklist-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
call-release-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
permissions:
pull-requests: write
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
call-release-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
with:
release_prefix: HyP3 ISCE2
secrets:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on: push
jobs:
call-secrets-analysis-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2

call-flake8-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
with:
local_package_names: hyp3_isce2
2 changes: 1 addition & 1 deletion .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
call-bump-version-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
with:
user: tools-bot
email: [email protected]
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ on:
jobs:
call-pytest-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
with:
local_package_name: hyp3_isce2
python_versions: >-
["3.9", "3.10"]
["3.10", "3.11"]
call-version-info-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected]
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
python_version: "3.10"

call-docker-ghcr-workflow:
needs: call-version-info-workflow
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/[email protected].0
uses: ASFHyP3/actions/.github/workflows/[email protected].2
with:
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
release_branch: main
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ 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).

## [1.1.2]
### Fixed
* Renamed `hyp3_isce2.logging` to `hyp3_isce2.logger` to avoid shadowing built-in.
* Source of product start times in `merge_tops_bursts` to use the `asf_search` umm record.

## [1.1.1]
### Fixed
* Upgraded to `dem_sticher>=2.5.6` to resolve geoid download errors. Fixes [#215](https://github.com/ASFHyP3/hyp3-isce2/issues/215)

## [1.1.0]
### Removed
* Support for Python 3.8 and 3.9 has been dropped, 3.10 is now the minimum version.

## [1.0.1]
### Changed
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,37 @@ docker run -it --rm \

**NOTE** Each workflow can also be accessed via an alternative CLI with the format (`[WORKFLOW_NAME] [WORKFLOW_ARGS]`)

#### Docker Outputs

To retain hyp3_isce2 output files running via Docker there are two recommended approaches:

1. Use a volume mount

Add the `-w /tmp -v [localdir]:/tmp` flags after docker run. `-w` changes the working directory of the container to `/tmp` and `-v` will mount whichever local directory you choose so that such that hyp3_isce3 outputs are preserved locally.

1. Copy outputs to remote object storage

Append the `--bucket` and `--bucket-prefix` to [WORKFLOW_ARGS]. *Only the final output files and zipped archive of those files is uploaded.* This also requires that AWS credentials to write to the bucket are available to the running container. For example, to write outputs to a hypothetical bucket `s3://hypothetical-bucket/test-run/`:

```
docker run -it --rm \
-e AWS_ACCESS_KEY_ID=[YOUR_KEY] \
-e AWS_SECRET_ACCESS_KEY=[YOUR_SECRET] \
-e AWS_SESSION_TOKEN=[YOUR_TOKEN] \
-e EARTHDATA_USERNAME=[YOUR_USERNAME_HERE] \
-e EARTHDATA_PASSWORD=[YOUR_PASSWORD_HERE] \
-e ESA_USERNAME=[YOUR_USERNAME_HERE] \
-e ESA_PASSWORD=[YOUR_PASSWORD_HERE] \
ghcr.io/asfhyp3/hyp3-isce2:latest \
++process [WORKFLOW_NAME] \
[WORKFLOW_ARGS] \
--bucket "hypothetical-bucket" \
--bucket-prefix "test-run"
```

Tip: you can use [`docker run --env-file`](https://docs.docker.com/reference/cli/docker/container/run/#env) to capture all the necessary environment variables in a single file.


## Developer Setup
1. Ensure that conda is installed on your system (we recommend using [mambaforge](https://github.com/conda-forge/miniforge#mambaforge) to reduce setup times).
2. Download a local version of the `hyp3-isce2` repository (`git clone https://github.com/ASFHyP3/hyp3-isce2.git`)
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python>=3.9
- python>=3.10
- numpy
- pip
- isce2>=2.6.3
- dem_stitcher>=2.4.0
- dem_stitcher>=2.5.6
- rasterio
- shapely
- jinja2
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "hyp3_isce2"
requires-python = ">=3.8"
requires-python = ">=3.10"
authors = [
{name="tools-bot", email="[email protected]"},
]
Expand All @@ -16,14 +16,12 @@ classifiers=[
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"numpy",
"dem_stitcher>=2.4.0",
"dem_stitcher>=2.5.6",
"rasterio",
"shapely",
"jinja2",
Expand Down
2 changes: 1 addition & 1 deletion src/hyp3_isce2/insar_stripmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from hyp3_isce2 import stripmapapp_alos as stripmapapp
from hyp3_isce2.dem import download_dem_for_isce2
from hyp3_isce2.logging import configure_root_logger
from hyp3_isce2.logger import configure_root_logger

log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/hyp3_isce2/insar_tops.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from hyp3_isce2 import slc
from hyp3_isce2 import topsapp
from hyp3_isce2.dem import download_dem_for_isce2
from hyp3_isce2.logging import configure_root_logger
from hyp3_isce2.logger import configure_root_logger
from hyp3_isce2.s1_auxcal import download_aux_cal
from hyp3_isce2.utils import get_esa_credentials

Expand Down
2 changes: 1 addition & 1 deletion src/hyp3_isce2/insar_tops_burst.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
validate_bursts,
)
from hyp3_isce2.dem import download_dem_for_isce2
from hyp3_isce2.logging import configure_root_logger
from hyp3_isce2.logger import configure_root_logger
from hyp3_isce2.s1_auxcal import download_aux_cal
from hyp3_isce2.utils import (
ParameterFile,
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/hyp3_isce2/merge_tops_bursts.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ def get_burst_metadata(product_paths: Iterable[Path]) -> Iterable[BurstProduct]:
burst_ids = [result.properties['burst']['relativeBurstID'] for result in results]
burst_indexes = [result.properties['burst']['burstIndex'] for result in results]
polarization = [result.properties['polarization'] for result in results]
start_utc = [
datetime.datetime.strptime(result.properties['startTime'], '%Y-%m-%dT%H:%M:%S.%fZ') for result in results
]

start_utc_strs = [result.umm['TemporalExtent']['RangeDateTime']['BeginningDateTime'] for result in results]
start_utc = [datetime.datetime.strptime(utc, '%Y-%m-%dT%H:%M:%S.%fZ') for utc in start_utc_strs]
relative_orbits = [result.properties['pathNumber'] for result in results]
n_lines = [int(meta['Radarnlines']) for meta in metas]
n_samples = [int(meta['Radarnsamples']) for meta in metas]
Expand Down
3 changes: 2 additions & 1 deletion src/hyp3_isce2/water_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def create_water_mask(input_image: str, output_image: str, gdal_format='ISCE', t
merged_warped_path,
f'--outfile={output_image}',
'--calc="numpy.abs((A.astype(numpy.int16) + 1) - 2)"', # Change 1's to 0's and 0's to 1's.
f'--format={gdal_format}'
f'--format={gdal_format}',
'--overwrite',
]
subprocess.run(flip_values_command, check=True)
6 changes: 4 additions & 2 deletions tests/test_merge_tops_bursts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ def mock_asf_search_results(
path_number: int,
) -> asf_search.ASFSearchResults:
product = asf_search.ASFProduct()
product.umm = {'InputGranules': [slc_name]}
product.umm = {
'InputGranules': [slc_name],
'TemporalExtent': {'RangeDateTime': {'BeginningDateTime': '2020-06-04T02:23:13.963847Z'}},
}
product.properties.update(
{
'burst': {'subswath': subswath, 'burstIndex': burst_index, 'relativeBurstID': burst_id},
'polarization': polarization,
'url': f'https://foo.com/{slc_name}/baz.zip',
'startTime': '2020-06-04T02:23:13.963847Z',
'pathNumber': path_number,
}
)
Expand Down

0 comments on commit 6176b5c

Please sign in to comment.