Skip to content

Commit

Permalink
Re #6192. Remove python createSpectraAxis methods (in API v1 & v2).
Browse files Browse the repository at this point in the history
This is in preparation for changes to the SpectraAxis class, which
will make it impossible to create an axis of this type without a
parent workspace.
The removed methods are unused anyway.
  • Loading branch information
RussellTaylor committed Mar 8, 2013
1 parent 57d79ea commit 8b05cfd
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,6 @@ namespace PythonAPI
return new Mantid::API::NumericAxis(length);
}
/**
* Creates a SpectraAxis
* @param number :: of elements in the axis
* @return pointer to the axis object
*/
Mantid::API::Axis* createSpectraAxis(int length)
{
return new Mantid::API::SpectraAxis(length);
}
/**
* Creates a TextAxis
* @param number :: of elements in the axis
* @return pointer to the axis object
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/PythonAPI/src/api_exports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,6 @@ void export_dataitem()
;
// Axis creation helpers
def("createNumericAxis", & Mantid::PythonAPI::createNumericAxis, return_internal_reference<>());
def("createSpectraAxis", & Mantid::PythonAPI::createSpectraAxis, return_internal_reference<>());
def("createTextAxis", & Mantid::PythonAPI::createTextAxis, return_internal_reference<>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,6 @@ void export_NumericAxis()

}

/**
* Creates a SpectraAxis
* @param number :: of elements in the axis
* @return pointer to the axis object
*/
Axis* createSpectraAxis(int length)
{
return new Mantid::API::SpectraAxis(length);
}

void export_SpectraAxis()
{
class_< SpectraAxis, bases<Axis>, boost::noncopyable >("SpectraAxis", no_init)
.def("spectraNo", (const specid_t &(SpectraAxis::*)(const size_t &) const)&SpectraAxis::spectraNo,
return_value_policy<copy_const_reference>(), "Returns the spectrum no at the given index")
.def("create", &createSpectraAxis, return_internal_reference<>(), "Creates a new SpectraAxis of a specified length")
.staticmethod("create")
;
}

/**
* Creates a TextAxis
* @param number :: of elements in the axis
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest
from testhelpers import run_algorithm
from mantid.api import NumericAxis, SpectraAxis, TextAxis
from mantid.api import NumericAxis, TextAxis
import numpy as np

class AxisTest(unittest.TestCase):
Expand Down

0 comments on commit 8b05cfd

Please sign in to comment.