Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/4937_remove_deprecated_g…
Browse files Browse the repository at this point in the history
…etTwotheta'
  • Loading branch information
AndreiSavici committed Nov 13, 2013
2 parents 2564eb3 + a07b99c commit bb76923
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ using Mantid::Geometry::IDetector;
using Mantid::Geometry::IObjComponent;
using namespace boost::python;

namespace
{
/**
* The member 'getTwoTheta' was accidentally exported as 'getTwotheta'. This wraps the
* 'getTwotheta' export and raises a deprecation msg so that it can be removed in a future release
* Wrapper for a deprecated function to raise a deprecation warning if it was used.
*/
double getTwotheta(IDetector & self, const Mantid::Kernel::V3D& observer, const Mantid::Kernel::V3D& axis)
{
PyErr_WarnEx(PyExc_DeprecationWarning, "getTwotheta is deprecated, use getTwoTheta instead (Note the case variation)", 1);
return self.getTwoTheta(observer, axis);
}

}

void export_IDetector()
{
REGISTER_SHARED_PTR_TO_PYTHON(IDetector);
Expand All @@ -32,8 +17,6 @@ void export_IDetector()
.def("solidAngle", &IDetector::solidAngle, "Return the solid angle in steradians between this detector and an observer")
.def("getTwoTheta", &IDetector::getTwoTheta, "Calculate the angle between this detector, another component and an axis")
.def("getPhi", &IDetector::getPhi, "Returns the azimuthal angle of this detector")
// ----------------- Deprecated function that was accidentally exported with a case error ------------------------------
.def("getTwotheta", &getTwotheta)
;
;
}

0 comments on commit bb76923

Please sign in to comment.