From 74eefeac3aad1dda2271b437a16d75c07900206f Mon Sep 17 00:00:00 2001
From: Verena Reimund <reimund@ill.eu>
Date: Mon, 28 May 2018 11:43:58 +0200
Subject: [PATCH] Avoid documentation warning, unrelated change

Noticed on master when making docs-qthelp:

Stitch1D-v3.rst:...: WARNING: Exception occurred in plotting Stitch1D-v3-2
 from Stitch1D-v3.rst:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/matplotlib/sphinxext/plot_directive.py", line 517, in run_code
    six.exec_(code, ns)
  File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 672, in exec_
    exec("""exec _code_ in _globs_, _locs_""")
  File "<string>", line 1, in <module>
  File "<string>", line 4, in <module>
  File "/users/reimund/mantid/bin/mantid/simpleapi.py", line 165, in Load
    'description: ' + str(ve) + '\nIf the file has been found '
ValueError: Problem when setting Filename. This is the detailed error description: Invalid value for property Filename (list of str lists) "INTER00013463": Unable to find file matching the string "INTER00013463", even after appending suggested file extensions.
If the file has been found but you got this error, you might not have read permissions or the file might be corrupted.
If the file has not been found, you might have forgotten to add its location in the data search directories.
looking for now-outdated files... none found

Data are not in usage data. Thus, message not added (.. include:: ../usagedata-note.txt).

Refs #22197
---
 docs/source/algorithms/Stitch1D-v3.rst | 47 ++++++++++++++------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/docs/source/algorithms/Stitch1D-v3.rst b/docs/source/algorithms/Stitch1D-v3.rst
index 9e5cc2db505..fb8e2ba4531 100644
--- a/docs/source/algorithms/Stitch1D-v3.rst
+++ b/docs/source/algorithms/Stitch1D-v3.rst
@@ -166,28 +166,31 @@ Usage
    from mantid.simpleapi import *
    import matplotlib.pyplot as plt
 
-   trans1 = Load('INTER00013463')
-   trans2 = Load('INTER00013464')
-
-   trans1_wav = CreateTransmissionWorkspaceAuto(trans1)
-   trans2_wav = CreateTransmissionWorkspaceAuto(trans2)
-
-   stitched_wav, y = Stitch1D(trans1_wav, trans2_wav, UseManualScaleFactor=True, ManualScaleFactor=0.85)
-
-   # plot the individual and stitched workspaces next to each other
-   fig, axs = plt.subplots(nrows=1, ncols=2, subplot_kw={'projection':'mantid'})
-
-   axs[0].plot(trans1_wav, wkspIndex=0, label=str(trans1_wav))
-   axs[0].plot(trans2_wav, wkspIndex=0, label=str(trans2_wav))
-   axs[0].legend()
-   # use same y scale on both plots
-   ylimits = axs[0].get_ylim()
-   axs[1].plot(stitched_wav, wkspIndex=0, color='k', label='stitched')
-   axs[1].legend()
-   axs[1].set_ylim(ylimits)
-
-   # uncomment the following line to show the plot window
-   #fig.show()
+   try:
+      trans1 = Load('INTER00013463')
+      trans2 = Load('INTER00013464')
+
+      trans1_wav = CreateTransmissionWorkspaceAuto(trans1)
+      trans2_wav = CreateTransmissionWorkspaceAuto(trans2)
+
+      stitched_wav, y = Stitch1D(trans1_wav, trans2_wav, UseManualScaleFactor=True, ManualScaleFactor=0.85)
+
+      # plot the individual and stitched workspaces next to each other
+      fig, axs = plt.subplots(nrows=1, ncols=2, subplot_kw={'projection':'mantid'})
+
+      axs[0].plot(trans1_wav, wkspIndex=0, label=str(trans1_wav))
+      axs[0].plot(trans2_wav, wkspIndex=0, label=str(trans2_wav))
+      axs[0].legend()
+      # use same y scale on both plots
+      ylimits = axs[0].get_ylim()
+      axs[1].plot(stitched_wav, wkspIndex=0, color='k', label='stitched')
+      axs[1].legend()
+      axs[1].set_ylim(ylimits)
+
+      # uncomment the following line to show the plot window
+      #fig.show()
+   except ValueError:
+      print("Cannot load data")
 
 .. categories::
 
-- 
GitLab