Skip to content

Commit

Permalink
MAINT: deprecate AvailabilityMixin and its to be inherited properties
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Apr 20, 2023
1 parent df1642b commit c32f563
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pyvo/dal/vosi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
from itertools import chain
import requests

from astropy.utils.decorators import lazyproperty
from astropy.utils.decorators import lazyproperty, deprecated

from .exceptions import DALServiceError
from ..io import vosi
from ..utils.url import url_sibling
from ..utils.decorators import stream_decode_content, response_decode_content
from ..utils.http import use_session

__all__ = [
'AvailabilityMixin', 'CapabilityMixin', 'VOSITables']
__all__ = ['CapabilityMixin', 'VOSITables']


class EndpointMixin():
Expand Down Expand Up @@ -44,10 +43,12 @@ def _get_endpoint(self, endpoint):
return response.raw


@deprecated(since="1.5")
class AvailabilityMixin(EndpointMixin):
"""
Mixing for VOSI availability
"""
@deprecated(since="1.5")
@stream_decode_content
def _availability(self):
"""
Expand All @@ -57,17 +58,20 @@ def _availability(self):
return self._get_endpoint('availability')

@lazyproperty
@deprecated(since="1.5")
def availability(self):
return vosi.parse_availability(self._availability().read)

@property
@deprecated(since="1.5")
def available(self):
"""
True if the service is available, False otherwise
"""
return self.availability.available

@property
@deprecated(since="1.5")
def up_since(self):
"""
datetime the service was started
Expand Down

0 comments on commit c32f563

Please sign in to comment.