Skip to content

Commit

Permalink
Fix for code tables to account for use of space as a delimiter in inp… (
Browse files Browse the repository at this point in the history
#25)

* Fix for code tables to account for use of space as a delimiter in input data.

* Tests
  • Loading branch information
david-i-berry authored Sep 28, 2023
1 parent 5c31e5d commit 977f299
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bufr2geojson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def get_code_value(self, fxxyyy: str, code: int) -> str:
with tablefile.open() as csvfile:
reader = csv.reader(csvfile, delimiter=" ")
for row in reader:
CODETABLES[self.table_version][fxxyyy][int(row[0])] = row[2] # noqa
CODETABLES[self.table_version][fxxyyy][int(row[0])] = " ".join(row[2:]) # noqa

if code not in CODETABLES[self.table_version][fxxyyy]:
LOGGER.warning(f"Invalid entry for value {code} in code table {fxxyyy}, table version {self.table_version}") # noqa
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bufr2geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def geojson_output():
'name': 'station_type',
'value': 0,
'units': 'CODE TABLE',
'description': 'AUTOMATIC'
'description': 'AUTOMATIC STATION'
},
{
'name': 'height_of_barometer_above_mean_sea_level',
Expand Down

0 comments on commit 977f299

Please sign in to comment.