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
8ffe68da
Commit
8ffe68da
authored
8 months ago
by
Dr T. Mona
Browse files
Options
Downloads
Patches
Plain Diff
Clean WRT processing
parent
61c5cc20
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
ews/coordinator/survey_servers/processor_surveys_wrt.py
+21
-66
21 additions, 66 deletions
ews/coordinator/survey_servers/processor_surveys_wrt.py
with
21 additions
and
66 deletions
ews/coordinator/survey_servers/processor_surveys_wrt.py
+
21
−
66
View file @
8ffe68da
...
@@ -112,51 +112,6 @@ def nested_to_flattened(df):
...
@@ -112,51 +112,6 @@ def nested_to_flattened(df):
for
i
in
RAW_COLUMNS
:
for
i
in
RAW_COLUMNS
:
df
[
i
]
=
""
df
[
i
]
=
""
# add new columns
logger
.
info
(
'
Adding new columns
'
)
NEW_COLUMNS
=
[
'
imei
'
,
'
sample_size-number_yellowrust_live
'
,
'
sample_size-number_stemrust_live
'
,
'
dead_stemrust_samples_count
'
,
'
samples_collected
'
,
'
sample_size-number_yellowrust_dead
'
,
'
live_leafrust_samples_count
'
,
'
other_crop
'
,
'
live_yellowrust_samples_count
'
,
'
subscriberid
'
,
'
sample_size-using_barcode
'
,
'
start
'
,
'
score_diseases_count
'
,
'
phonenumber
'
,
'
survey_infromation-location-Accuracy
'
,
'
SET-OF-live_yellowrust_samples
'
,
'
SET-OF-score_diseases
'
,
'
meta-instanceID
'
,
'
deviceid
'
,
'
end
'
,
'
samples_type
'
,
'
live_stemrust_samples_count
'
,
'
dead_yellowrust_samples_count
'
,
'
SET-OF-live_leafrust_samples
'
,
'
other_diseases_group-other_diseases
'
,
'
survey_infromation-location-Altitude
'
,
'
SET-OF-dead_stemrust_samples
'
,
'
comment
'
,
'
sample_size-number_leafrust_live
'
,
'
today
'
,
'
SET-OF-dead_yellowrust_samples
'
,
'
username
'
,
'
SET-OF-live_stemrust_samples
'
,
'
sample_size-number_stemrust_dead_dna
'
,
'
SubmissionDate
'
,
'
survey_infromation-location_name
'
,
'
site_information-crop
'
,
'
surveyor_infromation-institution
'
,
'
surveyor_infromation-surveyor_name
'
]
for
i
in
NEW_COLUMNS
:
df
[
i
]
=
""
# add dedicated rust columns, with default values
# add dedicated rust columns, with default values
NEW_RUST_COLUMNS
=
{
'
SR.Incident
'
:
'
N
'
,
'
SR.Severity
'
:
'
N
'
,
'
SR.Reaction
'
:
'
N
'
,
'
SR.Race
'
:
''
,
'
SR.Genotype
'
:
''
,
NEW_RUST_COLUMNS
=
{
'
SR.Incident
'
:
'
N
'
,
'
SR.Severity
'
:
'
N
'
,
'
SR.Reaction
'
:
'
N
'
,
'
SR.Race
'
:
''
,
'
SR.Genotype
'
:
''
,
'
LR.Incident
'
:
'
N
'
,
'
LR.Severity
'
:
'
N
'
,
'
LR.Reaction
'
:
'
N
'
,
'
LR.Race
'
:
''
,
'
LR.Genotype
'
:
''
,
'
LR.Incident
'
:
'
N
'
,
'
LR.Severity
'
:
'
N
'
,
'
LR.Reaction
'
:
'
N
'
,
'
LR.Race
'
:
''
,
'
LR.Genotype
'
:
''
,
...
@@ -205,35 +160,35 @@ def get_WRT_form_as_csv(form_credentials: dict, jobPath: str, config: dict, stat
...
@@ -205,35 +160,35 @@ def get_WRT_form_as_csv(form_credentials: dict, jobPath: str, config: dict, stat
column_parser_dict
=
{
column_parser_dict
=
{
"
ObservationID
"
:
'
KEY
'
,
"
ObservationID
"
:
'
KEY
'
,
"
OriginalID
"
:
'
None
'
,
"
OriginalID
"
:
'
None
'
,
"
PublishedLevel
"
:
'
P
ublished
L
evel
'
,
"
PublishedLevel
"
:
'
p
ublished
_l
evel
'
,
"
Origin
"
:
'
O
rigin
'
,
"
Origin
"
:
'
o
rigin
'
,
"
Country
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
surveyor_infromation-
country
'
),(
'
cases
'
,
COUNTRY_ABBREVIATIONS_DICT
))),
"
Country
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
country
'
),(
'
cases
'
,
COUNTRY_ABBREVIATIONS_DICT
))),
"
Latitude
"
:
'
survey_infromation-location-L
atitude
'
,
"
Latitude
"
:
'
l
atitude
'
,
"
Longitude
"
:
'
survey_infromation-location-L
ongitude
'
,
"
Longitude
"
:
'
l
ongitude
'
,
"
FieldAreaHa
"
:
(
'
parse_dtype
'
,((
'
name_out
'
,
'
site_information-
field_area
'
),(
'
dtype
'
,
float
))),
"
FieldAreaHa
"
:
(
'
parse_dtype
'
,((
'
name_out
'
,
'
field_area
'
),(
'
dtype
'
,
float
))),
"
Cultivar
"
:
'
site_information-
variety
'
,
"
Cultivar
"
:
'
variety
'
,
"
CollectionDate
"
:
(
'
parse_date
'
,((
'
name_out
'
,
'
survey_
infromation-survey_
date
'
),(
'
fmt_in
'
,
'
%m/%d/%Y
'
))),
"
CollectionDate
"
:
(
'
parse_date
'
,((
'
name_out
'
,
'
survey_date
'
),(
'
fmt_in
'
,
'
%m/%d/%Y
'
))),
"
UpdateDate
"
:
'
None
'
,
"
UpdateDate
"
:
'
None
'
,
"
GrowthStage
"
:
'
site_information-
growth_stage
'
,
"
GrowthStage
"
:
'
growth_stage
'
,
"
SurveySite
"
:
'
site_information-
survey_site
'
,
"
SurveySite
"
:
'
survey_site
'
,
"
listDisease
"
:
'
None
'
,
"
listDisease
"
:
'
None
'
,
"
YR.Severity
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
yellow_rust-
yellowrust
_severity
'
),(
'
cases
'
,
cases_severity
),(
'
dtype
'
,
int
))),
"
YR.Severity
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
severity_
yellow
_
rust
'
),(
'
cases
'
,
cases_severity
),(
'
dtype
'
,
int
))),
"
YR.Incident
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
yellow_rust-
yellowrust
_incidence
'
),(
'
cases
'
,
cases_incident
))),
"
YR.Incident
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
incidence_
yellow
_
rust
'
),(
'
cases
'
,
cases_incident
))),
"
YR.Reaction
"
:
'
yellow_rust-yellowrust_host_plant_reaction
'
,
"
YR.Reaction
"
:
'
None
'
,
"
YR.Race
"
:
'
None
'
,
"
YR.Race
"
:
'
None
'
,
"
YR.Genotype
"
:
'
None
'
,
"
YR.Genotype
"
:
'
None
'
,
"
SR.Severity
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
s
tem_rust-S
temrust
_severity
'
),(
'
cases
'
,
cases_severity
),(
'
dtype
'
,
int
))),
"
SR.Severity
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
s
everity_s
tem
_
rust
'
),(
'
cases
'
,
cases_severity
),(
'
dtype
'
,
int
))),
"
SR.Incident
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
stem_rust-
stemrust
_incidence
'
),(
'
cases
'
,
cases_incident
))),
"
SR.Incident
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
incidence_
stem
_
rust
'
),(
'
cases
'
,
cases_incident
))),
"
SR.Reaction
"
:
'
stem_rust-stemrust_host_plant_reaction
'
,
"
SR.Reaction
"
:
'
None
'
,
"
SR.Race
"
:
'
None
'
,
"
SR.Race
"
:
'
None
'
,
"
SR.Genotype
"
:
'
None
'
,
"
SR.Genotype
"
:
'
None
'
,
"
LR.Severity
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
leaf_rust-
leafrust
_severity
'
),(
'
cases
'
,
cases_severity
),(
'
dtype
'
,
int
))),
"
LR.Severity
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
severity_
leaf
_
rust
'
),(
'
cases
'
,
cases_severity
),(
'
dtype
'
,
int
))),
"
LR.Incident
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
leaf_rust-
leafrust
_incidence
'
),(
'
cases
'
,
cases_incident
))),
"
LR.Incident
"
:
(
'
parse_cases
'
,((
'
name_out
'
,
'
incidence_
leaf
_
rust
'
),(
'
cases
'
,
cases_incident
))),
"
LR.Reaction
"
:
'
leaf_rust-leafrust_host_plant_reaction
'
,
"
LR.Reaction
"
:
'
None
'
,
"
LR.Race
"
:
'
None
'
,
"
LR.Race
"
:
'
None
'
,
"
LR.Genotype
"
:
'
None
'
,
"
LR.Genotype
"
:
'
None
'
,
"
Septoria.Severity
"
:
'
septoria-septoria_severity
'
,
"
Septoria.Severity
"
:
'
None
'
,
"
Septoria.Incident
"
:
'
septoria-septoria_incidenc
e
'
"
Septoria.Incident
"
:
'
Non
e
'
}
}
# perform a pull from the server, and if it fails write a warning message
# perform a pull from the server, and if it fails write a warning message
...
...
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