File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -299,9 +299,9 @@ def _import_data(self):
299299 self ._stand_press_at_elev = self ._regex_check (
300300 self ._press_pattern , self ._header [5 ])
301301 self ._ashrae_climate_zone = self ._regex_check (
302- self ._ashraecz_pattern , self ._body )
302+ self ._ashraecz_pattern , self ._body , enforce_string = True )
303303 self ._koppen_climate_zone = self ._regex_check (
304- self ._koppencz_pattern , self ._body )
304+ self ._koppencz_pattern , self ._body , enforce_string = True )
305305
306306 # pull out extreme and seasonal weeks.
307307 self ._extreme_hot_week = self ._regex_week_parse (self ._hotweek_pattern )
@@ -340,9 +340,11 @@ def _import_data(self):
340340 finally :
341341 statwin .close ()
342342
343- def _regex_check (self , regex_pattern , search_space ):
343+ def _regex_check (self , regex_pattern , search_space , enforce_string = False ):
344344 matches = regex_pattern .findall (search_space )
345345 if len (matches ) > 0 :
346+ if enforce_string :
347+ return matches [0 ]
346348 try :
347349 return float (matches [0 ])
348350 except ValueError :
You can’t perform that action at this time.
0 commit comments