Skip to content
Snippets Groups Projects
Commit 3da151f6 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch '89-matplotlib-invalid-display-variable' into 'master'

Resolve "matplotlib Invalid DISPLAY variable"

Closes #89

See merge request !96
parents 3b6cfe07 84a55551
No related branches found
No related tags found
1 merge request!96Resolve "matplotlib Invalid DISPLAY variable"
Pipeline #
......@@ -7,6 +7,14 @@ You can set the environment variable BOB_NO_STYLE_CHANGES to any value to avoid
this script from changing the matplotlib style values. """
from __future__ import print_function
# matplotlib stuff
import matplotlib
from matplotlib import pyplot
pyplot.switch_backend('agg') # switch to non-X backend
from matplotlib.backends.backend_pdf import PdfPages
# import bob.measure after matplotlib, so that it cannot define the backend
import bob.measure
import argparse
......@@ -14,11 +22,6 @@ import numpy
import math
import os
# matplotlib stuff
import matplotlib
matplotlib.use('pdf') # avoids TkInter threaded start
from matplotlib import pyplot
from matplotlib.backends.backend_pdf import PdfPages
if not os.environ.get('BOB_NO_STYLE_CHANGES'):
# make the fig size smaller so that everything becomes bigger
......@@ -457,4 +460,4 @@ def main(command_line_parameters=None):
pdf.savefig(_plot_dir(cmcs_eval, fars, args.rank, colors, args.legends, args.title[1] if args.title is not None else "DIR curve for evaluation set", args.legend_font_size, args.legend_position), bbox_inches='tight')
pdf.close()
except RuntimeError as e:
raise RuntimeError("During plotting of DIR curves, the following exception occured:\n%s")
raise RuntimeError("During plotting of DIR curves, the following exception occured:\n%s" % e)
import bob.measure
import os
import shutil
import tempfile
......@@ -23,6 +20,7 @@ data_dir = pkg_resources.resource_filename('bob.bio.base', 'test/data')
def _verify(parameters, test_dir, sub_dir, ref_modifier="", score_modifier=('scores',''), counts=3, check_zt=True):
from bob.bio.base.script.verify import main
import bob.measure
try:
main(parameters)
......@@ -248,8 +246,9 @@ def test_verify_filelist():
'--preferred-package', 'bob.bio.base'
]
from bob.bio.base.script.verify import main
import bob.measure
try:
from bob.bio.base.script.verify import main
main(parameters)
# assert that the score file exists
......@@ -292,8 +291,9 @@ def test_verify_missing():
'--imports', 'bob.bio.base.test.dummy'
]
from bob.bio.base.script.verify import main
import bob.measure
try:
from bob.bio.base.script.verify import main
main(parameters)
# assert that the score file exists
......@@ -448,6 +448,7 @@ def test_fusion():
# execute the script
from bob.bio.base.script.fuse_scores import main
import bob.measure
try:
main(parameters)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment