Skip to content

Commit

Permalink
Update FrozenDict call
Browse files Browse the repository at this point in the history
  • Loading branch information
zbruick committed Oct 16, 2019
1 parent dbee352 commit c9b7a3f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions siphon/cdmr/xarray_support.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Copyright (c) 2016 Siphon Contributors.
# Copyright (c) 2016,2019 Siphon Contributors.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Implement an experimental backend for using xarray to talk to TDS over CDMRemote."""

from xarray import Variable
from xarray.backends.common import AbstractDataStore, BackendArray
from xarray.core import indexing
from xarray.core.utils import FrozenOrderedDict
try:
from xarray.core.utils import FrozenDict
except ImportError:
from xarray.core.utils import FrozenOrderedDict as FrozenDict

from . import Dataset

Expand Down Expand Up @@ -56,13 +59,13 @@ def open_store_variable(self, name, var):

def get_variables(self):
"""Get the variables from underlying data set."""
return FrozenOrderedDict((k, self.open_store_variable(k, v))
for k, v in self.ds.variables.items())
return FrozenDict((k, self.open_store_variable(k, v))
for k, v in self.ds.variables.items())

def get_attrs(self):
"""Get the global attributes from underlying data set."""
return FrozenOrderedDict((a, getattr(self.ds, a)) for a in self.ds.ncattrs())
return FrozenDict((a, getattr(self.ds, a)) for a in self.ds.ncattrs())

def get_dimensions(self):
"""Get the dimensions from underlying data set."""
return FrozenOrderedDict((k, len(v)) for k, v in self.ds.dimensions.items())
return FrozenDict((k, len(v)) for k, v in self.ds.dimensions.items())

0 comments on commit c9b7a3f

Please sign in to comment.