Skip to content

Commit

Permalink
Rebase and format
Browse files Browse the repository at this point in the history
  • Loading branch information
znicholls committed Jul 12, 2019
1 parent 73fedfc commit d24c18b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/netcdf_scm/iris_cube_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
)

try:
import dask
import iris
from iris.util import unify_time_units
import iris.analysis.cartography
Expand All @@ -55,19 +54,21 @@ def _get_cf_var_data(cf_var, filename):
import netCDF4

# Get lazy chunked data out of a cf variable.
dtype = netcdf._get_actual_dtype(cf_var)
dtype = netcdf._get_actual_dtype(cf_var) # pylint:disable=protected-access

# Create cube with deferred data, but no metadata
fill_value = getattr(
cf_var.cf_data, "_FillValue", netCDF4.default_fillvals[cf_var.dtype.str[1:]]
cf_var.cf_data,
"_FillValue",
netCDF4.default_fillvals[cf_var.dtype.str[1:]], # pylint:disable=no-member
)
proxy = netcdf.NetCDFDataProxy(
cf_var.shape, dtype, filename, cf_var.cf_name, fill_value
)
return netcdf.as_lazy_data(proxy, chunks=None)


netcdf._get_cf_var_data = _get_cf_var_data
netcdf._get_cf_var_data = _get_cf_var_data # pylint:disable=protected-access


class SCMCube: # pylint:disable=too-many-public-methods
Expand Down

0 comments on commit d24c18b

Please sign in to comment.