Skip to content

Commit

Permalink
getting default timeout value directly from conf
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymedina committed May 1, 2023
1 parent a48af83 commit a8b15ad
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions astroquery/mast/cutouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from astropy.table import Table
from astropy.io import fits

from . import conf
from .. import log
from ..exceptions import InputWarning, LargeQueryWarning, NoResultsWarning, InvalidQueryError

Expand Down Expand Up @@ -150,11 +151,6 @@ def __init__(self):
}
self._service_api_connection.set_service_params(services, "tesscut")

def _get_default_timeout(self):
""" Gets the default request timeout limit. """

return self._service_api_connection.TIMEOUT

def get_sectors(self, *, coordinates=None, radius=0*u.deg, product='SPOC', objectname=None,
moving_target=False, mt_type=None):

Expand Down Expand Up @@ -344,7 +340,7 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, product='SP

# Modify TIMEOUT attribute if necessary (usually this is modified for large requests)
if timeout:
default_timeout = self._get_default_timeout()
default_timeout = conf.timeout
self._service_api_connection.TIMEOUT = timeout
log.info(f"Request timeout upper limit is being changed to {self._service_api_connection.TIMEOUT}"

Check warning on line 345 in astroquery/mast/cutouts.py

View check run for this annotation

Codecov / codecov/patch

astroquery/mast/cutouts.py#L343-L345

Added lines #L343 - L345 were not covered by tests
" seconds.")
Expand Down Expand Up @@ -488,7 +484,7 @@ def get_cutouts(self, *, coordinates=None, size=5, product='SPOC', sector=None,

# Modify TIMEOUT attribute if necessary (usually this is modified for large requests)
if timeout:
default_timeout = self._get_default_timeout()
default_timeout = conf.timeout
self._service_api_connection.TIMEOUT = timeout
log.info(f"Request timeout upper limit is being changed to {self._service_api_connection.TIMEOUT}"

Check warning on line 489 in astroquery/mast/cutouts.py

View check run for this annotation

Codecov / codecov/patch

astroquery/mast/cutouts.py#L487-L489

Added lines #L487 - L489 were not covered by tests
" seconds.")
Expand Down

0 comments on commit a8b15ad

Please sign in to comment.