You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, it seemschkCellMethodsinitial regex (pr1) can reject some valid cell_methods.
It validates only lower case methods but conventions document says:
"""Case is not significant in the method name. in chapter 7.3."""
This is due to [a-z_] in the regex.
After the name:method it expects one of the keywords ["where", "over", "within", "interval", "comment"] but I don't see in the conventions doc where it is specified that only these can be used. Beside, it tells:
"""For instance, an area-weighted mean over latitude could be indicated as lat: mean (area-weighted) or lat: mean (interval: 1 degree_north comment: area-weighted)."""
But pr1 regex would raise an error with lat: mean (area-weighted)
Disclaimer:
I worked on a similar feature on Xclim but I never actually used cf-checker, so I might have misunderstood how chkCellMethods works. I just wanted to give you a feedback because I took some inspiration from the currentchkCellMethods.
We are now using the following regex on Xclim: (\s*\S+\s*:(\s+[\w()-]+)+)(?!\S*:) (see it in action).
Regards.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. It looks like (1) is missing from the conformance document so I will raise a correction and then fix the checker accordingly.
(2) I've just tried cell_methods = "lat: mean (area-weighted)" and that is perfectly valid by chkCellMethods. The keywords ["where", "over", "within", "interval", "comment"] are all optional in the regex.
Hello, it seems
chkCellMethods
initial regex (pr1
) can reject some valid cell_methods.It validates only lower case methods but conventions document says:
"""Case is not significant in the method name. in chapter 7.3."""
This is due to
[a-z_]
in the regex.After the name:method it expects one of the keywords ["where", "over", "within", "interval", "comment"] but I don't see in the conventions doc where it is specified that only these can be used. Beside, it tells:"""For instance, an area-weighted mean over latitude could be indicated as lat: mean (area-weighted) or lat: mean (interval: 1 degree_north comment: area-weighted)."""
But
pr1
regex would raise an error withlat: mean (area-weighted)
Disclaimer:
I worked on a similar feature on Xclim but I never actually used cf-checker, so I might have misunderstood how
chkCellMethods
works. I just wanted to give you a feedback because I took some inspiration from the currentchkCellMethods
.We are now using the following regex on Xclim:
(\s*\S+\s*:(\s+[\w()-]+)+)(?!\S*:)
(see it in action).Regards.
The text was updated successfully, but these errors were encountered: