Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mHM Tools
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mhm
mHM Tools
Commits
7bee0903
Commit
7bee0903
authored
2 weeks ago
by
Valentin Simon Lüdke
Browse files
Options
Downloads
Patches
Plain Diff
Add some logging to data_var determination
parent
e6862096
No related branches found
No related tags found
2 merge requests
!16
Generate classical mhm setups from classical setup
,
!8
Draft: Resolve "Pre-Proc: incorporate tools for creating global setups"
Pipeline
#274465
failed with stages
in 2 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mhm_tools/common/xarray_utils.py
+2
-0
2 additions, 0 deletions
src/mhm_tools/common/xarray_utils.py
src/mhm_tools/pre/crop_mhm_setup.py
+1
-0
1 addition, 0 deletions
src/mhm_tools/pre/crop_mhm_setup.py
with
3 additions
and
0 deletions
src/mhm_tools/common/xarray_utils.py
+
2
−
0
View file @
7bee0903
...
...
@@ -53,8 +53,10 @@ def get_single_data_var(ds):
return
data_vars
[
0
]
def
induce_data_var_from_file_name
(
ds
,
file_path
):
logger
.
info
(
'
Searching for more than one datavar by comparing with file name.
'
)
name
=
file_path
.
stem
data_vars
=
list
(
ds
.
data_vars
)
logger
.
debug
(
f
'
{
name
}
-
{
data_vars
}
'
)
for
dv
in
data_vars
:
if
dv
in
name
:
return
dv
...
...
This diff is collapsed.
Click to expand it.
src/mhm_tools/pre/crop_mhm_setup.py
+
1
−
0
View file @
7bee0903
...
...
@@ -90,6 +90,7 @@ def crop_file_with_header(ds_in, file_path, mask, output_path):
if
data_var
is
None
:
logger
.
error
(
f
'
File
{
file_path
}
could not be croped because the data_var could not be determined.
'
)
return
None
,
None
logger
.
debug
(
f
'
Found data_var=
{
data_var
}
'
)
with
header
.
open
(
"
r
"
)
as
h
:
d
=
{}
logger
.
debug
(
f
"
Reading out header.txt file
{
header
}
"
)
...
...
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