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
6533c7f4
Commit
6533c7f4
authored
3 years ago
by
Fabian Wachsmann
Browse files
Options
Downloads
Patches
Plain Diff
Collect tracking ids and add them to mf_dset
parent
7fcf2c38
No related branches found
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
+12
-0
12 additions, 0 deletions
tzis/tzis.py
with
12 additions
and
0 deletions
tzis/tzis.py
+
12
−
0
View file @
6533c7f4
...
...
@@ -34,6 +34,16 @@ class Tzis():
#if type(mf) != list and type(mf) != str :
# raise ValueError("Dataset '{0}' must either be a string or a list of strings")
if
mf
:
tracking_ids
=
[]
if
type
(
mf
)
==
str
:
mf
=
[
mf
]
try
:
for
dset
in
mf
:
dset
=
xarray
.
open_dataset
(
dset
)
tracking_ids
.
append
(
dset
.
attrs
[
"
tracking_id
"
])
except
:
if
self
.
verbose
:
print
(
"
Could not collect
'
tracking_ids
'
.
"
)
if
xarray_kwargs
:
mf_dset
=
xarray
.
open_mfdataset
(
mf
,
decode_cf
=
True
,
...
...
@@ -51,6 +61,8 @@ class Tzis():
data_vars
=
'
minimal
'
,
coords
=
'
minimal
'
,
compat
=
'
override
'
)
if
tracking_ids
:
mf_dset
.
attrs
[
"
tracking_id
"
]
=
tracking_ids
if
not
self
.
varname
:
self
.
varname
=
mf_dset
.
variables
[
0
]
...
...
This diff is collapsed.
Click to expand it.
Fabian Wachsmann
@k204210
mentioned in issue
#2 (closed)
·
3 years ago
mentioned in issue
#2 (closed)
mentioned in issue #2
Toggle commit list
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