Skip to content

Commit

Permalink
ENH: Add some more supported service aliases
Browse files Browse the repository at this point in the history
DODS is considered an alias for OPENDAP. Also add (legacy) support for
'http' as a synonym for HTTPServer.
  • Loading branch information
dopplershift committed Dec 13, 2024
1 parent 823dab1 commit b4350d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/siphon/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ def remote_access(self, service=None, use_xarray=None):
if service is None:
service = 'CdmRemote' if 'CdmRemote' in self.access_urls else 'OPENDAP'

if service not in (CaseInsensitiveStr('CdmRemote'), CaseInsensitiveStr('OPENDAP')):
if service not in (CaseInsensitiveStr('CdmRemote'), CaseInsensitiveStr('OPENDAP'),
CaseInsensitiveStr('DODS')):
raise ValueError(service + ' is not a valid service for remote_access')

return self.access_with_service(service, use_xarray)
Expand Down Expand Up @@ -735,7 +736,7 @@ def access_with_service(self, service, use_xarray=None):
else:
from .cdmr import Dataset as CDMRDataset
provider = CDMRDataset
elif service == 'OPENDAP':
elif service == 'OPENDAP' or service == 'DODS':
if use_xarray:
try:
import xarray as xr
Expand All @@ -753,7 +754,7 @@ def access_with_service(self, service, use_xarray=None):
elif service in self.ncss_service_names:
from .ncss import NCSS
provider = NCSS
elif service == 'HTTPServer':
elif service == 'HTTPServer' or service == CaseInsensitiveStr('http'):
provider = session_manager.urlopen
else:
raise ValueError(service + ' is not an access method supported by Siphon')
Expand Down

0 comments on commit b4350d5

Please sign in to comment.