Skip to content

Commit

Permalink
Merge branch 'master' into cs.searchapi-v3-edits
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed Aug 31, 2023
2 parents 9dc3a33 + e7df54f commit b180715
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-->
------
## [TODO](https://github.com/asfadmin/Discovery-asf_search/compare/v6.6.2...TODO)
## [TODO](https://github.com/asfadmin/Discovery-asf_search/compare/v6.6.3...TODO)
### Added
- Added `asf.ASFSearchOptions(circle=[lat, long, radius])` search param. Takes list of exactly 3 numbers.
- Exposed `asf.validator_map`, which given a ops search param, can be used to look up which method we're going to validate it against.
- Exposed `ASFProduct.get_urls` which returns the URL's for it's products directly. Can control which products with the `fileType` enum.
### Fixed
- Fixed bug in `ASFProduct` where asking for `asf.ADDITIONAL_FILES` on non-burst products would throw a KeyError.
### Changed
- `stack_from_id()` now raises if results are incomplete, before checking if reference was found

------
## [v6.6.3](https://github.com/asfadmin/Discovery-asf_search/compare/v6.6.2...v6.6.3)
### Fixed
- Fixes type hinting compatibility break introduced in v6.6.2 in `search_generator.py` for Python versions < v3.9

------
## [v6.6.2](https://github.com/asfadmin/Discovery-asf_search/compare/v6.6.1...v6.6.2)
Expand Down
5 changes: 2 additions & 3 deletions asf_search/search/search_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Generator, Union, Iterable, Tuple
from typing import Generator, Union, Iterable, Tuple, List
from copy import copy
from requests.exceptions import HTTPError
from requests import ReadTimeout, Response
Expand All @@ -20,7 +20,6 @@
from asf_search.WKT.validate_wkt import validate_wkt
from asf_search.search.error_reporting import report_search_error


def search_generator(
absoluteOrbit: Union[int, Tuple[int, int], Iterable[Union[int, Tuple[int, int]]]] = None,
asfFrame: Union[int, Tuple[int, int], Iterable[Union[int, Tuple[int, int]]]] = None,
Expand Down Expand Up @@ -138,7 +137,7 @@ def query_cmr(session: ASFSession, url: str, translated_opts: dict, sub_query_co
return items, hits, response.headers.get('CMR-Search-After', None)


def process_page(items: list[ASFProduct], max_results: int, subquery_max_results: int, total: int, subquery_count: int, opts: ASFSearchOptions):
def process_page(items: List[ASFProduct], max_results: int, subquery_max_results: int, total: int, subquery_count: int, opts: ASFSearchOptions):
if max_results is None:
last_page = ASFSearchResults(items[:min(subquery_max_results - subquery_count, len(items))], opts=opts)
else:
Expand Down

0 comments on commit b180715

Please sign in to comment.