File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -42,5 +42,5 @@ def __getitem__(self, key: str):
42
42
xarray Dataset of the data associated with key
43
43
"""
44
44
45
- col_name = cfp .match_criteria_key (self ._obj .columns .values , key )
45
+ col_name = cfp .match_criteria_key (self ._obj .columns .values , key , split = True )
46
46
return self ._obj [col_name ]
Original file line number Diff line number Diff line change @@ -21,10 +21,16 @@ def test_options():
21
21
22
22
def test_match_criteria_key_accessor ():
23
23
24
- vals = ["wind_speed" , "WIND_SPEED" , "wind_speed_status" ]
25
-
26
- df = pd .DataFrame (columns = ["temp" , "wind_speed" ])
24
+ df = pd .DataFrame (
25
+ columns = [
26
+ "temp" ,
27
+ "wind_speed" ,
28
+ "wind_speed (m/s)" ,
29
+ "WIND_SPEED" ,
30
+ "wind_speed_status" ,
31
+ ]
32
+ )
27
33
28
34
# test accessor with set_options criteria
29
35
with cfp .set_options (custom_criteria = criteria ):
30
- assert df .cf ["wind_s" ].columns == ["wind_speed" ]
36
+ assert sorted ( df .cf ["wind_s" ].columns ) == ["wind_speed" , "wind_speed (m/s) " ]
You can’t perform that action at this time.
0 commit comments