Skip to content
Snippets Groups Projects
Commit 6d8523a5 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Use namespace to get result valule

parent 24fce4a8
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,8 @@ model_config = {
# Posting the request to VIPSLogic
r2 = requests.post("%s/models/%s/run" % (core_server_uri, model_id), json=model_config)
#print r2.text
# This script does not import VIPSCore-Python-Common. Thus, it does not have the
# util methods to parse the request, so we do it manually
results = r2.json()
for result in results:
# Create a Python timestamp from the JSON timestamp string
......@@ -69,10 +71,11 @@ for result in results:
# Printing selected result parameters to stdout
#print(result)
allValues = json.loads(result["allValues"])
print ("%s: Mean temp today = %s, Accumulated Day Degrees = %s, Warning status = %s" % (
datetime.strftime(timestamp, '%Y-%m-%dT%H:%M %Z'),
allValues.get("TM"),
allValues.get("TMDD"),
allValues.get("WEATHER.TMDD"),
result["warningStatus"]
)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment