Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rechunk-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ch1187
rechunk-data
Commits
a1401d91
Commit
a1401d91
authored
1 year ago
by
Martin Bergemann
Browse files
Options
Downloads
Patches
Plain Diff
Fix linting issues
parent
536bfc3f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!14
Check make cf conventions configurable
Pipeline
#46071
failed
1 year ago
Stage: test
Stage: report
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rechunk_data/_rechunk.py
+3
-12
3 additions, 12 deletions
src/rechunk_data/_rechunk.py
src/rechunk_data/tests/test_rechunk_netcdf.py
+0
-1
0 additions, 1 deletion
src/rechunk_data/tests/test_rechunk_netcdf.py
with
3 additions
and
13 deletions
src/rechunk_data/_rechunk.py
+
3
−
12
View file @
a1401d91
...
@@ -102,11 +102,7 @@ def _rechunk_dataset(
...
@@ -102,11 +102,7 @@ def _rechunk_dataset(
logger
.
debug
(
"
Rechunking variable %s
"
,
var
)
logger
.
debug
(
"
Rechunking variable %s
"
,
var
)
chunks
:
Dict
[
int
,
Optional
[
str
]]
=
{}
chunks
:
Dict
[
int
,
Optional
[
str
]]
=
{}
for
i
,
dim
in
enumerate
(
map
(
str
,
dset
[
var
].
dims
)):
for
i
,
dim
in
enumerate
(
map
(
str
,
dset
[
var
].
dims
)):
if
(
if
"
lon
"
in
dim
.
lower
()
or
"
lat
"
in
dim
.
lower
()
or
"
bnds
"
in
dim
.
lower
():
"
lon
"
in
dim
.
lower
()
or
"
lat
"
in
dim
.
lower
()
or
"
bnds
"
in
dim
.
lower
()
):
chunks
[
i
]
=
None
chunks
[
i
]
=
None
else
:
else
:
chunks
[
i
]
=
"
auto
"
chunks
[
i
]
=
"
auto
"
...
@@ -124,14 +120,9 @@ def _rechunk_dataset(
...
@@ -124,14 +120,9 @@ def _rechunk_dataset(
)
)
logger
.
debug
(
"
Settings encoding of variable %s
"
,
var
)
logger
.
debug
(
"
Settings encoding of variable %s
"
,
var
)
encoding
[
data_var
]
=
{
encoding
[
data_var
]
=
{
str
(
k
):
v
str
(
k
):
v
for
k
,
v
in
dset
[
var
].
encoding
.
items
()
if
str
(
k
)
in
_keywords
for
k
,
v
in
dset
[
var
].
encoding
.
items
()
if
str
(
k
)
in
_keywords
}
}
if
(
if
engine
!=
"
netcdf4
"
or
encoding
[
data_var
].
get
(
"
contiguous
"
,
False
)
is
False
:
engine
!=
"
netcdf4
"
or
encoding
[
data_var
].
get
(
"
contiguous
"
,
False
)
is
False
):
encoding
[
data_var
][
"
chunksizes
"
]
=
new_chunks
encoding
[
data_var
][
"
chunksizes
"
]
=
new_chunks
return
dset
,
encoding
return
dset
,
encoding
...
...
This diff is collapsed.
Click to expand it.
src/rechunk_data/tests/test_rechunk_netcdf.py
+
0
−
1
View file @
a1401d91
...
@@ -67,6 +67,5 @@ def test_wrong_or_format(small_chunk_data, caplog) -> None:
...
@@ -67,6 +67,5 @@ def test_wrong_or_format(small_chunk_data, caplog) -> None:
def
test_wrong_engine
(
small_chunk_data
)
->
None
:
def
test_wrong_engine
(
small_chunk_data
)
->
None
:
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
rechunk_dataset
(
small_chunk_data
,
engine
=
"
foo
"
)
rechunk_dataset
(
small_chunk_data
,
engine
=
"
foo
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment