Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
{
"name": "osx-default",
"description": "Inherited by all macOS configurations",
"description": "Inherited by all OSX configurations",
"hidden": true,
"cacheVariables": {
"CMAKE_FIND_FRAMEWORK": "LAST",
Expand All @@ -46,20 +46,13 @@
},
{
"name": "osx-64-ci",
"description": "Build options for a CI build on macOS",
"description": "Build options for a CI build on OSX",
"inherits": [
"osx-default",
"ci-default",
"conda"
]
},
{
"name": "osx-arm64-ci",
"description": "Build options for a CI build on an Arm macOS machine",
"inherits": [
"osx-64-ci"
]
},
{
"name": "linux-64-ci",
"description": "Build options for a CI build on Linux",
Expand Down Expand Up @@ -114,7 +107,7 @@
},
{
"name": "osx",
"description": "Default build options for a developer macOS build",
"description": "Default build options for a developer OSX build",
"inherits": [
"unix-debug",
"osx-default",
Expand Down
8 changes: 4 additions & 4 deletions Framework/Algorithms/test/AddSampleLogTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,11 @@ class AddSampleLogTest : public CxxTest::TestSuite {
// check the center angles from downstream
// V3D::angle returns radians
const Mantid::Kernel::V3D downstream(0, 0, 1);
TS_ASSERT_DELTA(westPosGood.angle(downstream) * 180 / M_PI, abs(det_arc1), 1e-12);
TS_ASSERT_DELTA(eastPosGood.angle(downstream) * 180 / M_PI, abs(det_arc2), 1e-12);
TS_ASSERT_EQUALS(westPosGood.angle(downstream) * 180 / M_PI, abs(det_arc1));
TS_ASSERT_EQUALS(eastPosGood.angle(downstream) * 180 / M_PI, abs(det_arc2));

// check the center distance - detector is 0.5m + det_lin motor
TS_ASSERT_DELTA(westPosGood.distance(ORIGIN), 0.5 + det_lin1, 1e-12);
TS_ASSERT_DELTA(eastPosGood.distance(ORIGIN), 0.5 + det_lin2, 1e-12);
TS_ASSERT_EQUALS(westPosGood.distance(ORIGIN), 0.5 + det_lin1);
TS_ASSERT_EQUALS(eastPosGood.distance(ORIGIN), 0.5 + det_lin2);
}
};
9 changes: 0 additions & 9 deletions Framework/Algorithms/test/GetDetectorOffsetsTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,6 @@ class GetDetectorOffsetsTest : public CxxTest::TestSuite {

// Verify that detectors which fail during peak fitting are masked.
void testExecFailuresAreMasked() {
// Peak fitting gives different results on ARM
#ifndef __aarch64__
const std::string uniquePrefix = "test_EFAM";
const std::string outputWSName(uniquePrefix + "_offsets");

Expand Down Expand Up @@ -605,14 +603,11 @@ class GetDetectorOffsetsTest : public CxxTest::TestSuite {

AnalysisDataService::Instance().remove(outputWSName);
AnalysisDataService::Instance().remove(maskWSName);
#endif
}

// Verify that detectors masked in the output include both those masked in the input, and also those that fail during
// peak fitting.
void testExecMasksAreCombined() {
// Peak fitting gives different results on ARM
#ifndef __aarch64__
const std::string uniquePrefix = "test_EFAM";
const std::string outputWSName(uniquePrefix + "_offsets");

Expand Down Expand Up @@ -661,16 +656,13 @@ class GetDetectorOffsetsTest : public CxxTest::TestSuite {

AnalysisDataService::Instance().remove(outputWSName);
AnalysisDataService::Instance().remove(maskWSName);
#endif
}

/**
* Verify that the output offsets and mask workspaces are have detector mask flags which are consistent with the mask
* values.
*/
void testExecMasksAreConsistentWithDetectorFlags() {
// Peak fitting gives different results on ARM
#ifndef __aarch64__
const std::string uniquePrefix = "test_EFAM";
const std::string outputWSName(uniquePrefix + "_offsets");

Expand Down Expand Up @@ -722,7 +714,6 @@ class GetDetectorOffsetsTest : public CxxTest::TestSuite {

AnalysisDataService::Instance().remove(outputWSName);
AnalysisDataService::Instance().remove(maskWSName);
#endif
}
};

Expand Down
8 changes: 4 additions & 4 deletions Framework/Algorithms/test/RebinByTimeBaseTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ template <class AlgorithmType> class RebinByTimeBaseTest {
// Check that xmin and xmax have been caclulated correctly.
TS_ASSERT_EQUALS(nBinsToBinTo, X.size());
// Added 1 nanosecond to start time
TS_ASSERT_DELTA(pulseTimeMin + double(step) / 2 - 1.e-9, X.front(), 1e-12);
TS_ASSERT_DELTA(pulseTimeMax - double(step) / 2 - 1.e-9, X.back(), 1e-12);
TS_ASSERT_EQUALS(pulseTimeMin + double(step) / 2 - 1.e-9, X.front());
TS_ASSERT_EQUALS(pulseTimeMax - double(step) / 2 - 1.e-9, X.back());
}

/*
Expand Down Expand Up @@ -450,8 +450,8 @@ template <class AlgorithmType> class RebinByTimeBaseTest {

// Check that xmin and xmax have been caclulated correctly.
TS_ASSERT_EQUALS(nBinsToBinTo + 1, X.size());
TS_ASSERT_DELTA(pulseTimeMin, X.front(), 1e-12);
TS_ASSERT_DELTA(pulseTimeMax, X.back(), 1e-12);
TS_ASSERT_EQUALS(pulseTimeMin, X.front());
TS_ASSERT_EQUALS(pulseTimeMax, X.back());

auto &Y = outWS->y(0);
TS_ASSERT_EQUALS(nBinsToBinTo, Y.size());
Expand Down
2 changes: 1 addition & 1 deletion Framework/CurveFitting/test/Algorithms/FitTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class FitTest : public CxxTest::TestSuite {
IFunction_sptr out = fit.getProperty("Function");
TS_ASSERT_DELTA(out->getParameter("A"), 1000, 30.0);
TS_ASSERT_DELTA(out->getParameter("B"), 26, 0.1);
TS_ASSERT_DELTA(out->getParameter("C"), 7.7, 0.2);
TS_ASSERT_DELTA(out->getParameter("C"), 7.7, 0.1);
TS_ASSERT_DELTA(out->getParameter("D"), 0, 0.1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class LevenbergMarquardtMDTest : public CxxTest::TestSuite {

void test_BSpline_fit_uniform_finer() {
double startx = -3.14;
double endx = 3.139;
double endx = 3.14;

std::shared_ptr<BSpline> bsp = std::make_shared<BSpline>();
bsp->setAttributeValue("Order", 3);
Expand Down Expand Up @@ -337,7 +337,7 @@ class LevenbergMarquardtMDTest : public CxxTest::TestSuite {
void test_BSpline_derivative() {

double startx = -3.14;
double endx = 3.139;
double endx = 3.14;

std::shared_ptr<BSpline> bsp = std::make_shared<BSpline>();
bsp->setAttributeValue("Order", 3);
Expand All @@ -361,7 +361,7 @@ class LevenbergMarquardtMDTest : public CxxTest::TestSuite {
void test_BSpline_derivative_2() {

double startx = -3.14;
double endx = 3.139;
double endx = 3.14;

std::shared_ptr<BSpline> bsp = std::make_shared<BSpline>();
bsp->setAttributeValue("Order", 4);
Expand All @@ -385,7 +385,7 @@ class LevenbergMarquardtMDTest : public CxxTest::TestSuite {
void test_BSpline_derivative_3() {

double startx = -3.14;
double endx = 3.139;
double endx = 3.14;

std::shared_ptr<BSpline> bsp = std::make_shared<BSpline>();
bsp->setAttributeValue("Order", 5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,6 @@ class LevenbergMarquardtTest : public CxxTest::TestSuite {
}

void test_cannot_reach_tolerance() {
// Different error code on ARM
#ifndef __aarch64__
API::FunctionDomain1D_sptr domain(new API::FunctionDomain1DVector(0.0, 1.0, 10));
API::FunctionValues mockData(*domain);
UserFunction dataMaker;
Expand All @@ -312,6 +310,5 @@ class LevenbergMarquardtTest : public CxxTest::TestSuite {
TS_ASSERT(!s.minimize());

TS_ASSERT_EQUALS(s.getError(), "Changes in function value are too small");
#endif
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class ComptonScatteringCountRateTest : public CxxTest::TestSuite {
TS_ASSERT_DELTA(func->getParameter("f1.Width"), 10.0, 1e-8);
TS_ASSERT_DELTA(func->getParameter("f1.Intensity"), 0.5 * intensity0, 1e-8);
TS_ASSERT_DELTA(func->getParameter("f2.A0"), 0.35708376, 1e-8);
TS_ASSERT_DELTA(func->getParameter("f2.A1"), 0.99989358, 1e-6);
TS_ASSERT_DELTA(func->getParameter("f2.A1"), 0.99989358, 1e-8);
}

private:
Expand Down
10 changes: 10 additions & 0 deletions Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,20 @@ class GaussianComptonProfileTest : public CxxTest::TestSuite {
FunctionValues values(domain);

TS_ASSERT_THROWS_NOTHING(func->function(domain, values));

// The intel compiler doesn't get quite to the precision
// of the other platforms
#if defined(__INTEL_COMPILER)
const double tol(1e-6);
TS_ASSERT_DELTA(0.104894, values.getCalculated(0), tol);
TS_ASSERT_DELTA(0.104489, values.getCalculated(1), tol);
TS_ASSERT_DELTA(0.102977, values.getCalculated(2), tol);
#else
const double tol(1e-10);
TS_ASSERT_DELTA(0.1048941000, values.getCalculated(0), tol);
TS_ASSERT_DELTA(0.1044889285, values.getCalculated(1), tol);
TS_ASSERT_DELTA(0.1029765223, values.getCalculated(2), tol);
#endif
}

private:
Expand Down
6 changes: 3 additions & 3 deletions Framework/DataHandling/test/LoadILLDiffractionTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ class LoadILLDiffractionTest : public CxxTest::TestSuite {
for (size_t row = 0; row < 10; ++row) {
for (size_t col = 0; col < 21; ++col) {
double val = static_cast<double>(col);
TS_ASSERT_DELTA(outputWS->y(row)[col], 3. * (val + 1), 1e-12)
TS_ASSERT_DELTA(outputWS->x(row)[col], 1. + 0.2 * val, 1e-12)
TS_ASSERT_DELTA(outputWS->e(row)[col], sqrt(3. * (val + 1)), 1e-12)
TS_ASSERT_EQUALS(outputWS->y(row)[col], 3. * (val + 1))
TS_ASSERT_EQUALS(outputWS->x(row)[col], 1. + 0.2 * val)
TS_ASSERT_EQUALS(outputWS->e(row)[col], sqrt(3. * (val + 1)))
}
}

Expand Down
6 changes: 3 additions & 3 deletions Framework/Geometry/src/Math/PolygonEdge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ PointClassification classify(const V2D &pt, const PolygonEdge &edge) {
const V2D &a = edge.direction();
const V2D b = p2 - edge.start();
double sa = a.X() * b.Y() - b.X() * a.Y();
if (sa > EPSILON) {
if (sa > 0.0) {
return OnLeft;
}
if (sa < -EPSILON) {
if (sa < 0.0) {
return OnRight;
}
if ((a.X() * b.X() < 0.0) || (a.Y() * b.Y() < 0.0)) {
Expand Down Expand Up @@ -81,7 +81,7 @@ PointClassification classify(const V2D &pt, const PolygonEdge &edge) {
PolygonEdge::Orientation orientation(const PolygonEdge &focusEdge, const PolygonEdge &refEdge, double &t) {
V2D normalToRef((refEdge.end().Y() - refEdge.start().Y()), (refEdge.start().X() - refEdge.end().X()));
double denom = normalToRef.scalar_prod(focusEdge.direction());
if (std::abs(denom) < EPSILON) {
if (Kernel::equals(denom, 0.0)) {
PointClassification edgeClass = classify(focusEdge.start(), refEdge);
if (edgeClass == OnLeft || edgeClass == OnRight) {
return PolygonEdge::Parallel;
Expand Down
4 changes: 2 additions & 2 deletions Framework/Kernel/test/UnitTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ std::string convert_units_check_range(const Unit &aUnit, std::vector<double> &sa
error_mess = "conversion: " + aUnit.unitID() + " Time range is zero (tof_left==tof_rignt)";
return error_mess;
}
if (tof1 * (1 + epsilon1) < tof_min || tof2 * (1 + epsilon1) < tof_min) {
if (tof1 < tof_min || tof2 < tof_min) {
error_mess = "conversion: " + aUnit.unitID() + " min time range is smaller then minimal conversion time";
return error_mess;
}
Expand Down Expand Up @@ -796,7 +796,7 @@ class UnitTest : public CxxTest::TestSuite {
void testdSpacingPerpendicularRange() {
std::vector<double> sample, rezult;

std::string err_mess = convert_units_check_range(dp, sample, rezult, FLT_EPSILON);
std::string err_mess = convert_units_check_range(dp, sample, rezult);
TSM_ASSERT(" ERROR:" + err_mess, err_mess.size() == 0);

for (size_t i = 0; i < sample.size(); i++) {
Expand Down
2 changes: 1 addition & 1 deletion Framework/MDAlgorithms/test/EvaluateMDFunctionTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class EvaluateMDFunctionTest : public CxxTest::TestSuite {
auto x = v[0];
auto y = v[1];
auto f = ws->getSignalAt(linearIndex);
TS_ASSERT_DELTA(f, x + y, 1e-7);
TS_ASSERT_DELTA(f, x + y, 1e-15);
}

// Remove workspace from the data service.
Expand Down
3 changes: 0 additions & 3 deletions Framework/Muon/test/CalculateMuonAsymmetryTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ class CalculateMuonAsymmetryTest : public CxxTest::TestSuite {
}

void test_simultaneous_fit_with_double_pulse_mode_enabled() {
// Different results on ARM
#ifndef __aarch64__
genData();
// need the 2 here to get multi func
std::vector<std::string> wsNames = {"ws1", "ws2"};
Expand Down Expand Up @@ -337,7 +335,6 @@ class CalculateMuonAsymmetryTest : public CxxTest::TestSuite {
TS_ASSERT_DELTA(outWS->e(0)[100], 0.0015, delta);
}
clearADS();
#endif
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
from mantid.simpleapi import BayesQuasi, CreateWorkspace, DeleteWorkspace, Load
from mantid.api import MatrixWorkspace, WorkspaceGroup
from plugins.algorithms.WorkflowAlgorithms.BayesQuasi import _calculate_eisf
import platform

SHOULD_SKIP = "arm" in platform.machine()


@unittest.skipIf(SHOULD_SKIP, "Skipping tests on ARM architecture")
class BayesQuasiTest(unittest.TestCase):
_res_ws = None
_sample_ws = None
Expand Down Expand Up @@ -202,26 +198,25 @@ def _validate_QLr_value_with_resnorm(self, result, probability, group):
@param prob Probability workspace from BayesQuasi
@param group Group workspace of fitted spectra from BayesQuasi
"""
significant_digits = 3

# Test values of result
np.testing.assert_approx_equal(result.dataY(0)[0], 153.471, significant=significant_digits)
np.testing.assert_approx_equal(result.dataY(1)[0], 1785.06, significant=significant_digits)
np.testing.assert_approx_equal(result.dataY(2)[0], 0.0588549, significant=significant_digits)
np.testing.assert_approx_equal(result.dataY(3)[0], 0.0791689, significant=significant_digits)
self.assertAlmostEqual(result.dataY(0)[0], 153.471, delta=1e-3)
self.assertAlmostEqual(result.dataY(1)[0], 1785.06, delta=1e-2)
self.assertAlmostEqual(result.dataY(2)[0], 0.0588549, delta=1e-4)
self.assertAlmostEqual(result.dataY(3)[0], 0.0791689, delta=1e-4)

# Test values of probability
np.testing.assert_approx_equal(probability.dataY(0)[0], -74887.1, significant=significant_digits)
np.testing.assert_approx_equal(probability.dataY(1)[0], -407.593, significant=significant_digits)
np.testing.assert_approx_equal(probability.dataY(2)[0], -0.480316, significant=2)
self.assertAlmostEqual(probability.dataY(0)[0], -74887.1, delta=1e-1)
self.assertAlmostEqual(probability.dataY(1)[0], -407.593, delta=1e-2)
self.assertAlmostEqual(probability.dataY(2)[0], -0.480316, delta=1e-2)

# Test values of group
sub_ws = group.getItem(0)
np.testing.assert_approx_equal(sub_ws.dataY(0)[0], 0.652046, significant=significant_digits)
np.testing.assert_approx_equal(sub_ws.dataY(1)[0], 0.48846, significant=significant_digits)
np.testing.assert_approx_equal(sub_ws.dataY(2)[0], -0.163586, significant=significant_digits)
np.testing.assert_approx_equal(sub_ws.dataY(3)[0], 0.414406, significant=significant_digits)
np.testing.assert_approx_equal(sub_ws.dataY(4)[0], -0.23764, significant=significant_digits)
self.assertAlmostEqual(sub_ws.dataY(0)[0], 0.652046, delta=1e-4)
self.assertAlmostEqual(sub_ws.dataY(1)[0], 0.48846, delta=1e-4)
self.assertAlmostEqual(sub_ws.dataY(2)[0], -0.163586, delta=1e-4)
self.assertAlmostEqual(sub_ws.dataY(3)[0], 0.414406, delta=1e-4)
self.assertAlmostEqual(sub_ws.dataY(4)[0], -0.23764, delta=1e-4)

def _validate_QSe_shape(self, result, group):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
import unittest
from mantid.api import WorkspaceGroup, MatrixWorkspace
from mantid.simpleapi import Load, config, mtd, D7AbsoluteCrossSections, GroupWorkspaces
import platform

SHOULD_SKIP = "arm" in platform.machine()


@unittest.skipIf(SHOULD_SKIP, "Skipping tests on ARM architecture")
class D7AbsoluteCrossSectionsTest(unittest.TestCase):
_facility = None
_instrument = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
import unittest
from mantid.api import MatrixWorkspace, WorkspaceGroup
from mantid.simpleapi import config, mtd, DirectILLAutoProcess
import platform

SHOULD_SKIP = "arm" in platform.machine()


@unittest.skipIf(SHOULD_SKIP, "Skipping tests on ARM architecture")
class DirectILLAutoProcessTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
import unittest
from mantid.simpleapi import SANSILLAutoProcess, config, mtd
from mantid.api import WorkspaceGroup, MatrixWorkspace
import platform

SHOULD_SKIP = "arm" in platform.machine()


@unittest.skipIf(SHOULD_SKIP, "Skipping tests on ARM architecture")
class SANSILLAutoProcessTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand Down
Loading