FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ews-coordinator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gilligan Lab for Epidemiology and Modelling
Wheat rusts
ews-coordinator
Commits
7c19b032
Commit
7c19b032
authored
1 year ago
by
Dr T. Mona
Browse files
Options
Downloads
Patches
Plain Diff
feat: handle one letter format of incident category alongside short name.
parent
fb82d0ff
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
coordinator/ProcessorSurveysnewODK.py
+16
-3
16 additions, 3 deletions
coordinator/ProcessorSurveysnewODK.py
with
16 additions
and
3 deletions
coordinator/ProcessorSurveysnewODK.py
+
16
−
3
View file @
7c19b032
...
...
@@ -20,6 +20,19 @@ from ProcessorUtils import (
logger
=
logging
.
getLogger
(
'
Processor.Surveys.kobotoolbox
'
)
add_filters_to_sublogger
(
logger
)
# Cases to convert incident categories to expected short name category or value
cases_incident
=
{
''
:
'
none
'
,
'
N
'
:
'
none
'
,
'
L
'
:
'
low
'
,
'
M
'
:
'
medium
'
,
'
H
'
:
'
high
'
,
'
none
'
:
'
none
'
,
'
low
'
:
'
low
'
,
'
medium
'
:
'
medium
'
,
'
high
'
:
'
high
'
}
def
get_from_kobotoolbox
(
url
,
form_id
,
form_token
,
**
kwargs
):
'''
Make the HTTP request, then checking the status code.
'''
...
...
@@ -95,7 +108,7 @@ def get_newODK_form_as_csv(form_credentials: dict, jobPath: str, config: dict, s
'
formhub/uuid
'
:
'
None
'
,
'
imei
'
:
'
imei
'
,
'
leaf_rust/leafrust_host_plant_reaction
'
:
'
leaf_rust-leafrust_host_plant_reaction
'
,
'
leaf_rust/leafrust_incidence
'
:
'
leaf_rust-leafrust_incidence
'
,
'
leaf_rust/leafrust_incidence
'
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
leaf_rust-leafrust_incidence
'
),(
'
cases
'
,
cases_incident
)))
,
'
leaf_rust/leafrust_severity
'
:
'
leaf_rust-leafrust_severity
'
,
'
live_leafrust_samples
'
:
'
SET-OF-live_leafrust_samples
'
,
'
live_leafrust_samples_count
'
:
'
live_leafrust_samples_count
'
,
...
...
@@ -116,7 +129,7 @@ def get_newODK_form_as_csv(form_credentials: dict, jobPath: str, config: dict, s
'
start
'
:
(
'
parse_date
'
,((
'
name_out
'
,
'
start
'
),(
'
fmt_in
'
,
'
%Y-%m-%dT%H:%M:%S.%f%z
'
))),
'
stem_rust/Stemrust_severity
'
:
'
stem_rust-Stemrust_severity
'
,
'
stem_rust/stemrust_host_plant_reaction
'
:
'
stem_rust-stemrust_host_plant_reaction
'
,
'
stem_rust/stemrust_incidence
'
:
'
stem_rust-stemrust_incidence
'
,
'
stem_rust/stemrust_incidence
'
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
stem_rust-stemrust_incidence
'
),(
'
cases
'
,
cases_incident
)))
,
'
survey_infromation/location
'
:
(
'
parse_location_kobotoolbox
'
,()),
'
survey_infromation/location_name
'
:
'
survey_infromation-location_name
'
,
'
survey_infromation/survey_date
'
:
(
'
parse_date
'
,((
'
name_out
'
,
'
survey_infromation-survey_date
'
),(
'
fmt_in
'
,
'
%Y-%m-%d
'
))),
...
...
@@ -126,7 +139,7 @@ def get_newODK_form_as_csv(form_credentials: dict, jobPath: str, config: dict, s
'
today
'
:
(
'
parse_date
'
,((
'
name_out
'
,
'
today
'
),(
'
fmt_in
'
,
'
%Y-%m-%d
'
))),
'
username
'
:
'
username
'
,
'
yellow_rust/yellowrust_host_plant_reaction
'
:
'
yellow_rust-yellowrust_host_plant_reaction
'
,
'
yellow_rust/yellowrust_incidence
'
:
'
yellow_rust-yellowrust_incidence
'
,
'
yellow_rust/yellowrust_incidence
'
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
leaf_rust-leafrust_incidence
'
),(
'
cases
'
,
cases_incident
)))
,
'
yellow_rust/yellowrust_severity
'
:
'
yellow_rust-yellowrust_severity
'
,
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment