Bug #1617

Multiple errors with python scripts

Added by Giulio Moro about 8 years ago. Updated about 8 years ago.

Status:In ProgressStart date:2016-02-21
Priority:NormalDue date:
Assignee:Giulio Moro% Done:

90%

Category:-
Target version:-

Description

I have a single test-0.xml file in saves (obtained from an AB interface test, attached to this post).
when running the python scripts I obtain the following results

$ pyhton comment_parser.py
Use: python  comment_parser.py [XML_files_location]
Using default path: ../saves
Traceback (most recent call last):
  File "comment_parser.py", line 73, in <module>
    commentstr = audioelement.find("./comment/response").text
AttributeError: 'NoneType' object has no attribute 'text'

$ pyhton evaluation_stats.py
Use: python evaluation_stats.py [results_folder]
Using default path: ../saves
test-0.xml
    TOTAL: 0 min 0 s
Number of XML files: 1
Number of pages: 0
Number of fragments: 0
Traceback (most recent call last):
  File "evaluation_stats.py", line 163, in <module>
    " (" + str(round(100.0*total_empty_comments/number_of_fragments,2)) + "%)" 
ZeroDivisionError: float division by zero

$ pyhton generate_report.py
Use: python generate_report.py [results_folder] [no_render | -nr]
Using default path: ../saves/
Traceback (most recent call last):
  File "generate_report.py", line 310, in <module>
    " (" + str(round(100.0*total_empty_comments/number_of_fragments,2)) + r"\%)\\"+'\n\t\t\t'
ZeroDivisionError: float division by zero

$ pyhton score_parser.py
Use: python score_parser.py [rating_folder_location]
Using default path: ../saves

$ pyhton score_plot.py
Use: python score_plot.py [rating folder] [plot_type] [-l/-legend]
Type 'python score_plot.py -h' for help.
Using default path: ../saves/ratings/ with boxplot.

$ pyhton timeline_view.py
Use: python timeline_view.py [XML_files_location]
Using default path: ../saves

$ pyhton timeline_view_movement.py
Use: python timeline_view_movement.py [XML_files_location]
Using default path: ../saves

after the scripts, the content of the saves folder is as follows. Is everything ok or am I missing something because of the above errors?

./ratings
./ratings/test-0-ratings-box.pdf
./ratings/test-0-ratings.csv
./ratings/test-1-ratings-box.pdf
./ratings/test-1-ratings.csv
./ratings/test-10-ratings-box.pdf
./ratings/test-10-ratings.csv
./ratings/test-11-ratings-box.pdf
./ratings/test-11-ratings.csv
./ratings/test-12-ratings-box.pdf
./ratings/test-12-ratings.csv
./ratings/test-13-ratings-box.pdf
./ratings/test-13-ratings.csv
./ratings/test-14-ratings-box.pdf
./ratings/test-14-ratings.csv
./ratings/test-15-ratings-box.pdf
./ratings/test-15-ratings.csv
./ratings/test-16-ratings-box.pdf
./ratings/test-16-ratings.csv
./ratings/test-17-ratings-box.pdf
./ratings/test-17-ratings.csv
./ratings/test-2-ratings-box.pdf
./ratings/test-2-ratings.csv
./ratings/test-3-ratings-box.pdf
./ratings/test-3-ratings.csv
./ratings/test-4-ratings-box.pdf
./ratings/test-4-ratings.csv
./ratings/test-5-ratings-box.pdf
./ratings/test-5-ratings.csv
./ratings/test-6-ratings-box.pdf
./ratings/test-6-ratings.csv
./ratings/test-7-ratings-box.pdf
./ratings/test-7-ratings.csv
./ratings/test-8-ratings-box.pdf
./ratings/test-8-ratings.csv
./ratings/test-9-ratings-box.pdf
./ratings/test-9-ratings.csv
./read.txt
./test-0.xml
./test-11
./test-11/test-11-comments-track-23.csv
./timelines
./timelines_movement

test-0.xml Magnifier 58.1 KB, downloaded 8 times Giulio Moro, 2016-02-21 10:12 AM

History

#1 Updated by Nicholas Jillings about 8 years ago

Brecht is best to talk through these. However I think it is most likely down to the python scripts not updated since the last specification change. I don't have some of the packages anyway so I can't test them.

#2 Updated by Nicholas Jillings about 8 years ago

  • Assignee set to Brecht De Man

#3 Updated by Brecht De Man about 8 years ago

What Nick said. Will look at this asap!
Thanks for the exhaustive bug report. More output/errors/screenshots always welcome.

#4 Updated by Brecht De Man about 8 years ago

Are you aware you're writing 'pyhton'? Is this a thing?

I mean to do the plotting and maybe also comment display in the 'analyse.html', although I may keep the Python scripts if that makes sense.

The

Use: python timeline_view_movement.py [XML_files_location]
Using default path: ../saves

notifications are not (necessarily) errors, it just tells you the default path (which is not '.'!) is being used since you didn't give an XML file location. Is this confusing/wrong?

#5 Updated by Giulio Moro about 8 years ago

oh well the pyhton thing was a typo when I copied it here.
I included the listing of the commands I typed and the list of files I obtained as a result.

Yes, I would say printing the "Using" line when the usage is correct is a bit confusing.
I guess to make the thing more intuitive, the script should print a brief of what it is going to do and/or a list of the generated files.

#6 Updated by Giulio Moro about 8 years ago

  • Status changed from New to In Progress
  • Assignee changed from Brecht De Man to Giulio Moro
  • % Done changed from 0 to 90

I pushed two lines worth of changes which make it work for me. https://code.soundsoftware.ac.uk/projects/webaudioevaluationtool/repository/revisions/3898754d5428b368d5336382d76af0ddc0c1fe96
This may be fixed by my push, but please Brecht double check it

I encountered a new issue which I am about to post in a new issue (hence the name).

Also available in: Atom PDF