File tree 2 files changed +5
-3
lines changed
fileformats/_nc_load_rules
tests/unit/fileformats/nc_load_rules/helpers
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 202
202
_CM_INTERVAL = "interval"
203
203
_CM_METHOD = "method"
204
204
_CM_NAME = "name"
205
- _CM_PARSE_NAME = re .compile (r"([\w_]+\s*?:\s? )+" )
205
+ _CM_PARSE_NAME = re .compile (r"([\w_]+\s*?:\s* )+" )
206
206
_CM_PARSE = re .compile (
207
207
r"""
208
- (?P<name>([\w_]+\s*?:\s? )+)
209
- (?P<method>[\w_\s]+(?![\w_]*\s*?:))\s*
208
+ (?P<name>([\w_]+\s*?:\s* )+)
209
+ (?P<method>[^\s][ \w_\s]+(?![\w_]*\s*?:))\s*
210
210
(?:
211
211
\(\s*
212
212
(?P<extra>.+)
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class Test(tests.IrisTest):
19
19
def test_simple (self ):
20
20
cell_method_strings = [
21
21
"time: mean" ,
22
+ "time:mean" ,
22
23
"time : mean" ,
23
24
]
24
25
expected = (CellMethod (method = "mean" , coords = "time" ),)
@@ -125,6 +126,7 @@ def test_badly_formatted_warning(self):
125
126
cell_method_strings = [
126
127
# "time: maximum (interval: 1 hr comment: first bit "
127
128
# "time: mean (interval: 1 day comment: second bit)",
129
+ 'time' ,
128
130
"time: (interval: 1 hr comment: first bit) "
129
131
"time: mean (interval: 1 day comment: second bit)" ,
130
132
"time: maximum (interval: 1 hr comment: first bit) "
You can’t perform that action at this time.
0 commit comments