Skip to content

Commit

Permalink
adds DATASET constants, limits constant imports to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kim committed Nov 15, 2023
1 parent bee8d92 commit 2fdcfc2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion asf_search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
from .ASFProduct import ASFProduct
from .ASFSearchResults import ASFSearchResults
from .ASFSearchOptions import ASFSearchOptions, validators
from .constants import BEAMMODE, FLIGHT_DIRECTION, INSTRUMENT, PLATFORM, POLARIZATION, PRODUCT_TYPE, INTERNAL, DATASET
from .exceptions import *
from .constants import *
from .health import *
from .search import *
from .download import *
Expand Down
14 changes: 14 additions & 0 deletions asf_search/constants/DATASET.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SENTINEL1 = 'SENTINEL-1'
OPERA_S1 = 'OPERA-S1'
SLC_BURST = 'SLC-BURST'
ALOS_PALSAR = 'ALOS PALSAR'
ALOS_AVNIR_2 = 'ALOS AVNIR-2'
SIRC = 'SIR-C'
ARIA_S1_GUNW = 'ARIA S1 GUNW'
SMAP = 'SMAP'
UAVSAR = 'UAVSAR'
RADARSAT_1 = 'RADARSAT-1'
ERS = 'ERS'
JERS_1 = 'JERS-1'
AIRSAR = 'AIRSAR'
SEASAT = 'SEASAT'
1 change: 1 addition & 0 deletions asf_search/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from .POLARIZATION import *
from .PRODUCT_TYPE import *
from .INTERNAL import *
from .DATASET import *
5 changes: 3 additions & 2 deletions asf_search/search/error_reporting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Dict
from asf_search import ASFSearchOptions, ERROR_REPORTING_ENDPOINT
from asf_search import ASFSearchOptions
from asf_search import INTERNAL
import requests
import logging

Expand All @@ -19,7 +20,7 @@ def report_search_error(search_options: ASFSearchOptions, message: str):
message=f"Error Message: {str(message)}\nUser Agent: {user_agent} \
\nSearch Options: {{\n{search_options_list}\n}}"

response = requests.post(f'https://{ERROR_REPORTING_ENDPOINT}', data={'Message': "This error message and info was automatically generated:\n\n" + message})
response = requests.post(f'https://{INTERNAL.ERROR_REPORTING_ENDPOINT}', data={'Message': "This error message and info was automatically generated:\n\n" + message})

try:
response.raise_for_status()
Expand Down

0 comments on commit 2fdcfc2

Please sign in to comment.