Skip to content

Commit

Permalink
removes PR trigger for pytest workflow, update example
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed Aug 2, 2024
1 parent 7676949 commit 651f4b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: tests

on: [pull_request, push]
on: [push]

jobs:
run-tests:
Expand Down
21 changes: 6 additions & 15 deletions examples/Advanced-Custom-ASFProduct-Subclassing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
"- `get_stack_opts()` (returns None in `ASFProduct`, implemented by `ASFStackableProduct` subclass and its subclasses)\n",
"- `centroid()`\n",
"- `remotezip()` (requires asf-search's optional dependency be installed)\n",
"- `get_property_paths()` (gets product's keywords and their paths in umm dictionary)\n",
"- `translate_product()` (reads properties from umm, populates `properties` with associated keyword)\n",
"- `get_sort_keys()`\n",
"- `umm_get()`\n",
"\n",
"Key Properties:\n",
"- `properties`\n",
"- `_base_properties` (What `get_property_paths()` uses to find values in umm json `properties`)\n",
"- `_base_properties` (maps `properties` keys to values in umm json)\n",
"- `umm` (The product's umm JSON from CMR)\n",
"- `metadata` (The product's metadata JSON from CMR)"
]
Expand Down Expand Up @@ -196,12 +195,13 @@
" self.timestamp = datetime.now()\n",
"\n",
" # _base_properties is a special dict of ASFProduct that maps keywords to granule UMM json\n",
" # defining properties and their paths here in conjunction with `get_property_paths()` \n",
" # will let you easily access them in the product's `properties` dictionary\n",
" # defining properties and their paths here will let you\n",
" # easily access them in the product's `properties` dictionary\n",
" # see `ASFProduct.umm_get()` for explanation of pathing\n",
" _base_properties = {\n",
" # Most product types use `CENTER_ESA_FRAME` as the value for `frameNumber` (unlike S1 and ALOS, which use `FRAME_NUMBER`), \n",
" # this creates a new `esaFrame` property so we have that value too\n",
" **asf.S1Product._base_properties,\n",
" 'esaFrame': {'path': ['AdditionalAttributes', ('Name', 'CENTER_ESA_FRAME'), 'Values', 0], 'cast': try_parse_int}, #Sentinel and ALOS product alt for frameNumber (ESA_FRAME)\n",
" }\n",
"\n",
Expand Down Expand Up @@ -234,16 +234,7 @@
" output['properties']['timestamp'] = str(self.timestamp)\n",
" output['properties']['ASFSearchVersion'] = asf.__version__\n",
" return output\n",
" \n",
" # This method is used internally by `ASFProduct.translate_product()` \n",
" # to traverse the granule UMM for each property's corresponding values\n",
" @staticmethod\n",
" def get_property_paths() -> dict:\n",
" return {\n",
" **asf.S1Product.get_property_paths(),\n",
" **MyCustomS1Subclass._base_properties\n",
" }\n",
" \n",
"\n",
" # ASFProduct.stack() normally stacks the current product\n",
" # in this version we search for every SLC-BURST product that\n",
" # overlaps the given area with the same source scene, \n",
Expand Down Expand Up @@ -367,7 +358,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 651f4b4

Please sign in to comment.