Skip to content

Commit

Permalink
Merge pull request #309 from asfadmin/master
Browse files Browse the repository at this point in the history
Patch Release v7.1.4
  • Loading branch information
SpicyGarlicAlbacoreRoll authored Jul 16, 2024
2 parents 1d521bd + 28f9f1f commit 1c69922
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-->
------
## [v7.1.4](https://github.com/asfadmin/Discovery-asf_search/compare/v7.1.3...v7.1.4)
### Changed
- replaces `ciso8601` package with `dateutil` for package wheel compatibility. `ciso8601` used when installed via `extra` dependency
### Fixed
- Fixes syntax warning with escaped slash in `translate.py`

------
## [v7.1.3](https://github.com/asfadmin/Discovery-asf_search/compare/v7.1.2...v7.1.3)
### Fixed
Expand Down
10 changes: 7 additions & 3 deletions asf_search/CMR/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
from shapely.geometry.base import BaseGeometry
from .field_map import field_map
from .datasets import collections_per_platform
import ciso8601
import logging

try:
from ciso8601 import parse_datetime
except ImportError:
from dateutil.parser import parse as parse_datetime


def translate_opts(opts: ASFSearchOptions) -> List:
# Need to add params which ASFSearchOptions cant support (like temporal),
Expand All @@ -22,7 +26,7 @@ def translate_opts(opts: ASFSearchOptions) -> List:
# intersectsWith, temporal, and other keys you don't want to escape, so keep whitelist instead
for escape_commas in ["campaign"]:
if escape_commas in dict_opts:
dict_opts[escape_commas] = dict_opts[escape_commas].replace(",", "\,")
dict_opts[escape_commas] = dict_opts[escape_commas].replace(",", "\\,")

# Special case to unravel WKT field a little for compatibility
if "intersectsWith" in dict_opts:
Expand Down Expand Up @@ -158,7 +162,7 @@ def try_parse_date(value: str) -> Optional[str]:
return None

try:
date = ciso8601.parse_datetime(value)
date = parse_datetime(value)
except ValueError:
return None

Expand Down
8 changes: 6 additions & 2 deletions asf_search/baseline/calc.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from asf_search import ASFProduct
from math import sqrt, cos, sin, radians
from typing import List

import numpy as np
from ciso8601 import parse_datetime

from asf_search import ASFProduct
try:
from ciso8601 import parse_datetime
except ImportError:
from dateutil.parser import parse as parse_datetime

# WGS84 constants
a = 6378137
f = pow((1.0 - 1 / 298.257224), 2)
Expand Down
8 changes: 5 additions & 3 deletions asf_search/baseline/stack.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from asf_search import ASFProduct, ASFStackableProduct, ASFSearchResults
from typing import Tuple, List
from ciso8601 import parse_datetime
import pytz

from .calc import calculate_perpendicular_baselines
from asf_search import ASFProduct, ASFStackableProduct, ASFSearchResults

try:
from ciso8601 import parse_datetime
except ImportError:
from dateutil.parser import parse as parse_datetime

def get_baseline_from_stack(reference: ASFProduct, stack: ASFSearchResults) -> Tuple[ASFSearchResults, List[dict]]:
warnings = []
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"importlib_metadata",
"numpy",
"dateparser",
"python-dateutil",
"tenacity == 8.2.2",
"ciso8601"
]

test_requirements = [
Expand All @@ -25,7 +25,8 @@
]

extra_requirements = [
"remotezip>=0.10.0"
"remotezip>=0.10.0",
"ciso8601",
]


Expand Down

0 comments on commit 1c69922

Please sign in to comment.