diff --git a/Framework/Algorithms/src/MaxEnt.cpp b/Framework/Algorithms/src/MaxEnt.cpp index ff26a37dab02e46b9fbfb932b22af1e7966997b8..a677b38ca00d4331ea6fba32726e52d8279d91a2 100644 --- a/Framework/Algorithms/src/MaxEnt.cpp +++ b/Framework/Algorithms/src/MaxEnt.cpp @@ -19,10 +19,8 @@ namespace Mantid { namespace Algorithms { -using Mantid::Kernel::Direction; -using Mantid::API::WorkspaceProperty; -using Mantid::HistogramData::Points; using Mantid::HistogramData::LinearGenerator; +using Mantid::HistogramData::Points; using namespace API; using namespace Kernel; @@ -224,7 +222,8 @@ void MaxEnt::exec() { MatrixWorkspace_const_sptr inWS = getProperty("InputWorkspace"); // Number of spectra size_t nspec = inWS->getNumberHistograms(); - // Number of data points + // Number of data points - assumed to be constant between spectra or + // this will throw an exception size_t npoints = inWS->blocksize() * resolutionFactor; // Number of X bins const size_t npointsX = inWS->isHistogramData() ? npoints + 1 : npoints; @@ -375,7 +374,7 @@ void MaxEnt::exec() { */ std::vector<double> MaxEnt::toComplex(API::MatrixWorkspace_const_sptr &inWS, size_t spec, bool errors) { - const size_t numBins = inWS->blocksize(); + const size_t numBins = inWS->y(0).size(); std::vector<double> result(numBins * 2); if (inWS->getNumberHistograms() % 2) @@ -684,11 +683,11 @@ void MaxEnt::populateImageWS(MatrixWorkspace_const_sptr &inWS, size_t spec, double dx = dataPoints[1] - x0; double delta = 1. / dx / npoints; - int isOdd = (inWS->blocksize() % 2) ? 1 : 0; + const int isOdd = (inWS->y(0).size() % 2) ? 1 : 0; - double shift = x0 * 2 * M_PI; + double shift = x0 * 2. * M_PI; if (!autoShift) - shift = 0; + shift = 0.; // X values for (int i = 0; i < npoints; i++) { diff --git a/docs/source/api/python/mantid/kernel/StringContainsValidator.rst b/docs/source/api/python/mantid/kernel/StringContainsValidator.rst new file mode 100644 index 0000000000000000000000000000000000000000..365aec4294fc6c915a9a5f061afe994e8f9eec1c --- /dev/null +++ b/docs/source/api/python/mantid/kernel/StringContainsValidator.rst @@ -0,0 +1,14 @@ +======================= +StringContainsValidator +======================= + +This a python binding to the C++ class Mantid::Kernel::StringContainsValidator. + +*bases:* :py:obj:`mantid.kernel.IValidator` + +.. module:`mantid.kernel` + +.. autoclass:: mantid.kernel.StringContainsValidator + :members: + :undoc-members: + :inherited-members: diff --git a/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp b/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp index 8ddcd9eba2ce7456cbeb452b7f2ee7a063330e24..a9633108d15872d0e13282709ef2447cc83ac121 100644 --- a/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp +++ b/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp @@ -20,6 +20,21 @@ using MantidQt::MantidWidgets::MuonFitPropertyBrowser; namespace { Logger g_log("MuonSequentialFitDialog"); +std::string removePath(const std::string &labelIn) { + size_t path = labelIn.find_last_of("/"); + if (path == std::string::npos) { + path = labelIn.find_last_of('\\'); + } + std::string useThisLabel = labelIn; + if (path != std::string::npos) { + path = path + 1; + size_t end = labelIn.find_last_of("."); + useThisLabel = labelIn.substr(path); + useThisLabel = useThisLabel.substr(0, end - path); + auto test = useThisLabel; + } + return useThisLabel; +} } const std::string MuonSequentialFitDialog::SEQUENTIAL_PREFIX("MuonSeqFit_"); @@ -328,7 +343,7 @@ void MuonSequentialFitDialog::continueFit() { // Get names of workspaces to fit const auto wsNames = m_dataPresenter->generateWorkspaceNames( m_ui.runs->getInstrumentOverride().toStdString(), - m_ui.runs->getText().toStdString(), false); + removePath(m_ui.runs->getText().toStdString()), false); if (wsNames.size() == 0) { QMessageBox::critical( this, "No data to fit", diff --git a/scripts/Muon/table_utils.py b/scripts/Muon/table_utils.py index cc68f7b17f4ef98dddabe37cb42ed9f2c9fdd339..822c0b7ea4541ae77e1ee29baf26a339fb0ad721 100644 --- a/scripts/Muon/table_utils.py +++ b/scripts/Muon/table_utils.py @@ -53,8 +53,8 @@ def setTableHeaders(table): if os.name != "nt": return version=QtCore.QSysInfo.WindowsVersion - windows10=160 # version code? - if(version==windows10): + WINDOWS_10=160 + if(version==WINDOWS_10): styleSheet= \ "QHeaderView::section{"\ +"border-top:0px solid #D8D8D8;"\ @@ -72,4 +72,5 @@ def setTableHeaders(table): +"background-color:white;"\ +"}" table.setStyleSheet(styleSheet) - return styleSheet + return styleSheet + return