Mantid
Loading...
Searching...
No Matches
RunPythonScript.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidPythonInterface/api/DllConfig.h"
11
12#include <boost/python/dict.hpp>
13
14namespace Mantid {
15namespace PythonInterface {
16
17class PYTHON_API_DLL RunPythonScript final : public API::Algorithm {
18public:
19 const std::string name() const override;
20 int version() const override;
21 const std::string category() const override;
22 const std::string summary() const override;
23 std::map<std::string, std::string> validateInputs() override;
24
25private:
26 bool checkGroups() override;
27 void init() override;
28 void exec() override;
29
31 std::string scriptCode() const;
33 std::shared_ptr<API::Workspace> executeScript(const std::string &script) const;
35 boost::python::dict doExecuteScript(const std::string &script) const;
38 boost::python::dict buildLocals() const;
40 std::shared_ptr<API::Workspace> extractOutputWorkspace(const boost::python::dict &locals) const;
41};
42
43} // namespace PythonInterface
44} // namespace Mantid
std::string name
Definition Run.cpp:60
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Helper class which provides the Collimation Length for SANS instruments.