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
f55fea35
Commit
f55fea35
authored
2 years ago
by
Martin Bergemann
Browse files
Options
Downloads
Patches
Plain Diff
Fix mypy issues
parent
0c6fcf3f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Tests
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/rechunk_data/__init__.pyi
+4
-2
4 additions, 2 deletions
src/rechunk_data/__init__.pyi
src/rechunk_data/tests/test_rechunk_netcdf.py
+2
-2
2 additions, 2 deletions
src/rechunk_data/tests/test_rechunk_netcdf.py
with
6 additions
and
4 deletions
src/rechunk_data/__init__.pyi
+
4
−
2
View file @
f55fea35
import
argparse
import
os
from
pathlib
import
Path
from
typing
import
Any
,
Dict
,
Generator
,
Optional
,
Tuple
from
typing
import
Any
,
Dict
,
Generator
,
List
,
Optional
,
Tuple
import
xarray
as
xr
...
...
@@ -16,4 +16,6 @@ def rechunk_netcdf_file(
output_path
:
Optional
[
os
.
PathLike
]
=
...,
engine
:
str
=
...,
)
->
None
:
...
def
cli
()
->
None
:
...
def
cli
(
argv
:
Optional
[
List
[
str
]]
=
...,
)
->
None
:
...
This diff is collapsed.
Click to expand it.
src/rechunk_data/tests/test_rechunk_netcdf.py
+
2
−
2
View file @
f55fea35
...
...
@@ -20,7 +20,7 @@ def test_rechunk_data_dir_with_overwrite(data_dir: Path) -> None:
def
test_rechunk_data_dir_without_overwrite
(
data_dir
:
Path
)
->
None
:
"""
Testing the creation of new datafiles from a folder.
"""
with
TemporaryDirectory
()
as
temp_dir
:
rechunk_netcdf_file
(
data_dir
,
temp_dir
)
rechunk_netcdf_file
(
data_dir
,
Path
(
temp_dir
)
)
new_files
=
sorted
(
f
.
relative_to
(
temp_dir
)
for
f
in
Path
(
temp_dir
).
rglob
(
"
.nc
"
))
old_files
=
sorted
(
f
.
relative_to
(
data_dir
)
for
f
in
data_dir
.
rglob
(
"
.nc
"
))
assert
new_files
==
old_files
...
...
@@ -34,7 +34,7 @@ def test_rechunk_single_data_file(data_file: Path) -> None:
rechunk_netcdf_file
(
data_file
)
assert
a_time
<
float
(
data_file
.
stat
().
st_atime
)
with
NamedTemporaryFile
(
suffix
=
"
.nc
"
)
as
temp_file
:
rechunk_netcdf_file
(
data_file
,
temp_file
.
name
)
rechunk_netcdf_file
(
data_file
,
Path
(
temp_file
.
name
)
)
assert
Path
(
temp_file
.
name
).
exists
()
...
...
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