Skip to content

Commit 6387e3e

Browse files
committed
EHSTPCR-1113: check_gz private
1 parent 888d5ca commit 6387e3e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

astroquery/esa/hubble/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
from . import conf
2626
from astroquery import log
2727

28-
__all__ = ['ESAHubble', 'ESAHubbleClass']
28+
__all__ = ['ESAHubble', 'ESAHubbleClass', '_check_rename_to_gz']
2929

3030

31-
def check_rename_to_gz(filename):
31+
def _check_rename_to_gz(filename):
3232
rename = False
3333
if os.path.exists(filename):
3434
with open(filename, 'rb') as test_f:
@@ -123,7 +123,7 @@ def download_product(self, observation_id, *, calibration_level=None,
123123
filename = self._get_product_filename(product_type, filename)
124124
self._tap.load_data(params_dict=params, output_file=filename, verbose=verbose)
125125

126-
return check_rename_to_gz(filename=filename)
126+
return _check_rename_to_gz(filename=filename)
127127

128128
def __set_product_type(self, product_type):
129129
if product_type:
@@ -336,7 +336,7 @@ def download_file(self, file, *, filename=None, verbose=False):
336336

337337
self._tap.load_data(params_dict=params, output_file=filename, verbose=verbose)
338338

339-
return check_rename_to_gz(filename=filename)
339+
return _check_rename_to_gz(filename=filename)
340340

341341
def get_postcard(self, observation_id, *, calibration_level="RAW",
342342
resolution=256, filename=None, verbose=False):

astroquery/esa/hubble/tests/test_esa_hubble.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from requests.models import Response
2424

2525
from astroquery.esa.hubble import ESAHubbleClass
26-
from astroquery.esa.hubble.core import check_rename_to_gz
26+
from astroquery.esa.hubble.core import _check_rename_to_gz
2727
from astroquery.esa.hubble.tests.dummy_tap_handler import DummyHubbleTapHandler
2828
from astropy.utils.exceptions import AstropyDeprecationWarning
2929

@@ -271,7 +271,7 @@ def test_download_fits(self, mock_associated_files):
271271
def test_is_not_gz(self, tmp_path):
272272
target_file = data_path('cone_search.vot')
273273
ESAHubbleClass(tap_handler=self.get_dummy_tap_handler(), show_messages=False)
274-
assert check_rename_to_gz(target_file) == target_file
274+
assert _check_rename_to_gz(target_file) == target_file
275275

276276
def test_is_gz(self, tmp_path):
277277
ESAHubbleClass(tap_handler=self.get_dummy_tap_handler(), show_messages=False)
@@ -282,7 +282,7 @@ def test_is_gz(self, tmp_path):
282282
f.write(b'')
283283
# with open(test_file, 'rb') as f_in, gzip.open(target_file, 'wb') as f_out:
284284
# f_out.writelines(f_in)
285-
assert check_rename_to_gz(target_file) == target_file + '.fits.gz'
285+
assert _check_rename_to_gz(target_file) == target_file + '.fits.gz'
286286

287287
def test_get_columns(self):
288288
parameters = {'table_name': "table",

0 commit comments

Comments
 (0)