FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 034335c5 authored by Dr T. Mona's avatar Dr T. Mona
Browse files

fix: updating api and fixing default values for expected diseases.

parent cff539af
No related branches found
No related tags found
No related merge requests found
...@@ -40,10 +40,12 @@ cases_severity = { ...@@ -40,10 +40,12 @@ cases_severity = {
def get_from_WRT(form_credentials: dict, startDate: str, endDate: str): def get_from_WRT(form_credentials: dict, startDate: str, endDate: str):
'''Make the HTTP request, then checking the status code.''' '''Make the HTTP request, then checking the status code.'''
url = f"{form_credentials['url']}WheatRustAPI/api/Survey" url = f"{form_credentials['url']}WheatRustAPI/api/Survey/GetAll"
#url = f"{form_credentials['url']}WheatRustAPI/api/Survey/GetByPublishedLevel"
url += '?strStopDate=' + endDate url += '?strStopDate=' + endDate
url += '&strStartDate=' + startDate url += '&strStartDate=' + startDate
url += '&strArrayCountryID='+ form_credentials['countryID'] url += '&strArrayCountryID='+ form_credentials['countryID']
#url += '&strArrayPublishedLevel=Unpubl'
# set up http session # set up http session
session = requests.Session() session = requests.Session()
...@@ -137,10 +139,10 @@ def nested_to_flattened(df): ...@@ -137,10 +139,10 @@ def nested_to_flattened(df):
df[i] = "" df[i] = ""
# add dedicated rust columns, with default values # add dedicated rust columns, with default values
NEW_RUST_COLUMNS = {"SR.Incident":"none","SR.Severity":"-9","SR.Reaction":"na", NEW_RUST_COLUMNS = {"SR.Incident":"N","SR.Severity":"N","SR.Reaction":"N",
"LR.Incident":"none","LR.Severity":"-9","LR.Reaction":"na", "LR.Incident":"N","LR.Severity":"N","LR.Reaction":"N",
"YR.Incident":"none","YR.Severity":"-9","YR.Reaction":"na", "YR.Incident":"N","YR.Severity":"N","YR.Reaction":"N",
"Septoria.Incident":"none","Septoria.Severity":"0"} "Septoria.Incident":"N","Septoria.Severity":"N"}
for i in NEW_RUST_COLUMNS.keys(): for i in NEW_RUST_COLUMNS.keys():
df[i] = NEW_RUST_COLUMNS[i] df[i] = NEW_RUST_COLUMNS[i]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment