Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
climix
climix
Commits
0cf89f72
Commit
0cf89f72
authored
Feb 12, 2020
by
Klaus Zimmermann
Browse files
Improved metadata error reporting (closes #162)
parent
b8cfb104
Changes
2
Hide whitespace changes
Inline
Side-by-side
climix/index.py
View file @
0cf89f72
...
...
@@ -29,7 +29,11 @@ class Index:
if
argname
in
cube_mapping
:
logging
.
info
(
'Data found for input {}'
.
format
(
argname
))
else
:
raise
ValueError
(
'No data found for input {}'
.
format
(
argname
))
args
=
", "
.
join
(
[
"{}: {}"
.
format
(
argname
,
iv
.
var_name
)
for
argname
,
iv
in
self
.
metadata
.
input
.
items
()])
raise
ValueError
(
'No data found for input {}. '
'Requested: ({})'
.
format
(
argname
,
args
))
logging
.
info
(
'Adding coord categorisation.'
)
coord_name
=
list
(
map
(
self
.
period
.
add_coord_categorisation
,
cube_mapping
.
values
()))[
0
]
...
...
climix/metadata.py
View file @
0cf89f72
...
...
@@ -377,7 +377,7 @@ def load_metadata():
for
name
,
idx_meta
in
idx_metadata
.
items
():
try
:
indices
[
name
]
=
build_index
(
idx_meta
,
variables
,
path
)
except
KeyError
:
except
(
KeyError
,
TypeError
)
:
logging
.
error
(
'Metadata error for index {} from {}.'
.
format
(
name
,
path
))
raise
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment