Skip to content

Commit

Permalink
Use deprecated decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
snbianco authored and bsipocz committed Oct 17, 2024
1 parent 45fe7d2 commit 4e422d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
32 changes: 21 additions & 11 deletions astroquery/mast/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
This the base class for MAST queries.
"""
import warnings

from astropy.utils.exceptions import AstropyDeprecationWarning
from astropy.utils import deprecated
from ..query import QueryWithLogin
from . import utils
from .auth import MastAuth
Expand Down Expand Up @@ -84,21 +82,33 @@ def logout(self):
self._auth_obj.logout()
self._authenticated = False

@deprecated(since='v0.4.8',
message=('This function is non-operational and will be removed in a future release.'))
def enable_cloud_dataset(self, provider="AWS", profile=None, verbose=True):
"""
.. deprecated:: 0.4.8
This function is non-operational and has been deprecated.
Enable downloading public files from S3 instead of MAST.
Requires the boto3 library to function.
Parameters
----------
provider : str
Which cloud data provider to use. We may in the future support multiple providers,
though at the moment this argument is ignored.
profile : str
Profile to use to identify yourself to the cloud provider (usually in ~/.aws/config).
verbose : bool
Default True.
Logger to display extra info and warning.
"""
warnings.warn('This function is non-operational and will be removed in a future release.',
AstropyDeprecationWarning)
pass

Check warning on line 103 in astroquery/mast/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/mast/core.py#L103

Added line #L103 was not covered by tests

@deprecated(since='v0.4.8',
message=('This function is non-operational and will be removed in a future release.'))
def disable_cloud_dataset(self):
"""
.. deprecated:: 0.4.8
This function is non-operational and has been deprecated.
Disables downloading public files from S3 instead of MAST.
"""
warnings.warn('This function is non-operational and will be removed in a future release.',
AstropyDeprecationWarning)
pass

Check warning on line 111 in astroquery/mast/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/mast/core.py#L111

Added line #L111 was not covered by tests

def resolve_object(self, objectname):
"""
Expand Down
2 changes: 1 addition & 1 deletion astroquery/mast/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def enable_cloud_dataset(self, provider="AWS", profile=None, verbose=True):

def disable_cloud_dataset(self):
"""
Disables downloading public files from S3 instead of MAST
Disables downloading public files from S3 instead of MAST.
"""
self._cloud_connection = None

Check warning on line 197 in astroquery/mast/observations.py

View check run for this annotation

Codecov / codecov/patch

astroquery/mast/observations.py#L197

Added line #L197 was not covered by tests

Expand Down

0 comments on commit 4e422d8

Please sign in to comment.