Skip to content

Commit

Permalink
Merge pull request #304 from ASFHyP3/develop
Browse files Browse the repository at this point in the history
Release v7.0.2
  • Loading branch information
jtherrmann authored Dec 19, 2024
2 parents d391cbc + 60da8e5 commit e310f39
Show file tree
Hide file tree
Showing 23 changed files with 588 additions and 522 deletions.
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-changelog-check.yml@v0.12.0
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-create-jira-issue.yml@v0.12.0
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
Expand Down
6 changes: 3 additions & 3 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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-version-info.yml@v0.12.0
with:
python_version: "3.10"

Expand All @@ -21,7 +21,7 @@ jobs:
with:
fetch-depth: 0

- uses: mamba-org/setup-micromamba@v1
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml

Expand All @@ -31,7 +31,7 @@ jobs:
python -m build
- name: upload to PyPI.org
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.12.3
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-labeled-pr-check.yml@v0.12.0
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-release-checklist-comment.yml@v0.12.0
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-release.yml@v0.12.0
with:
release_prefix: HyP3 SDK
secrets:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Static analysis
on: push

jobs:
call-flake8-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-flake8.yml@v0.11.2
with:
local_package_names: hyp3_sdk

call-secrets-analysis-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.11.2
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-secrets-analysis.yml@v0.12.0

call-ruff-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-ruff.yml@v0.13.2
4 changes: 3 additions & 1 deletion .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

jobs:
call-bump-version-workflow:
uses: ASFHyP3/actions/.github/workflows/reusable-bump-version.yml@v0.11.2
# 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.12.0
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.11.2
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.12.0
with:
local_package_name: hyp3_sdk
python_versions: >-
Expand Down
55 changes: 0 additions & 55 deletions .gitleaks.toml

This file was deleted.

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.0.2]

### Changed
* The [`static-analysis`](.github/workflows/static-analysis.yml) Github Actions workflow now uses `ruff` rather than `flake8` for linting.

## [7.0.1]

### Removed
Expand Down
45 changes: 24 additions & 21 deletions docs/sdk_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"source": [
"# initial setup\n",
"import asf_search as asf\n",
"\n",
"import hyp3_sdk as sdk"
]
},
Expand Down Expand Up @@ -157,34 +158,32 @@
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"from typing import Optional\n",
"\n",
"def get_nearest_neighbors(granule: str, max_neighbors: Optional[int] = None) -> asf.ASFSearchResults:\n",
" granule = asf.granule_search(granule)[-1]\n",
" stack = reversed([item for item in granule.stack() if item.properties['temporalBaseline'] < 0])\n",
" return asf.ASFSearchResults(stack)[:max_neighbors]"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
"outputs": [],
"source": [
"def get_nearest_neighbors(granule: str, max_neighbors: int | None = None) -> asf.ASFSearchResults:\n",
" granule = asf.granule_search(granule)[-1]\n",
" stack = reversed([item for item in granule.stack() if item.properties['temporalBaseline'] < 0])\n",
" return asf.ASFSearchResults(stack)[:max_neighbors]"
]
},
{
"cell_type": "markdown",
"source": [
"Now, using the example granule list for our RTC jobs as the reference scenes, we can find their nearest and next-nearest neighbor granules, and submit them\n",
"as pairs for InSAR processing."
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
},
"source": [
"Now, using the example granule list for our RTC jobs as the reference scenes, we can find their nearest and next-nearest neighbor granules, and submit them\n",
"as pairs for InSAR processing."
]
},
{
"cell_type": "code",
Expand All @@ -194,6 +193,7 @@
"source": [
"from tqdm.auto import tqdm # For a nice progress bar: https://github.com/tqdm/tqdm#ipython-jupyter-integration\n",
"\n",
"\n",
"insar_jobs = sdk.Batch()\n",
"for reference in tqdm(granules):\n",
" neighbors = get_nearest_neighbors(reference, max_neighbors=2)\n",
Expand Down Expand Up @@ -235,14 +235,17 @@
"source": [
"autorift_pairs = [\n",
" # Sentinel-1 ESA granule IDs\n",
" ('S1A_IW_SLC__1SSH_20170221T204710_20170221T204737_015387_0193F6_AB07',\n",
" 'S1B_IW_SLC__1SSH_20170227T204628_20170227T204655_004491_007D11_6654'),\n",
" (\n",
" 'S1A_IW_SLC__1SSH_20170221T204710_20170221T204737_015387_0193F6_AB07',\n",
" 'S1B_IW_SLC__1SSH_20170227T204628_20170227T204655_004491_007D11_6654',\n",
" ),\n",
" # Sentinel-2 ESA granule IDs\n",
" ('S2B_MSIL1C_20200612T150759_N0209_R025_T22WEB_20200612T184700',\n",
" 'S2A_MSIL1C_20200627T150921_N0209_R025_T22WEB_20200627T170912'),\n",
" (\n",
" 'S2B_MSIL1C_20200612T150759_N0209_R025_T22WEB_20200612T184700',\n",
" 'S2A_MSIL1C_20200627T150921_N0209_R025_T22WEB_20200627T170912',\n",
" ),\n",
" # Landsat 8\n",
" ('LC08_L1TP_009011_20200703_20200913_02_T1',\n",
" 'LC08_L1TP_009011_20200820_20200905_02_T1'),\n",
" ('LC08_L1TP_009011_20200703_20200913_02_T1', 'LC08_L1TP_009011_20200820_20200905_02_T1'),\n",
"]\n",
"\n",
"autorift_jobs = sdk.Batch()\n",
Expand Down
136 changes: 73 additions & 63 deletions docs/search_other_user_jobs.ipynb
Original file line number Diff line number Diff line change
@@ -1,66 +1,76 @@
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8"
},
"kernelspec": {
"name": "python",
"display_name": "Python (Pyodide)",
"language": "python"
}
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": "# Using the HyP3 SDK to search for jobs run by another user\n\nTo facilitate collaboration, HyP3 allows you to search for jobs run by other users.\n\nFollow [Using the HyP3 SDK for Python](https://nbviewer.jupyter.org/github/ASFHyP3/hyp3-sdk/blob/main/docs/sdk_example.ipynb) to install the `hyp3-sdk` package (version `2.1.1` or higher) and authenticate using your Earthdata credentials.\n\nSuppose you have run a number of RTC jobs with the name `rtc-example`. You can search for them using `find_jobs`:"
},
"nbformat_minor": 4,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": "# Using the HyP3 SDK to search for jobs run by another user\n\nTo facilitate collaboration, HyP3 allows you to search for jobs run by other users.\n\nFollow [Using the HyP3 SDK for Python](https://nbviewer.jupyter.org/github/ASFHyP3/hyp3-sdk/blob/main/docs/sdk_example.ipynb) to install the `hyp3-sdk` package (version `2.1.1` or higher) and authenticate using your Earthdata credentials.\n\nSuppose you have run a number of RTC jobs with the name `rtc-example`. You can search for them using `find_jobs`:",
"metadata": {}
},
{
"cell_type": "code",
"source": "from hyp3_sdk import HyP3\nhyp3 = HyP3()\nmy_rtc_jobs = hyp3.find_jobs(name='rtc-example')",
"metadata": {},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": "Suppose that you are working with another user who has also run a number of RTC jobs with the same name. You can search for those jobs by providing the `user_id` parameter:",
"metadata": {}
},
{
"cell_type": "code",
"source": "other_user_rtc_jobs = hyp3.find_jobs(name='rtc-example', user_id='other_user')",
"metadata": {},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": "Or, suppose that the other user has run a number of InSAR jobs with the name `insar-example`:",
"metadata": {}
},
{
"cell_type": "code",
"source": "other_user_insar_jobs = hyp3.find_jobs(name='insar-example', user_id='other_user')",
"metadata": {},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": "You can provide the `user_id` parameter with any combination of other parameters supported by `find_jobs`. This allows you to search for jobs run by other users just as you would search for your own jobs.\n\nIf the `user_id` parameter is not provided, jobs are returned for the currently authenticated user.",
"metadata": {}
}
]
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from hyp3_sdk import HyP3\n",
"\n",
"\n",
"hyp3 = HyP3()\n",
"my_rtc_jobs = hyp3.find_jobs(name='rtc-example')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": "Suppose that you are working with another user who has also run a number of RTC jobs with the same name. You can search for those jobs by providing the `user_id` parameter:"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"other_user_rtc_jobs = hyp3.find_jobs(name='rtc-example', user_id='other_user')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": "Or, suppose that the other user has run a number of InSAR jobs with the name `insar-example`:"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"other_user_insar_jobs = hyp3.find_jobs(name='insar-example', user_id='other_user')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": "You can provide the `user_id` parameter with any combination of other parameters supported by `find_jobs`. This allows you to search for jobs run by other users just as you would search for your own jobs.\n\nIf the `user_id` parameter is not provided, jobs are returned for the currently authenticated user."
}
],
"metadata": {
"kernelspec": {
"display_name": "Python (Pyodide)",
"language": "python",
"name": "python"
},
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit e310f39

Please sign in to comment.