diff --git a/lib/xmet/igra.py b/lib/xmet/igra.py index bdc9cd8..9c1372c 100644 --- a/lib/xmet/igra.py +++ b/lib/xmet/igra.py @@ -184,7 +184,9 @@ def cols(text: str, start: int, end: int): a = start - 1 b = end - return text[a:b] + ret = text[a:b] + + return None if ret == '' else ret class IGRAStation(DatabaseTable): __table__ = 'xmet_igra_station' @@ -221,7 +223,7 @@ class IGRAStation(DatabaseTable): def __init__(self): super().__init__() - self.code = None + self.code = None self.year_start = None self.year_end = None self.name = None @@ -243,9 +245,6 @@ class IGRAStation(DatabaseTable): station.elevation = float(cols(line, 32, 37)) station.location = shapely.Point(lon, lat) - if station.state == '': - station.state = None - return station @staticmethod