This is a thread where users can discuss early interaction and experience of using the new Mantid Workbench.
If you are testing Workbench and have any thoughts/suggestions please post them here. This will allow the development team to capture a sense of user requirements and hopefully give you a more useful product.
Just a question, should the Mantid work bench be able to run scripts which currently work in Mantid?
I have some which use loadascii which fail, but donât know if I should be expecting it to work or not (and if not I will hold off testing until I can play)
Something which I just found, I had crashed the workbench in a way that also crashed the error reporter. That in itself wasnât an issue (and is reported through other channels), however, Windows was unable to kill Mantid, and so I had to go to the task manager. In the task manager I closed the Mantid process, but Mantid stayed alive (and crashed). I closed a few more things, but it took quite a while to find that it was pythonw which needed to be killed in order to close the workbench.
At the time I was trying (and clearly succeeding) in reproducing an bug I found in 3.13, but I have always been able to close Mantid before just clicking the normal exit button a few times. Am not sure about any fixes/workarounds but the workbench seems a bit harder to stop and restart.
I have some sort of error with the new workbench reading a function description and interpreting it in some no-clear way. My code is:
def TurnScanToP2TPlots(folderpath, nameofpol_file, nameofintensity_file,polarisation=False,suffix="",nobender=âI_no_transbenderâ, plotdata=False):
âââThis extracts the scan parameter value and name from a set of folders within a McStas scan and creates a dictionary of the filepaths and the parameter name and value; you should already be in the correct folder, you also want to have
LoadAscii(Filename=râC:\Users\npi34092\Dropbox\ISIS\OFFSPEC\Beamline\Upgrade\no_bender_5e7\l_after_bender.datâ, OutputWorkspace=âI_no_benderâ, Unit=âWavelengthâ). It then opens the folderpath, looks for pol and intensity files and generates P squared * transmission plots. It deletes the polarisation curves unless you say no toâ""
os.chdir(str(folderpath))
Which should do nothing. However this produces an error when run:
SyntaxError: (unicode error) âunicodeescapeâ codec canât decode bytes in position 258-259: truncated \UXXXXXXXX escape
Any ideas anyone? This was written in Mantid 3 and from quick investigation I canât reproduce the error with any print statement (python 2 or 3 formatted) or a couple of test other mantid algorithms in the same position
@joscooper Thanks for reporting these issues. I believe all of the issues you have reported above should be sorted in the current nightly build. We âsolvedâ the issues of missing imports for scripts that worked in MantidPlot by detecting on open whether it needs to have these imports applied and asking if the script should be fixed.
Still a few problems with scripts in the Workbench:
Spurious âSyntax error: unexpected indentâ with scripts which work OK in MantidPlot. The offending line is some way into the script and is not the first at that indent level. For example my âAnalyseThresholdScans9.pyâ which is on the Script Repository under Muon if you want a look. It has tab indents. If I run âTabs to Spacesâ it does run OK. (It already had some but perhaps not all required import statements at the top)
Algorithms defined in the Script Window do not appear in the Algorithms list and are not offered if I start typing in the box next to Execute. They did appear in MantidPlot. So I canât easily try out the algorithm that my script has just defined, and go back to make changes and retry.
The algorithms and subcategories at the second level (e.g. the next level down below Arithmetic, Muon, etc) are jumbled in a random order. MantidPlot sorts them.
Table workspace errors:
My script creates a table and adds columns with types X, Y and YError. In MantidPlot I can then just open the window, select the Y and YError columns and do Scatter plot.
In Workbench, the opened table window has no column types and attempting a plot immediately will fail. I can use the menus to identify them as X and Y. Y-Error doesnât seem to work: on plotting it I get the Y Error values plotted as another Y data set in a different colour. The menus are confusing - is it supposed to associate Y-Error columns with Y columns which need not be adjacent?
I am unable to launch the Workbench on Windows 10 64bit. I have installed both the 4.0 and the Nightly 4.0.20190327.1954-win64 but neither of them starts the Workbench. It directly comes up with the Error reporting window. There is also no output if I launch it in a terminal. MantidPlot runes fine.
If I try to run this .\mantidpython --classic .\workbench\app\mainwindow.py
I get an error:
File âC:\MantidNightlyInstall\bin\workbench\config\user.pyâ, line 90, in get
value = self.qsettings.value(option)
TypeError: unable to convert a QVariant back to a Python object
If I fix this by:
try:
value = self.qsettings.value(option)
except:
value = None
the workbench seams to start but I complains that it cannot find QT5 only QT4.
So then I set system variable QT_API to pyqt5, and Workbench is running fine now.
So then I changed back to:
value = self.qsettings.value(option)
this also works now.
I am not sure why Mantid was using pyqt4 as standard, the QT_API was not set before and then the standard should be pyqt5.
Sorry you are having trouble with the Workbench. The mantidpython script is currently hardcoding pyqt4 as we have not yet made some other parts that depend on that Qt5 compatible.
At a command prompt, in the C:\MantidNightlyInstall directory, could you run bin\launch_workbench.exe -console and see if that gives any errors?
I think this was caused by some other python installation, and some cross-talk between the user options, telling the python which runs the workbench to use pyqt4.
I have delete every python / QT installation and also every Mantid installation and also all rests which where left in the user folder.
Then I reinstalled Mantid 4.0 and the workbench did work without a problem, without setting the QT_API variable.
I then reinstalled anaconda python and it is still working.
I have now also reinstalled the Nightly, and started it as you suggested, it is also working now.
The only error I get is;
Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
How do I create a plot of a workspace with an extra line at y=0 (or x=0) as can be done in many other packages even including the old MantidPlot?
Thereâs an option for a grid but that adds lines for every tick and not just y=0. Iâm happy to create the plot with a small script if necessary rather than having a button in the plot settings dialog.
Iâve searched the matplotlib documentation with no success so farâŚ
Make sure the figure you want to add the axis line to is the last figure you created, then you can run the following to add the lines with whatever colour youâd like:
from __future__ import (absolute_import, division, print_function, unicode_literals)
import matplotlib.pyplot as plt
plt.axhline(0, color=âredâ) # this adds a horizontal line at y=0
plt.axvline(0, color=âgreenâ) # this adds a vertical line at x=0
plt.show()
A few pieces of really basic workflow feedback from my first interactions with Workbench (in 4.1).
Reducing TOSCA data:
A simple data reduction (multiple run numbers, summed, default rebin) seems to take MUCH longer than it used to. Unsure if this is expected.
Having reduced TOSCA data:
Right-click workspace â Plot â Spectrum⌠â Window pops up to allow you to select which spectrum to plot. In MantidPlot the cursor would already be in the box ready to accept keyboard input, it now requires clicking in the edit box. Very minor but utterly frustrating when plotting many spectra.
Having plotted TOSCA data (or any data??):
ANY change to the display options for the line (e.g. toggle error bars, changing line type, etc.) causes a reset of the axes to full scale, even if theyâve been set manually previously. This is annoying to say the least as TOSCA data files run from -20 - 10000 wavenumbers but 99% of plots use a smaller x-range.
Possibly this is due to be implemented but previously in MantidPlot it was possible to save a particular âdefaultâ set of options for plotting graphs, e.g. line type, etc. - this would be a great feature to have again.
After double-clicking on an axis to modify the axis limits then entering the minimum, hitting tab doesnât take you to the next âmaxâ text box. It seems to have ordered the âmaxâ text box at the end of âtab targetsâ.
@Hamish_C what is the size of the reduced file? I think the slow down may be a side effect of the new reduction algorithm, which was designed to prevent large (in the region of gigabyte) files.