Skip to content

Commit

Permalink
Preserve old .to_<library> behaviour
Browse files Browse the repository at this point in the history
  - Same as 73128a7, but for xarray, iris, ncCF
  • Loading branch information
vinisalazar committed Feb 22, 2023
1 parent 4450b10 commit 5892908
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions erddapy/erddapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def to_ncCF(self, protocol: str = None, **kw):
"""Load the data request into a Climate and Forecast compliant netCDF4-python object."""
protocol = protocol if protocol else self.protocol
url = self.get_download_url(response="ncCF", **kw)
return to_ncCF(url, protocol=protocol, **kw)
return to_ncCF(url, protocol=protocol, requests_kwargs=dict(**kw))

def to_xarray(self, **kw):
"""Load the data request into a xarray.Dataset.
Expand All @@ -365,7 +365,7 @@ def to_xarray(self, **kw):
response = "ncCF"
url = self.get_download_url(response=response)
requests_kwargs = dict(auth=self.auth)
return to_xarray(url, response, requests_kwargs, **kw)
return to_xarray(url, response, requests_kwargs, xarray_kwargs=dict(**kw))

def to_iris(self, **kw):
"""Load the data request into an iris.CubeList.
Expand All @@ -374,7 +374,7 @@ def to_iris(self, **kw):
"""
response = "nc" if self.protocol == "griddap" else "ncCF"
url = self.get_download_url(response=response, **kw)
return to_iris(url, **kw)
return to_iris(url, iris_kwargs=dict(**kw))

@functools.lru_cache(maxsize=None)
def _get_variables(self, dataset_id: OptionalStr = None) -> Dict:
Expand Down

0 comments on commit 5892908

Please sign in to comment.