Skip to content

Commit

Permalink
debugging result.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry committed Jul 7, 2023
1 parent a61d6a7 commit 5c21dec
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions synop2bufr/pygeoapi_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,23 @@
}
},
"outputs": {
"messages": {
"result": {
"title": "BUFR encoded data in base64", # noqa
"schema": {"type": "array"},
"description": "One result per line in input data" # noqa
"schema": {"contentMediaType": "application/json"}
},
"errors": {
"title": "Errors",
"schema": {"contentMediaType": "application/json"}
}
},
"example": {
"inputs": {
"data":r"AAXX 21121 15015 02999 02501 10103 21090 39765 42952 57020 60001 333 4/000 55310 0//// 22591 3//// 60007 91003 91104=", # noqa
"metadata": r"station_name,wigos_station_identifier,traditional_station_identifier,facility_type,latitude,longitude,elevation,territory_name,wmo_region\\nOCNA SUGATAG,0-20000-0-15015,15015,Land (fixed),47.77706163,23.94046026,503,Romania,6",
"metadata": r"station_name,wigos_station_identifier,traditional_station_identifier,facility_type,latitude,longitude,elevation,territory_name,wmo_region\\nOCNA SUGATAG,0-20000-0-15015,15015,Land (fixed),47.77706163,23.94046026,503,Romania,6", #noqa
"year": 2022,
"month": 2
},
"output": {"messages": []}
"output": {}
},
}

Expand Down Expand Up @@ -132,11 +135,13 @@ def execute(self, data):
for result in bufr_generator:
result['bufr4'] = base64.b64encode( result['bufr4'] ).decode("utf-8") # noqa
bufr.append(result)
output = {"messages": bufr, "errors": errors}

except Exception as e:
LOGGER.error(e)
errors.append(f"{e}")
output = {"messages": bufr, "errors": errors}

output = {"result": json.dumps(result), "errors": json.dumps(errors)}


LOGGER.error("returning")
return mimetype, output
Expand Down

0 comments on commit 5c21dec

Please sign in to comment.