From b7f157686d3602074f121fb11da67b28f89d9bac Mon Sep 17 00:00:00 2001 From: Despiix Date: Wed, 20 Nov 2024 14:29:29 +0000 Subject: [PATCH 1/2] Add Description and remove redundant 0s --- .../inc/MantidAlgorithms/CreateMonteCarloWorkspace.h | 5 ++++- Framework/Algorithms/src/CreateMonteCarloWorkspace.cpp | 5 ++++- qt/python/mantidqt/mantidqt/dialogs/spectraselectordialog.py | 5 +++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateMonteCarloWorkspace.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateMonteCarloWorkspace.h index d2b5a10221042..306e942bc5280 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/CreateMonteCarloWorkspace.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateMonteCarloWorkspace.h @@ -16,7 +16,10 @@ namespace Mantid { namespace Algorithms { using namespace std; -/** CreateMonteCarloWorkspace : TODO: DESCRIPTION +/** CreateMonteCarloWorkspace : The algorithm generates a simulated workspace by sampling from the probability +distribution of input data, useful for testing of fitting functions and modeling. +By generating a simulated dataset that mirrors the probability +distribution of existing data. */ class MANTID_ALGORITHMS_DLL CreateMonteCarloWorkspace : public API::Algorithm { public: diff --git a/Framework/Algorithms/src/CreateMonteCarloWorkspace.cpp b/Framework/Algorithms/src/CreateMonteCarloWorkspace.cpp index ca7b94e710c47..403f9e79eddd2 100644 --- a/Framework/Algorithms/src/CreateMonteCarloWorkspace.cpp +++ b/Framework/Algorithms/src/CreateMonteCarloWorkspace.cpp @@ -122,7 +122,7 @@ void CreateMonteCarloWorkspace::exec() { progress.report(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); - MatrixWorkspace_sptr outputWs = WorkspaceFactory::Instance().create(instWs); + MatrixWorkspace_sptr outputWs = WorkspaceFactory::Instance().create(instWs, 1); progress.report(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); @@ -138,6 +138,9 @@ void CreateMonteCarloWorkspace::exec() { std::this_thread::sleep_for(std::chrono::milliseconds(100)); outputWs->mutableY(0) = outputY; + + g_log.warning("Only the first spectrum is being plotted."); + progress.report(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); diff --git a/qt/python/mantidqt/mantidqt/dialogs/spectraselectordialog.py b/qt/python/mantidqt/mantidqt/dialogs/spectraselectordialog.py index 3fcc34974fdf7..d872f817c38b2 100644 --- a/qt/python/mantidqt/mantidqt/dialogs/spectraselectordialog.py +++ b/qt/python/mantidqt/mantidqt/dialogs/spectraselectordialog.py @@ -169,7 +169,8 @@ def _init_ui(self): # overwrite the "Yes to All" button text ui.buttonBox.button(QDialogButtonBox.YesToAll).setText("Plot All") # ok disabled by default - ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) + + ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(True) # validity markers ui.wkspIndicesValid.setIcon(red_asterisk()) @@ -548,7 +549,7 @@ def _validate_custom_logs(self, text: str, plot_all: bool = False) -> Union[bool if self._parent._ui.specNums.text() or self._parent._ui.wkspIndices.text(): self._parent._ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(True) else: - self._parent._ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) + self._parent._ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(True) return valid_options From de098bfb6cf637f5082c3678eb9cd2362d4dc863 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:46:29 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../Algorithms/New_features/38196_CreateMonteCarloWorkspace.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/release/v6.12.0/Inelastic/Algorithms/New_features/38196_CreateMonteCarloWorkspace.rst b/docs/source/release/v6.12.0/Inelastic/Algorithms/New_features/38196_CreateMonteCarloWorkspace.rst index fc79e934402bc..8a6641b0a3f92 100644 --- a/docs/source/release/v6.12.0/Inelastic/Algorithms/New_features/38196_CreateMonteCarloWorkspace.rst +++ b/docs/source/release/v6.12.0/Inelastic/Algorithms/New_features/38196_CreateMonteCarloWorkspace.rst @@ -1 +1 @@ -- New algorithm that creates a randomly simulated workspace by sampling from the probability distribution of input data. \ No newline at end of file +- New algorithm that creates a randomly simulated workspace by sampling from the probability distribution of input data.