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
03604f80
Commit
03604f80
authored
5 months ago
by
Dr T. Mona
Browse files
Options
Downloads
Patches
Plain Diff
feat: add groups output list
parent
9f3ad14f
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/processor_surveys.py
+13
-1
13 additions, 1 deletion
ews/coordinator/processor_surveys.py
with
13 additions
and
1 deletion
ews/coordinator/processor_surveys.py
+
13
−
1
View file @
03604f80
...
@@ -32,7 +32,7 @@ from shutil import copyfile
...
@@ -32,7 +32,7 @@ from shutil import copyfile
from
numpy
import
all
as
np_all
from
numpy
import
all
as
np_all
from
numpy
import
any
as
np_any
from
numpy
import
any
as
np_any
from
pandas
import
read_csv
,
concat
from
pandas
import
read_csv
,
concat
,
DataFrame
from
ews.coordinator.survey_servers.processor_surveys_odk
import
get_ODK_form_as_csv
from
ews.coordinator.survey_servers.processor_surveys_odk
import
get_ODK_form_as_csv
from
ews.coordinator.survey_servers.processor_surveys_odk_sa
import
get_ODK_SA_form_as_csv
from
ews.coordinator.survey_servers.processor_surveys_odk_sa
import
get_ODK_SA_form_as_csv
...
@@ -313,6 +313,9 @@ class ProcessorSurveys(ProcessorBase):
...
@@ -313,6 +313,9 @@ class ProcessorSurveys(ProcessorBase):
logger
.
debug
(
f
"
Removing group
{
group_name
}
from list of groups
"
)
logger
.
debug
(
f
"
Removing group
{
group_name
}
from list of groups
"
)
del
groups
[
group_name
]
del
groups
[
group_name
]
# create a list of each group and their content
groups_list
=
DataFrame
(
columns
=
[
'
Group
'
,
'
Content
'
,
'
SourcesFile
'
])
for
group_name
,
group_content
in
groups
.
items
():
for
group_name
,
group_content
in
groups
.
items
():
logger
.
info
(
f
"
Creating survey group
{
group_name
}
which includes
{
group_content
}
"
)
logger
.
info
(
f
"
Creating survey group
{
group_name
}
which includes
{
group_content
}
"
)
...
@@ -362,6 +365,9 @@ class ProcessorSurveys(ProcessorBase):
...
@@ -362,6 +365,9 @@ class ProcessorSurveys(ProcessorBase):
copyfile
(
sources_path
,
output_path
)
copyfile
(
sources_path
,
output_path
)
# add group to the list of groups
groups_list
=
concat
([
groups_list
,
DataFrame
({
'
Group
'
:[
group_name
],
'
Content
'
:[
group_content
],
'
SourcesFile
'
:[
output_filename
]})])
# THIS CAN BE REMOVED ONCE THE GROUPS ARE PROPERLY PICKED UP BY THE METOFFICE
# THIS CAN BE REMOVED ONCE THE GROUPS ARE PROPERLY PICKED UP BY THE METOFFICE
if
(
group_name
==
'
PROD
'
):
if
(
group_name
==
'
PROD
'
):
logger
.
debug
(
'
Additionally placing copy of PROD result in job directory without group name
'
)
logger
.
debug
(
'
Additionally placing copy of PROD result in job directory without group name
'
)
...
@@ -372,6 +378,12 @@ class ProcessorSurveys(ProcessorBase):
...
@@ -372,6 +378,12 @@ class ProcessorSurveys(ProcessorBase):
logger
.
debug
(
f
"
as
{
output_path
}
"
)
logger
.
debug
(
f
"
as
{
output_path
}
"
)
copyfile
(
sources_path
,
output_path
)
copyfile
(
sources_path
,
output_path
)
# output groups_list to a file
groups_list_filename
=
f
"
{
job_path
}
/upload/list_sources_
{
config
[
'
StartString
'
]
}
.csv
"
logger
.
debug
(
f
"
Outputting list of groups to
{
groups_list_filename
}
"
)
groups_list
.
to_csv
(
groups_list_filename
,
index
=
False
)
else
:
else
:
# run python version without grouping surveys
# run python version without grouping surveys
...
...
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