-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #310 from asfadmin/master
V8.0.0 Release
- Loading branch information
Showing
90 changed files
with
4,865 additions
and
3,426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
on: push | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .ASFSearchOptions import ASFSearchOptions | ||
from .validators import * | ||
from .ASFSearchOptions import ASFSearchOptions # noqa F401 | ||
from .validators import * # noqa F401 F403 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,85 @@ | ||
from asf_search import ASF_LOGGER | ||
|
||
from .validators import ( | ||
parse_string, parse_float, parse_wkt, parse_date, | ||
parse_string_list, parse_int_list, parse_int_or_range_list, | ||
parse_float_or_range_list, parse_cmr_keywords_list, | ||
parse_session | ||
parse_string, | ||
parse_float, | ||
parse_wkt, | ||
parse_date, | ||
parse_string_list, | ||
parse_int_list, | ||
parse_int_or_range_list, | ||
parse_float_or_range_list, | ||
parse_cmr_keywords_list, | ||
parse_session, | ||
parse_circle, | ||
parse_linestring, | ||
parse_point, | ||
) | ||
|
||
|
||
def validate(key, value): | ||
if key not in validator_map: | ||
error_msg = f"Key '{key}' is not a valid search option." | ||
error_msg = f'Key "{key}" is not a valid search option.' | ||
# See if they just missed up case sensitivity: | ||
for valid_key in validator_map: | ||
if key.lower() == valid_key.lower(): | ||
error_msg += f" (Did you mean '{valid_key}'?)" | ||
error_msg += f' (Did you mean "{valid_key}"?)' | ||
break | ||
ASF_LOGGER.error(error_msg) | ||
raise KeyError(error_msg) | ||
try: | ||
return validator_map[key](value) | ||
except ValueError as exc: | ||
ASF_LOGGER.exception(f"Failed to parse item in ASFSearchOptions: {key=} {value=} {exc=}") | ||
ASF_LOGGER.exception(f'Failed to parse item in ASFSearchOptions: {key=} {value=} {exc=}') | ||
raise | ||
|
||
|
||
validator_map = { | ||
# Search parameters Parser | ||
'maxResults': int, | ||
'absoluteOrbit': parse_int_or_range_list, | ||
'asfFrame': parse_int_or_range_list, | ||
'beamMode': parse_string_list, | ||
'beamSwath': parse_string_list, | ||
'campaign': parse_string, | ||
'maxDoppler': parse_float, | ||
'minDoppler': parse_float, | ||
'maxFaradayRotation': parse_float, | ||
'minFaradayRotation': parse_float, | ||
'flightDirection': parse_string, | ||
'flightLine': parse_string, | ||
'frame': parse_int_or_range_list, | ||
'granule_list': parse_string_list, | ||
'product_list': parse_string_list, | ||
'intersectsWith': parse_wkt, | ||
'lookDirection': parse_string, | ||
'offNadirAngle': parse_float_or_range_list, | ||
'platform': parse_string_list, | ||
'polarization': parse_string_list, | ||
'processingLevel': parse_string_list, | ||
'relativeOrbit': parse_int_or_range_list, | ||
'processingDate': parse_date, | ||
'start': parse_date, | ||
'end': parse_date, | ||
'season': parse_int_list, | ||
'groupID': parse_string_list, | ||
'insarStackId': parse_string, | ||
'instrument': parse_string, | ||
'collections': parse_string_list, | ||
'shortName': parse_string_list, | ||
'temporalBaselineDays': parse_string_list, | ||
'operaBurstID': parse_string_list, | ||
'absoluteBurstID': parse_int_list, | ||
'relativeBurstID': parse_int_list, | ||
'fullBurstID': parse_string_list, | ||
'dataset': parse_string_list, | ||
'cmr_keywords': parse_cmr_keywords_list, | ||
|
||
'maxResults': int, | ||
'absoluteOrbit': parse_int_or_range_list, | ||
'asfFrame': parse_int_or_range_list, | ||
'beamMode': parse_string_list, | ||
'beamSwath': parse_string_list, | ||
'campaign': parse_string, | ||
'circle': parse_circle, | ||
'linestring': parse_linestring, | ||
'point': parse_point, | ||
'maxDoppler': parse_float, | ||
'minDoppler': parse_float, | ||
'maxFaradayRotation': parse_float, | ||
'minFaradayRotation': parse_float, | ||
'flightDirection': parse_string, | ||
'flightLine': parse_string, | ||
'frame': parse_int_or_range_list, | ||
'granule_list': parse_string_list, | ||
'product_list': parse_string_list, | ||
'intersectsWith': parse_wkt, | ||
'lookDirection': parse_string, | ||
'offNadirAngle': parse_float_or_range_list, | ||
'platform': parse_string_list, | ||
'polarization': parse_string_list, | ||
'processingLevel': parse_string_list, | ||
'relativeOrbit': parse_int_or_range_list, | ||
'processingDate': parse_date, | ||
'start': parse_date, | ||
'end': parse_date, | ||
'season': parse_int_list, | ||
'groupID': parse_string_list, | ||
'insarStackId': parse_string, | ||
'instrument': parse_string, | ||
'collections': parse_string_list, | ||
'shortName': parse_string_list, | ||
'temporalBaselineDays': parse_string_list, | ||
'operaBurstID': parse_string_list, | ||
'absoluteBurstID': parse_int_list, | ||
'relativeBurstID': parse_int_list, | ||
'fullBurstID': parse_string_list, | ||
'dataset': parse_string_list, | ||
'cmr_keywords': parse_cmr_keywords_list, | ||
# Config parameters Parser | ||
'session': parse_session, | ||
'host': parse_string, | ||
'provider': parse_string, | ||
'collectionAlias': bool, | ||
'session': parse_session, | ||
'host': parse_string, | ||
'provider': parse_string, | ||
'collectionAlias': bool, | ||
} |
Oops, something went wrong.