Skip to content

Commit

Permalink
Merge pull request #316 from ASFHyP3/develop
Browse files Browse the repository at this point in the history
Release v7.1.0
  • Loading branch information
williamh890 authored Feb 28, 2025
2 parents 919fb6d + 1626a77 commit f0eaae5
Show file tree
Hide file tree
Showing 21 changed files with 123 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
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/platform
* @ASFHyP3/Tools @ASFHyP3/SciDev @ASFHyP3/Services
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
labels:
- bumpless
- package-ecosystem: github-actions
directory: /
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:

jobs:
call-changelog-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.17.1
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/reusable-create-jira-issue.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.17.1
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.17.1
with:
python_version: "3.10"

Expand All @@ -31,7 +31,7 @@ jobs:
python -m build
- name: upload to PyPI.org
uses: pypa/gh-action-pypi-publish@v1.12.3
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
user: __token__
password: ${{ secrets.TOOLS_PYPI_PAK }}
2 changes: 1 addition & 1 deletion .github/workflows/labeled-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ on:

jobs:
call-labeled-pr-check-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.17.1
2 changes: 1 addition & 1 deletion .github/workflows/release-template-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.17.1
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 @@ -7,7 +7,7 @@ on:

jobs:
call-release-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.17.1
with:
release_prefix: HyP3 SDK
secrets:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on: push
jobs:
call-secrets-analysis-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.17.1

call-ruff-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.17.1

call-mypy-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-mypy.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-mypy.yml@v0.17.1
2 changes: 1 addition & 1 deletion .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
call-bump-version-workflow:
# For first-time setup, create a v0.0.0 tag as shown here:
# https://github.com/ASFHyP3/actions#reusable-bump-versionyml
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.17.1
secrets:
USER_TOKEN: ${{ secrets.TOOLS_BOT_PAK }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
call-pytest-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.14.0
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.17.1
with:
local_package_name: hyp3_sdk
python_versions: >-
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ 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).

## [7.1.0]

### Added
* Added `HyP3.submit_aria_s1_gunw_job` and `HyP3.prepare_aria_s1_gunw_job` methods for submitting ARIA S1 GUNW jobs to HyP3.

## [7.0.3]

### Changed
Expand Down
130 changes: 0 additions & 130 deletions CODE_OF_CONDUCT.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ rtc_job = hyp3.submit_rtc_job('granule_id', 'job_name')
insar_job = hyp3.submit_insar_job('reference_granule_id', 'secondary_granule_id', 'job_name')
insar_burst_job = hyp3.submit_insar_isce_burst_job('reference_granule_id', 'secondary_granule_id', 'job_name')
autorift_job = hyp3.submit_autorift_job('reference_granule_id', 'secondary_granule_id', 'job_name')
aria_s1_gunw_job = hyp3.submit_aria_s1_gunw_job(['ref_id_1', 'ref_id_2'], ['sec_id_1', 'sec_id_2'], 'frame_id', 'job_name')
```
Each of these functions will return an instance of the `Job` class that represents a new HyP3 job request.

Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ dependencies:
- pip
# For packaging, and testing
- python-build
- ruff
- mypy
- jupyter
- setuptools>=61
- setuptools_scm>=6.2
Expand All @@ -20,3 +18,5 @@ dependencies:
- requests
- tqdm
- urllib3
- pip:
- -r requirements-static.txt
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ convention = "google"
case-sensitive = true
lines-after-imports = 2

[tool.ruff.lint.extend-per-file-ignores]
"tests/*" = ["D100", "D103", "ANN"]

[tool.mypy]
python_version = "3.10"
warn_unused_ignores = true
warn_redundant_casts = true
warn_unreachable = true
strict_equality = true
check_untyped_defs = true
install_types = true
non_interactive = true
pretty = true
disable_error_code = ["import-untyped"]
2 changes: 2 additions & 0 deletions requirements-static.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruff==0.9.7
mypy==1.15.0
46 changes: 46 additions & 0 deletions src/hyp3_sdk/hyp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,52 @@ def prepare_insar_isce_burst_job(
job_dict['name'] = name
return job_dict

def submit_aria_s1_gunw_job(
self, reference: list[str], secondary: list[str], frame_id: int, name: str | None = None
) -> Batch:
"""Submit an ARIA S1 GUNW job.
Args:
reference: The names of the Sentinel-1 SLC granules to use as reference scenes for InSAR processing
secondary: The names of the Sentinel-1 SLC granules to use as secondary scenes for InSAR processing
frame_id: Subset GUNW products to this frame
name: A name for the job (optional)
Returns:
A Batch object containing the ARIA S1 GUNW job
"""
arguments = locals().copy()
arguments.pop('self')
job_dict = self.prepare_aria_s1_gunw_job(**arguments)
return self.submit_prepared_jobs(prepared_jobs=job_dict)

@classmethod
def prepare_aria_s1_gunw_job(
cls, reference: list[str], secondary: list[str], frame_id: int, name: str | None = None
) -> dict:
"""Prepare an ARIA S1 GUNW job.
Args:
reference: The names of the Sentinel-1 SLC granules to use as reference scenes for InSAR processing
secondary: The names of the Sentinel-1 SLC granules to use as secondary scenes for InSAR processing
frame_id: Subset GUNW products to this frame
name: A name for the job
Returns:
A dictionary containing the prepared ARIA S1 GUNW job
"""
job_parameters = locals().copy()
for key in ['cls', 'reference', 'secondary', 'frame_id', 'name']:
job_parameters.pop(key)

job_dict = {
'job_parameters': {'reference': reference, 'secondary': secondary, 'frame_id': frame_id, **job_parameters},
'job_type': 'ARIA_S1_GUNW',
}
if name is not None:
job_dict['name'] = name
return job_dict

def my_info(self) -> dict:
"""Returns:
Your user information
Expand Down
3 changes: 1 addition & 2 deletions src/hyp3_sdk/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def download_files(self, location: Path | str = '.', create: bool = True) -> lis
if self.expired():
assert self.expiration_time is not None
raise HyP3SDKError(
f'Expired jobs cannot be downloaded; '
f'job expired {self.expiration_time.isoformat(timespec="seconds")}.'
f'Expired jobs cannot be downloaded; job expired {self.expiration_time.isoformat(timespec="seconds")}.'
)

if create:
Expand Down
2 changes: 1 addition & 1 deletion src/hyp3_sdk/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_tqdm_progress_bar():
import ipywidgets # noqa: F401
from tqdm.auto import tqdm
except ImportError:
from tqdm.std import tqdm
from tqdm.std import tqdm # type: ignore[assignment]
return tqdm


Expand Down
Loading

0 comments on commit f0eaae5

Please sign in to comment.