/
GeneratePythonFitScript.h
46 lines (34 loc) · 1.39 KB
/
GeneratePythonFitScript.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/IFunction_fwd.h"
#include "MantidAlgorithms/DllConfig.h"
#include <string>
#include <vector>
namespace Mantid {
namespace Algorithms {
class MANTID_ALGORITHMS_DLL GeneratePythonFitScript : public API::Algorithm {
public:
std::string const name() const override;
int version() const override;
std::string const category() const override;
std::string const summary() const override;
std::vector<std::string> const seeAlso() const override;
private:
void init() override;
std::map<std::string, std::string> validateInputs() override;
void exec() override;
std::size_t getNumberOfDomainsInFunction(Mantid::API::IFunction_sptr const &function) const;
std::string generateFitScript(std::string const &fittingType) const;
std::string generateVariableSetupCode() const;
std::string generateSimultaneousFitCode() const;
std::string generateFunctionString() const;
void savePythonScript(std::string const &filepath, std::string const &contents) const;
};
} // namespace Algorithms
} // namespace Mantid