Commit ad667a60 authored by Sam Jenkins's avatar Sam Jenkins
Browse files

Re #25465 moved python replace Axis to python layer

parent 2df10965
......@@ -413,7 +413,6 @@ public:
int axes() const;
virtual Axis *getAxis(const std::size_t &axisIndex) const;
void replaceAxis(const std::size_t &axisIndex, std::unique_ptr<Axis> newAxis);
void pythonReplaceAxis(const std::size_t &axisIndex, Axis *newAxis);
/// Will return the number of Axis currently stored in the workspace it is not
/// always safe to assume it is just 2
......
......@@ -919,17 +919,6 @@ void MatrixWorkspace::replaceAxis(const std::size_t &axisIndex,
m_axes[axisIndex] = std::move(newAxis);
}
/**
* Raw Pointer version of replaceAxis to allow it to work with python
*
* @param axisIndex :: The index of the axis to replace
* @param newAxis :: A pointer to the new axis. The class will take ownership.
*/
void MatrixWorkspace::pythonReplaceAxis(const std::size_t &axisIndex,
Axis *newAxis) {
replaceAxis(axisIndex, std::unique_ptr<Axis>(newAxis));
}
/**
* Whether the workspace contains common X bins with logarithmic spacing
* @return whether the workspace contains common X bins with log spacing
......
......@@ -227,6 +227,17 @@ std::vector<size_t> maskedBinsIndices(MatrixWorkspace &self, const int i) {
return self.maskedBinsIndices(i);
}
/**
* Raw Pointer wrapper of replaceAxis to allow it to work with python
* @param self
* @param axisIndex :: The index of the axis to replace
* @param newAxis :: A pointer to the new axis. The class will take ownership.
*/
void pythonReplaceAxis(MatrixWorkspace &self, const std::size_t &axisIndex,
Axis *newAxis) {
self.replaceAxis(axisIndex, std::unique_ptr<Axis>(newAxis));
}
} // namespace
/** Python exports of the Mantid::API::MatrixWorkspace class. */
......@@ -330,7 +341,7 @@ void export_MatrixWorkspace() {
(arg("self"), arg("newVal")),
"Set distribution flag. If True the workspace has been divided by "
"the bin-width.")
.def("replaceAxis", &MatrixWorkspace::pythonReplaceAxis,
.def("replaceAxis", &pythonReplaceAxis,
(arg("self"), arg("axisIndex"), arg("newAxis")),
"Replaces one of the workspace's axes with the new one provided.")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment