Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PET-rating
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Heikkilä
PET-rating
Commits
2c7fa1c8
Commit
2c7fa1c8
authored
4 years ago
by
Ossi Laine
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in randomized data exporting
parent
27719c7b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/routes.py
+15
-1
15 additions, 1 deletion
app/routes.py
app/utils.py
+8
-4
8 additions, 4 deletions
app/utils.py
plot_image.py
+4
-0
4 additions, 0 deletions
plot_image.py
with
27 additions
and
5 deletions
app/routes.py
+
15
−
1
View file @
2c7fa1c8
...
...
@@ -427,9 +427,23 @@ def download_csv():
.
order_by
(
embody_answer
.
page_idpage
)
\
.
all
()
pages_and_questions
=
{}
for
p
in
pages
:
questions_list
=
[(
p
.
idpage
,
a
.
idembody
)
for
a
in
embody_questions
]
pages_and_questions
[
p
.
idpage
]
=
questions_list
_questions
=
[
item
for
sublist
in
pages_and_questions
.
values
()
for
item
in
sublist
]
_embody_answers
=
map_answers_to_questions
(
embody_answers
,
_questions
)
answers_list
=
[]
for
answer_data
in
embody_answers
:
for
answer_data
in
_embody_answers
:
if
not
answer_data
:
answers_list
.
append
(
''
)
continue
try
:
coordinates
=
json
.
loads
(
answer_data
.
coordinates
)
...
...
This diff is collapsed.
Click to expand it.
app/utils.py
+
8
−
4
View file @
2c7fa1c8
...
...
@@ -41,10 +41,14 @@ def get_values_from_list_of_answers(page_question, answers):
page_id
=
page_question
[
0
]
question_id
=
page_question
[
1
]
for
_answer
in
answers
:
if
_answer
.
question_idquestion
==
question_id
and
\
_answer
.
page_idpage
==
page_id
:
return
int
(
_answer
.
answer
)
try
:
if
_answer
.
question_idquestion
==
question_id
and
\
_answer
.
page_idpage
==
page_id
:
return
int
(
_answer
.
answer
)
except
AttributeError
:
if
_answer
.
embody_question_idembody
==
question_id
and
\
_answer
.
page_idpage
==
page_id
:
return
_answer
return
None
...
...
This diff is collapsed.
Click to expand it.
plot_image.py
+
4
−
0
View file @
2c7fa1c8
...
...
@@ -106,6 +106,10 @@ if __name__ == '__main__':
except
NameError
:
print
(
"
Column didn
'
t contain image data. Try again with different column number.
"
)
except
SyntaxError
:
continue
except
IndexError
:
continue
np_array
=
np
.
transpose
(
np_array
)
images
.
append
(
np_array
)
...
...
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