Mantid
Loading...
Searching...
No Matches
GeneratePythonFitScript.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2021 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
11#include "MantidAlgorithms/DllConfig.h"
12
13#include <string>
14#include <vector>
15
16namespace Mantid {
17namespace Algorithms {
18
19class MANTID_ALGORITHMS_DLL GeneratePythonFitScript : public API::SerialAlgorithm {
20
21public:
22 std::string const name() const override;
23 int version() const override;
24
25 std::string const category() const override;
26 std::string const summary() const override;
27
28 std::vector<std::string> const seeAlso() const override;
29
30private:
31 void init() override;
32 std::map<std::string, std::string> validateInputs() override;
33 void exec() override;
34
35 std::size_t getNumberOfDomainsInFunction(Mantid::API::IFunction_sptr const &function) const;
36
37 std::string generateFitScript(std::string const &fittingType) const;
38 std::string generateVariableSetupCode() const;
39 std::string generateSimultaneousFitCode() const;
40 std::string generateFunctionString() const;
41
42 void savePythonScript(std::string const &filepath, std::string const &contents) const;
43};
44
45} // namespace Algorithms
46} // namespace Mantid
Base class for algorithms that can only run serially (Parallel::ExecutionMode::MasterOnly) in an MPI ...
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
Helper class which provides the Collimation Length for SANS instruments.