Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tzis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
data-infrastructure-services
tzis
Commits
b2d9b41c
Commit
b2d9b41c
authored
2 years ago
by
wachsylon
Browse files
Options
Downloads
Patches
Plain Diff
Added zarr support for input
parent
f3b3c32e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tzis/tzis.py
+11
-4
11 additions, 4 deletions
tzis/tzis.py
with
11 additions
and
4 deletions
tzis/tzis.py
+
11
−
4
View file @
b2d9b41c
...
@@ -152,7 +152,10 @@ class Tzis:
...
@@ -152,7 +152,10 @@ class Tzis:
if
self
.
verbose
:
if
self
.
verbose
:
print
(
"
Calculating chunk size
"
)
print
(
"
Calculating chunk size
"
)
testds
=
xarray
.
open_dataset
(
mf
[
0
])
if
xarray_kwargs
is
not
None
:
testds
=
xarray
.
open_dataset
(
mf
[
0
],
**
xarray_kwargs
)
else
:
testds
=
xarray
.
open_dataset
(
mf
[
0
])
if
not
varname
:
if
not
varname
:
self
.
varname
=
self
.
_get_varname
(
testds
)
self
.
varname
=
self
.
_get_varname
(
testds
)
...
@@ -195,7 +198,7 @@ class Tzis:
...
@@ -195,7 +198,7 @@ class Tzis:
for
var_id
in
mf_dset
.
variables
:
for
var_id
in
mf_dset
.
variables
:
mf_dset
[
var_id
].
unify_chunks
()
mf_dset
[
var_id
].
unify_chunks
()
conflict_attrs
=
self
.
get_conflict_attrs
(
mf
,
mf_dset
)
conflict_attrs
=
self
.
get_conflict_attrs
(
mf
,
mf_dset
,
xarray_kwargs
)
self
.
init_verify_provenance
(
reset
=
True
)
self
.
init_verify_provenance
(
reset
=
True
)
...
@@ -234,13 +237,17 @@ class Tzis:
...
@@ -234,13 +237,17 @@ class Tzis:
print
(
"
You did not provide anything to open.
"
)
print
(
"
You did not provide anything to open.
"
)
return
None
return
None
def
get_conflict_attrs
(
self
,
mf
,
mf_dset
):
def
get_conflict_attrs
(
self
,
mf
,
mf_dset
,
xarray_kwargs
):
conflict_attrs
=
{}
conflict_attrs
=
{}
# try:
# try:
maxdigits
=
len
(
str
(
len
(
mf
)))
maxdigits
=
len
(
str
(
len
(
mf
)))
digitstring
=
"
{0:0
"
+
str
(
maxdigits
)
+
"
}
"
digitstring
=
"
{0:0
"
+
str
(
maxdigits
)
+
"
}
"
for
fileno
,
dset
in
enumerate
(
mf
):
for
fileno
,
dset
in
enumerate
(
mf
):
dset_attrs
=
xarray
.
open_dataset
(
dset
).
attrs
if
xarray_kwargs
is
not
None
:
ds
=
xarray
.
open_dataset
(
dset
,
**
xarray_kwargs
)
else
:
ds
=
xarray
.
open_dataset
(
dset
)
dset_attrs
=
ds
.
attrs
missing_attrs
=
{
missing_attrs
=
{
k
:
v
for
k
,
v
in
dset_attrs
.
items
()
if
k
not
in
mf_dset
.
attrs
k
:
v
for
k
,
v
in
dset_attrs
.
items
()
if
k
not
in
mf_dset
.
attrs
}
}
...
...
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