Skip to content
Snippets Groups Projects
Commit a1401d91 authored by Martin Bergemann's avatar Martin Bergemann :speech_balloon:
Browse files

Fix linting issues

parent 536bfc3f
No related branches found
No related tags found
1 merge request!14Check make cf conventions configurable
Pipeline #46071 failed
......@@ -102,11 +102,7 @@ def _rechunk_dataset(
logger.debug("Rechunking variable %s", var)
chunks: Dict[int, Optional[str]] = {}
for i, dim in enumerate(map(str, dset[var].dims)):
if (
"lon" in dim.lower()
or "lat" in dim.lower()
or "bnds" in dim.lower()
):
if "lon" in dim.lower() or "lat" in dim.lower() or "bnds" in dim.lower():
chunks[i] = None
else:
chunks[i] = "auto"
......@@ -124,14 +120,9 @@ def _rechunk_dataset(
)
logger.debug("Settings encoding of variable %s", var)
encoding[data_var] = {
str(k): v
for k, v in dset[var].encoding.items()
if str(k) in _keywords
str(k): v for k, v in dset[var].encoding.items() if str(k) in _keywords
}
if (
engine != "netcdf4"
or encoding[data_var].get("contiguous", False) is False
):
if engine != "netcdf4" or encoding[data_var].get("contiguous", False) is False:
encoding[data_var]["chunksizes"] = new_chunks
return dset, encoding
......
......@@ -67,6 +67,5 @@ def test_wrong_or_format(small_chunk_data, caplog) -> None:
def test_wrong_engine(small_chunk_data) -> None:
with pytest.raises(ValueError):
rechunk_dataset(small_chunk_data, engine="foo")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment