From 6b379fc06a21e4d1068b4d9da59b18b8460c85c7 Mon Sep 17 00:00:00 2001 From: Sarah Foxley <55837273+sf1919@users.noreply.github.com> Date: Fri, 16 May 2025 08:21:43 +0100 Subject: [PATCH] Revert "Add ARM option to building packages on Jenkins (#38990)" This reverts commit e1c83b7ac02c16bda4a9db011c5e3c5dfc6a49a5. --- CMakePresets.json | 13 +--- Framework/Algorithms/test/AddSampleLogTest.h | 8 +-- .../Algorithms/test/GetDetectorOffsetsTest.h | 9 --- .../Algorithms/test/RebinByTimeBaseTest.h | 8 +-- .../CurveFitting/test/Algorithms/FitTest.h | 2 +- .../FuncMinimizers/LevenbergMarquardtMDTest.h | 8 +-- .../FuncMinimizers/LevenbergMarquardtTest.h | 3 - .../ComptonScatteringCountRateTest.h | 2 +- .../Functions/GaussianComptonProfileTest.h | 10 +++ .../test/LoadILLDiffractionTest.h | 6 +- Framework/Geometry/src/Math/PolygonEdge.cpp | 6 +- Framework/Kernel/test/UnitTest.h | 4 +- .../test/EvaluateMDFunctionTest.h | 2 +- .../Muon/test/CalculateMuonAsymmetryTest.h | 3 - .../WorkflowAlgorithms/BayesQuasiTest.py | 29 ++++---- .../D7AbsoluteCrossSectionsTest.py | 4 -- .../DirectILLAutoProcessTest.py | 4 -- .../SANSILLAutoProcessTest.py | 4 -- .../SANSILLIntegrationTest.py | 4 -- .../test/PoldiSpectrumDomainFunctionTest.h | 4 +- .../test/PoldiSpectrumPawleyFunctionTest.h | 2 +- ...onvertMultipleRunsToSingleCrystalMDTest.py | 9 --- .../framework/Diffraction_Workflow_Test.py | 5 -- .../tests/framework/FindSatellitePeaksTest.py | 9 --- .../tests/framework/HB3AWorkflowTests.py | 17 ++--- .../ILLDirectGeometryReductionTest.py | 5 -- .../SANS2D/SANS2D_GDW20_4m_cycle_22_02.py | 6 +- .../tests/framework/ISIS_PowderHRPDTest.py | 12 ---- .../ISIS_WISHSingleCrystalReduction.py | 5 -- .../framework/MDNormBackgroundHYSPECTest.py | 5 -- .../tests/framework/MDNormCORELLITest.py | 5 -- .../tests/framework/POLDIFitPeaks2DTest.py | 2 +- .../tests/framework/ReduceOneSCD_Run.py | 6 +- .../ReflectometryISISCalculatePolEffTest.py | 5 -- .../SingleCrystalDiffuseReductionTest.py | 5 -- .../Conda/build-and-publish-devsite.sh | 2 +- buildconfig/Jenkins/Conda/conda-buildscript | 19 +---- buildconfig/Jenkins/Conda/conda-pre-commit | 2 +- buildconfig/Jenkins/Conda/cppcheck.sh | 2 +- .../Jenkins/Conda/delete-old-packages.sh | 2 +- buildconfig/Jenkins/Conda/doxygen.sh | 2 +- buildconfig/Jenkins/Conda/mamba-utils | 45 +++++++----- .../nightly_build_and_deploy.jenkinsfile | 72 +++---------------- buildconfig/Jenkins/Conda/package-conda | 11 +-- buildconfig/Jenkins/Conda/package-standalone | 11 +-- buildconfig/Jenkins/Conda/publish-to-anaconda | 2 +- buildconfig/Jenkins/Conda/publish-to-github | 2 +- buildconfig/Jenkins/build_and_publish_docs.sh | 2 +- conda/recipes/archive_env_logs.sh | 17 +++-- conda/recipes/conda_build_config.yaml | 3 +- installers/conda/osx/create_bundle.sh | 11 +-- scripts/test/DirectPropertyManagerTest.py | 3 +- 52 files changed, 127 insertions(+), 312 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 4a505786b036..e810f8b9c986 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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", @@ -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", @@ -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", diff --git a/Framework/Algorithms/test/AddSampleLogTest.h b/Framework/Algorithms/test/AddSampleLogTest.h index 4553355b50bb..1868a2d276f9 100644 --- a/Framework/Algorithms/test/AddSampleLogTest.h +++ b/Framework/Algorithms/test/AddSampleLogTest.h @@ -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); } }; diff --git a/Framework/Algorithms/test/GetDetectorOffsetsTest.h b/Framework/Algorithms/test/GetDetectorOffsetsTest.h index 8bc9fdfe4b06..5176b89e8abd 100644 --- a/Framework/Algorithms/test/GetDetectorOffsetsTest.h +++ b/Framework/Algorithms/test/GetDetectorOffsetsTest.h @@ -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"); @@ -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"); @@ -661,7 +656,6 @@ class GetDetectorOffsetsTest : public CxxTest::TestSuite { AnalysisDataService::Instance().remove(outputWSName); AnalysisDataService::Instance().remove(maskWSName); -#endif } /** @@ -669,8 +663,6 @@ class GetDetectorOffsetsTest : public CxxTest::TestSuite { * values. */ void testExecMasksAreConsistentWithDetectorFlags() { -// Peak fitting gives different results on ARM -#ifndef __aarch64__ const std::string uniquePrefix = "test_EFAM"; const std::string outputWSName(uniquePrefix + "_offsets"); @@ -722,7 +714,6 @@ class GetDetectorOffsetsTest : public CxxTest::TestSuite { AnalysisDataService::Instance().remove(outputWSName); AnalysisDataService::Instance().remove(maskWSName); -#endif } }; diff --git a/Framework/Algorithms/test/RebinByTimeBaseTest.h b/Framework/Algorithms/test/RebinByTimeBaseTest.h index e63fc1ef70b8..a44643573d59 100644 --- a/Framework/Algorithms/test/RebinByTimeBaseTest.h +++ b/Framework/Algorithms/test/RebinByTimeBaseTest.h @@ -401,8 +401,8 @@ template 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()); } /* @@ -450,8 +450,8 @@ template 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()); diff --git a/Framework/CurveFitting/test/Algorithms/FitTest.h b/Framework/CurveFitting/test/Algorithms/FitTest.h index cd8787e20da7..0b5822972280 100644 --- a/Framework/CurveFitting/test/Algorithms/FitTest.h +++ b/Framework/CurveFitting/test/Algorithms/FitTest.h @@ -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); } diff --git a/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h b/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h index 4234c70ac5e3..a3313e0fe07c 100644 --- a/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h +++ b/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h @@ -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 bsp = std::make_shared(); bsp->setAttributeValue("Order", 3); @@ -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 bsp = std::make_shared(); bsp->setAttributeValue("Order", 3); @@ -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 bsp = std::make_shared(); bsp->setAttributeValue("Order", 4); @@ -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 bsp = std::make_shared(); bsp->setAttributeValue("Order", 5); diff --git a/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtTest.h b/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtTest.h index bfff560b7db0..c3ead11f9fd9 100644 --- a/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtTest.h +++ b/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtTest.h @@ -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; @@ -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 } }; diff --git a/Framework/CurveFitting/test/Functions/ComptonScatteringCountRateTest.h b/Framework/CurveFitting/test/Functions/ComptonScatteringCountRateTest.h index 118b77e36c7a..1487c91c330e 100644 --- a/Framework/CurveFitting/test/Functions/ComptonScatteringCountRateTest.h +++ b/Framework/CurveFitting/test/Functions/ComptonScatteringCountRateTest.h @@ -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: diff --git a/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h b/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h index 22ebd5bf3fb7..5098642a0dcf 100644 --- a/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h +++ b/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h @@ -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: diff --git a/Framework/DataHandling/test/LoadILLDiffractionTest.h b/Framework/DataHandling/test/LoadILLDiffractionTest.h index ea0d88cde488..1b72f7ccd1e1 100644 --- a/Framework/DataHandling/test/LoadILLDiffractionTest.h +++ b/Framework/DataHandling/test/LoadILLDiffractionTest.h @@ -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(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))) } } diff --git a/Framework/Geometry/src/Math/PolygonEdge.cpp b/Framework/Geometry/src/Math/PolygonEdge.cpp index e4c11ad3bf3b..3b428b223f2d 100644 --- a/Framework/Geometry/src/Math/PolygonEdge.cpp +++ b/Framework/Geometry/src/Math/PolygonEdge.cpp @@ -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)) { @@ -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; diff --git a/Framework/Kernel/test/UnitTest.h b/Framework/Kernel/test/UnitTest.h index 7918e1406357..f21591ed3140 100644 --- a/Framework/Kernel/test/UnitTest.h +++ b/Framework/Kernel/test/UnitTest.h @@ -55,7 +55,7 @@ std::string convert_units_check_range(const Unit &aUnit, std::vector &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; } @@ -796,7 +796,7 @@ class UnitTest : public CxxTest::TestSuite { void testdSpacingPerpendicularRange() { std::vector 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++) { diff --git a/Framework/MDAlgorithms/test/EvaluateMDFunctionTest.h b/Framework/MDAlgorithms/test/EvaluateMDFunctionTest.h index 64eedcaeb466..65f0db02987e 100644 --- a/Framework/MDAlgorithms/test/EvaluateMDFunctionTest.h +++ b/Framework/MDAlgorithms/test/EvaluateMDFunctionTest.h @@ -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. diff --git a/Framework/Muon/test/CalculateMuonAsymmetryTest.h b/Framework/Muon/test/CalculateMuonAsymmetryTest.h index 823b70934c49..e1ce8f3c6753 100644 --- a/Framework/Muon/test/CalculateMuonAsymmetryTest.h +++ b/Framework/Muon/test/CalculateMuonAsymmetryTest.h @@ -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 wsNames = {"ws1", "ws2"}; @@ -337,7 +335,6 @@ class CalculateMuonAsymmetryTest : public CxxTest::TestSuite { TS_ASSERT_DELTA(outWS->e(0)[100], 0.0015, delta); } clearADS(); -#endif } }; diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/BayesQuasiTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/BayesQuasiTest.py index c2befaf31415..03085e63125f 100644 --- a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/BayesQuasiTest.py +++ b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/BayesQuasiTest.py @@ -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 @@ -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): """ diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/D7AbsoluteCrossSectionsTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/D7AbsoluteCrossSectionsTest.py index 4c65228f4e0a..5c6eb3358837 100644 --- a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/D7AbsoluteCrossSectionsTest.py +++ b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/D7AbsoluteCrossSectionsTest.py @@ -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 diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/DirectILLAutoProcessTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/DirectILLAutoProcessTest.py index 7e7df1f9cac0..0edbbbf71a65 100644 --- a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/DirectILLAutoProcessTest.py +++ b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/DirectILLAutoProcessTest.py @@ -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): diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLAutoProcessTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLAutoProcessTest.py index 1be5fd6deda1..25d8ff2833ea 100644 --- a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLAutoProcessTest.py +++ b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLAutoProcessTest.py @@ -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): diff --git a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLIntegrationTest.py b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLIntegrationTest.py index 9f6bf2bbddbb..f50670b0572f 100644 --- a/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLIntegrationTest.py +++ b/Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLIntegrationTest.py @@ -9,12 +9,8 @@ from mantid.api import mtd, MatrixWorkspace, WorkspaceGroup from mantid.kernel import config from mantid.simpleapi import SANSILLIntegration, SANSILLReduction -import platform -SHOULD_SKIP = "arm" in platform.machine() - -@unittest.skipIf(SHOULD_SKIP, "Skipping tests on ARM architecture") class SANSILLIntegrationTest(unittest.TestCase): _facility = None diff --git a/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h b/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h index f913c438c38e..e60e97722b13 100644 --- a/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h +++ b/Framework/SINQ/test/PoldiSpectrumDomainFunctionTest.h @@ -118,7 +118,7 @@ class PoldiSpectrumDomainFunctionTest : public CxxTest::TestSuite { 4.32910692237627, 0.746498624291666, 0.102391587633906}}; for (size_t i = 0; i < reference.size(); ++i) { - TS_ASSERT_DELTA(values[479 + i] / reference[i], 1.0, 1e-11); + TS_ASSERT_DELTA(values[479 + i] / reference[i], 1.0, 1e-14); } } @@ -147,7 +147,7 @@ class PoldiSpectrumDomainFunctionTest : public CxxTest::TestSuite { 4.32910692237627, 0.746498624291666, 0.102391587633906}}; for (size_t i = 0; i < reference.size(); ++i) { - TS_ASSERT_DELTA((jacobian.get(479 + i, 0)) / (reference[i] / 679.59369981039407842726), 1.0, 1e-11); + TS_ASSERT_DELTA((jacobian.get(479 + i, 0)) / (reference[i] / 679.59369981039407842726), 1.0, 1e-14); } } diff --git a/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h b/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h index 0f0d096ad91f..2b50eeae3fbc 100644 --- a/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h +++ b/Framework/SINQ/test/PoldiSpectrumPawleyFunctionTest.h @@ -152,7 +152,7 @@ class PoldiSpectrumPawleyFunctionTest : public CxxTest::TestSuite { 4.32910692237627, 0.746498624291666, 0.102391587633906}}; for (size_t i = 0; i < reference.size(); ++i) { - TS_ASSERT_DELTA(values[479 + i] / reference[i], 1.0, 1e-11); + TS_ASSERT_DELTA(values[479 + i] / reference[i], 1.0, 1e-12); } } diff --git a/Testing/SystemTests/tests/framework/ConvertMultipleRunsToSingleCrystalMDTest.py b/Testing/SystemTests/tests/framework/ConvertMultipleRunsToSingleCrystalMDTest.py index 649b581e756c..4d6355c7853e 100644 --- a/Testing/SystemTests/tests/framework/ConvertMultipleRunsToSingleCrystalMDTest.py +++ b/Testing/SystemTests/tests/framework/ConvertMultipleRunsToSingleCrystalMDTest.py @@ -4,16 +4,11 @@ # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + -import platform import systemtesting from mantid.simpleapi import ConvertMultipleRunsToSingleCrystalMD, Load, AlgorithmManager, SaveMD class ConvertMultipleRunsToSingleCrystalMDQSampleTest(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return ["CORELLI_29782.nxs", "CORELLI_29792.nxs"] @@ -51,10 +46,6 @@ def validate(self): class ConvertMultipleRunsToSingleCrystalMDHKLTest(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return ["CORELLI_29782.nxs", "CORELLI_29792.nxs", "SingleCrystalDiffuseReduction_UB.mat"] diff --git a/Testing/SystemTests/tests/framework/Diffraction_Workflow_Test.py b/Testing/SystemTests/tests/framework/Diffraction_Workflow_Test.py index 7d52fba9beb4..56e557fa9fd4 100644 --- a/Testing/SystemTests/tests/framework/Diffraction_Workflow_Test.py +++ b/Testing/SystemTests/tests/framework/Diffraction_Workflow_Test.py @@ -10,7 +10,6 @@ and runs Diffraction Workflow. """ -import platform import systemtesting import numpy import os @@ -34,10 +33,6 @@ class Diffraction_Workflow_Test(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def cleanup(self): Files = ["TOPAZ_3132.hkl", "TOPAZ_3132FFT.hkl"] for filename in Files: diff --git a/Testing/SystemTests/tests/framework/FindSatellitePeaksTest.py b/Testing/SystemTests/tests/framework/FindSatellitePeaksTest.py index a150e00359b6..cedfa57af89d 100644 --- a/Testing/SystemTests/tests/framework/FindSatellitePeaksTest.py +++ b/Testing/SystemTests/tests/framework/FindSatellitePeaksTest.py @@ -6,7 +6,6 @@ # SPDX - License - Identifier: GPL - 3.0 + from mantid.simpleapi import FindSatellitePeaks, Load import systemtesting -import platform def load_files(): @@ -17,10 +16,6 @@ def load_files(): class FindSatellitePeaksTestFixedNumQ(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return ["WISH_md_small.nxs", "WISH_peak_hkl_small.nxs", "WISH_peak_hkl_frac_small.nxs"] @@ -45,10 +40,6 @@ def validate(self): class FindSatellitePeaksTestAutoFindQ(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return ["WISH_md_small.nxs", "WISH_peak_hkl_small.nxs", "WISH_peak_hkl_frac_small.nxs"] diff --git a/Testing/SystemTests/tests/framework/HB3AWorkflowTests.py b/Testing/SystemTests/tests/framework/HB3AWorkflowTests.py index a894a6a55207..d4e730b06e18 100644 --- a/Testing/SystemTests/tests/framework/HB3AWorkflowTests.py +++ b/Testing/SystemTests/tests/framework/HB3AWorkflowTests.py @@ -6,7 +6,6 @@ # SPDX - License - Identifier: GPL - 3.0 + # pylint: disable=no-init,too-few-public-methods # ruff: noqa: E741 # Ambiguous variable name -import platform import numpy as np import systemtesting from mantid.simpleapi import ( @@ -45,13 +44,11 @@ def runTest(self): peaks = mtd[ws_name + "_integrated"] - absolute_tolerance = 1e-6 if "arm" in platform.machine() else 1e-7 - self.assertEqual(peaks.getNumberPeaks(), 15) ol = peaks.sample().getOrientedLattice() self.assertDelta(ol.a(), 5.231258554, 1.0e-7) self.assertDelta(ol.b(), 5.257701834, 1.0e-7) - self.assertDelta(ol.c(), 19.67041036, absolute_tolerance) + self.assertDelta(ol.c(), 19.67041036, 1.0e-7) self.assertEqual(ol.alpha(), 90) self.assertEqual(ol.beta(), 90) self.assertEqual(ol.gamma(), 90) @@ -99,13 +96,11 @@ def runTest(self): peaks = mtd[ws_name + "_integrated"] - absolute_tolerance = 1e-6 if "arm" in platform.machine() else 1e-7 - self.assertEqual(peaks.getNumberPeaks(), 114) ol = peaks.sample().getOrientedLattice() self.assertDelta(ol.a(), 5.231258554, 1.0e-7) self.assertDelta(ol.b(), 5.257701834, 1.0e-7) - self.assertDelta(ol.c(), 19.67041036, absolute_tolerance) + self.assertDelta(ol.c(), 19.67041036, 1.0e-7) self.assertEqual(ol.alpha(), 90) self.assertEqual(ol.beta(), 90) self.assertEqual(ol.gamma(), 90) @@ -133,12 +128,10 @@ def runTest(self): self.assertEqual(peaks.getItem(0).getNumberPeaks() + peaks.getItem(1).getNumberPeaks(), integrated.getNumberPeaks()) - absolute_tolerance = 1e-6 if "arm" in platform.machine() else 1e-7 - ol = integrated.sample().getOrientedLattice() self.assertDelta(ol.a(), 5.261051697, 1.0e-7) self.assertDelta(ol.b(), 5.224167511, 1.0e-7) - self.assertDelta(ol.c(), 19.689643636, absolute_tolerance) + self.assertDelta(ol.c(), 19.689643636, 1.0e-7) self.assertEqual(ol.alpha(), 90) self.assertEqual(ol.beta(), 90) self.assertEqual(ol.gamma(), 90) @@ -244,13 +237,11 @@ def runTest(self): self.assertEqual(integrated.getNumberPeaks(), 191) self.assertEqual(peaks.getItem(0).getNumberPeaks() + peaks.getItem(1).getNumberPeaks(), integrated.getNumberPeaks()) - absolute_tolerance = 1e-6 if "arm" in platform.machine() else 1e-7 - # should be the same as from MultiFileFindPeaksIntegrate test ol = integrated.sample().getOrientedLattice() self.assertDelta(ol.a(), 5.261051697, 1.0e-7) self.assertDelta(ol.b(), 5.224167511, 1.0e-7) - self.assertDelta(ol.c(), 19.689643636, absolute_tolerance) + self.assertDelta(ol.c(), 19.689643636, 1.0e-7) self.assertEqual(ol.alpha(), 90) self.assertEqual(ol.beta(), 90) self.assertEqual(ol.gamma(), 90) diff --git a/Testing/SystemTests/tests/framework/ILLDirectGeometryReductionTest.py b/Testing/SystemTests/tests/framework/ILLDirectGeometryReductionTest.py index 4ee5b2fa19f1..68554c2a0d9a 100644 --- a/Testing/SystemTests/tests/framework/ILLDirectGeometryReductionTest.py +++ b/Testing/SystemTests/tests/framework/ILLDirectGeometryReductionTest.py @@ -20,7 +20,6 @@ Subtract, Load, ) -import platform import systemtesting from testhelpers import assertRaisesNothing, create_algorithm @@ -182,10 +181,6 @@ def runTest(self): class IN5_Mask_Non_Overlapping_Bins(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def validate(self): self.tolerance = 1e-7 self.nanEqual = True diff --git a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py index d81ef810bac9..1ef52197caa6 100644 --- a/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py +++ b/Testing/SystemTests/tests/framework/ISIS/SANS/SANS2D/SANS2D_GDW20_4m_cycle_22_02.py @@ -4,7 +4,7 @@ # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + -import platform + import systemtesting from ISIS.SANS.isis_sans_system_test import ISISSansSystemTest @@ -44,10 +44,6 @@ def validate(self): @ISISSansSystemTest(SANSInstrument.SANS2D) class SANS2D_GDW20_4m_22_02_2D_M4(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredMemoryMB(self): return 2000 diff --git a/Testing/SystemTests/tests/framework/ISIS_PowderHRPDTest.py b/Testing/SystemTests/tests/framework/ISIS_PowderHRPDTest.py index 30b61f1e1f6c..715eb6fd26dc 100644 --- a/Testing/SystemTests/tests/framework/ISIS_PowderHRPDTest.py +++ b/Testing/SystemTests/tests/framework/ISIS_PowderHRPDTest.py @@ -52,10 +52,6 @@ class CreateVanadiumNoSolidAngleTest(systemtesting.MantidSystemTest): calibration_results = None existing_config = config["datasearch.directories"] - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return _gen_required_files() @@ -81,10 +77,6 @@ class CreateVanadiumNoSolidAngleNoEmptySubtractionTest(systemtesting.MantidSyste calibration_results = None existing_config = config["datasearch.directories"] - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return _gen_required_files() @@ -110,10 +102,6 @@ class FocusNoSolidAngleTest(systemtesting.MantidSystemTest): focus_results = None existing_config = config["datasearch.directories"] - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return _gen_required_files() diff --git a/Testing/SystemTests/tests/framework/ISIS_WISHSingleCrystalReduction.py b/Testing/SystemTests/tests/framework/ISIS_WISHSingleCrystalReduction.py index 951e0a1cb363..59a1e042c09b 100644 --- a/Testing/SystemTests/tests/framework/ISIS_WISHSingleCrystalReduction.py +++ b/Testing/SystemTests/tests/framework/ISIS_WISHSingleCrystalReduction.py @@ -43,7 +43,6 @@ from mantid import config import numpy as np import os -import platform from SaveReflections import num_modulation_vectors @@ -247,10 +246,6 @@ class WISHNormaliseDataAndCreateMDWorkspaceTest(MantidSystemTest): creation of MD workspace """ - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def cleanup(self): ADS.clear() diff --git a/Testing/SystemTests/tests/framework/MDNormBackgroundHYSPECTest.py b/Testing/SystemTests/tests/framework/MDNormBackgroundHYSPECTest.py index 42b9d347e4a0..17ff861caf7e 100644 --- a/Testing/SystemTests/tests/framework/MDNormBackgroundHYSPECTest.py +++ b/Testing/SystemTests/tests/framework/MDNormBackgroundHYSPECTest.py @@ -28,7 +28,6 @@ SetGoniometer, SetUB, ) -import platform import systemtesting # Define symmetry operation @@ -39,10 +38,6 @@ class MDNormBackgroundHYSPECTest(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - @staticmethod def prepare_single_exp_info_background(input_md_name, output_md_name, target_qframe="Q_lab"): if target_qframe not in ["Q_sample", "Q_lab"]: diff --git a/Testing/SystemTests/tests/framework/MDNormCORELLITest.py b/Testing/SystemTests/tests/framework/MDNormCORELLITest.py index 73d17525ae0a..dc6bcee15971 100644 --- a/Testing/SystemTests/tests/framework/MDNormCORELLITest.py +++ b/Testing/SystemTests/tests/framework/MDNormCORELLITest.py @@ -23,15 +23,10 @@ RecalculateTrajectoriesExtents, SetGoniometer, ) -import platform import systemtesting class MDNormCORELLITest(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return [ "CORELLI_29782.nxs", diff --git a/Testing/SystemTests/tests/framework/POLDIFitPeaks2DTest.py b/Testing/SystemTests/tests/framework/POLDIFitPeaks2DTest.py index 0ae2ebd5951e..3e6fe793f6f1 100644 --- a/Testing/SystemTests/tests/framework/POLDIFitPeaks2DTest.py +++ b/Testing/SystemTests/tests/framework/POLDIFitPeaks2DTest.py @@ -106,7 +106,7 @@ def analyseResults(self, filenames): indices = np.nonzero(yDataRef) maxDifference = np.abs(np.max((yDataCalc[indices] - yDataRef[indices]) / yDataCalc[indices])) - np.testing.assert_allclose(xDataCalc, xDataRef, atol=1e-7) + self.assertTrue(np.all(xDataCalc == xDataRef)) self.assertLessThan(maxDifference, 0.07) diff --git a/Testing/SystemTests/tests/framework/ReduceOneSCD_Run.py b/Testing/SystemTests/tests/framework/ReduceOneSCD_Run.py index 5b9548f61a10..d84ace198627 100644 --- a/Testing/SystemTests/tests/framework/ReduceOneSCD_Run.py +++ b/Testing/SystemTests/tests/framework/ReduceOneSCD_Run.py @@ -20,7 +20,7 @@ # # import time -import platform + import systemtesting import os @@ -55,10 +55,6 @@ class ReduceOneSCD_Run(systemtesting.MantidSystemTest): run_conventional_matrix_file = "" qconvention = config["Q.convention"] - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def setUp(self): # Make this test use crystallography convention config["Q.convention"] = "Crystallography" diff --git a/Testing/SystemTests/tests/framework/ReflectometryISISCalculatePolEffTest.py b/Testing/SystemTests/tests/framework/ReflectometryISISCalculatePolEffTest.py index 4a7d19de7abf..a32e31e7a362 100644 --- a/Testing/SystemTests/tests/framework/ReflectometryISISCalculatePolEffTest.py +++ b/Testing/SystemTests/tests/framework/ReflectometryISISCalculatePolEffTest.py @@ -8,7 +8,6 @@ from systemtesting import MantidSystemTest from abc import abstractmethod, ABCMeta from mantid.simpleapi import ReflectometryISISCalculatePolEff, Load -import platform class ReflectometryISISCalculatePolEffTestBase(MantidSystemTest, metaclass=ABCMeta): @@ -112,9 +111,5 @@ class ReflectometryISISCalculatePolEffAllCorrectionsTest(ReflectometryISISCalcul all_corrections = True include_mag_runs = True - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def __init__(self): super(ReflectometryISISCalculatePolEffAllCorrectionsTest, self).__init__() diff --git a/Testing/SystemTests/tests/framework/SingleCrystalDiffuseReductionTest.py b/Testing/SystemTests/tests/framework/SingleCrystalDiffuseReductionTest.py index e91eb4002b6a..2633835b6fee 100644 --- a/Testing/SystemTests/tests/framework/SingleCrystalDiffuseReductionTest.py +++ b/Testing/SystemTests/tests/framework/SingleCrystalDiffuseReductionTest.py @@ -4,16 +4,11 @@ # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + -import platform import systemtesting from mantid.simpleapi import SingleCrystalDiffuseReduction, Load, AlgorithmManager, SaveMD class SingleCrystalDiffuseTest(systemtesting.MantidSystemTest): - def skipTests(self): - # Numbers are different on ARM architecture so skip test - return "arm" in platform.machine() - def requiredFiles(self): return [ "CORELLI_29782.nxs", diff --git a/buildconfig/Jenkins/Conda/build-and-publish-devsite.sh b/buildconfig/Jenkins/Conda/build-and-publish-devsite.sh index 60e23e689a6e..129c2ccc521f 100755 --- a/buildconfig/Jenkins/Conda/build-and-publish-devsite.sh +++ b/buildconfig/Jenkins/Conda/build-and-publish-devsite.sh @@ -28,7 +28,7 @@ fi ############################################################################### # Mamba ############################################################################### -setup_mamba $WORKSPACE/mambaforge "devsite" false "" +setup_mamba $WORKSPACE/mambaforge "devsite" mamba install --yes sphinx sphinx_bootstrap_theme ############################################################################### diff --git a/buildconfig/Jenkins/Conda/conda-buildscript b/buildconfig/Jenkins/Conda/conda-buildscript index 3e552924ebb9..b6a9eac0a393 100755 --- a/buildconfig/Jenkins/Conda/conda-buildscript +++ b/buildconfig/Jenkins/Conda/conda-buildscript @@ -64,21 +64,6 @@ CLEAN_BUILD=false CLEAN_EXTERNAL_PROJECTS=false EXTRA_CMAKE_FLAGS="-DENABLE_PRECOMMIT=OFF" -# This removes '-ci' from the end of the cmake preset to get the target platform -# We check that it's not e.g. cppcheck or doxygen -PLATFORM="${CMAKE_PRESET%-ci}" -allowed_platforms=("win-64" "linux-64" "osx-64" "osx-arm64") -is_allowed=false -for item in "${allowed_platforms[@]}"; do - if [ "$PLATFORM" == "$item" ]; then - is_allowed=true - break - fi -done -if [ "$is_allowed" == false ]; then - PLATFORM="" -fi - # Handle flag inputs while [ ! $# -eq 0 ] do @@ -126,8 +111,8 @@ fi git clean -d -x --force --exclude=".Xauthority-*" $git_clean_excludes_extra # Mamba -setup_mamba $WORKSPACE/mambaforge "" $CLEAN_BUILD $PLATFORM -create_and_activate_mantid_developer_env $WORKSPACE $PLATFORM +setup_mamba $WORKSPACE/mambaforge "" $CLEAN_BUILD +create_and_activate_mantid_developer_env $WORKSPACE # Check whether this is an incremental build that only changes rst files if [ -d $BUILD_DIR ]; then diff --git a/buildconfig/Jenkins/Conda/conda-pre-commit b/buildconfig/Jenkins/Conda/conda-pre-commit index 1e02b88e5f7e..a4c4a9cc2305 100755 --- a/buildconfig/Jenkins/Conda/conda-pre-commit +++ b/buildconfig/Jenkins/Conda/conda-pre-commit @@ -26,7 +26,7 @@ GIT_SHA=$2 JOB_TYPE=$3 # Mamba -setup_mamba $SOURCE_DIR/mambaforge "pre-commit" false "" +setup_mamba $SOURCE_DIR/mambaforge "pre-commit" # rstcheck fails with exit code -11 with Python 3.13 mamba install --yes pre-commit python=3.12 diff --git a/buildconfig/Jenkins/Conda/cppcheck.sh b/buildconfig/Jenkins/Conda/cppcheck.sh index b9d3b91de02f..cc044e7efe9c 100755 --- a/buildconfig/Jenkins/Conda/cppcheck.sh +++ b/buildconfig/Jenkins/Conda/cppcheck.sh @@ -31,7 +31,7 @@ if $SCRIPT_DIR/../check_for_changes cpp; then fi # Setup conda environment -setup_mamba $WORKSPACE/mambaforge "" false "" +setup_mamba $WORKSPACE/mambaforge create_and_activate_mantid_developer_env $WORKSPACE ############################################################################### diff --git a/buildconfig/Jenkins/Conda/delete-old-packages.sh b/buildconfig/Jenkins/Conda/delete-old-packages.sh index 59c0d24a4197..34b9a7d03738 100755 --- a/buildconfig/Jenkins/Conda/delete-old-packages.sh +++ b/buildconfig/Jenkins/Conda/delete-old-packages.sh @@ -69,7 +69,7 @@ function delete_package() { ### # Mamba -setup_mamba $WORKSPACE/mambaforge "deletion-anaconda" false "" +setup_mamba $WORKSPACE/mambaforge "deletion-anaconda" mamba install --yes curl jq for name in "$@"; do diff --git a/buildconfig/Jenkins/Conda/doxygen.sh b/buildconfig/Jenkins/Conda/doxygen.sh index be9b18005946..d6552b0b89ab 100755 --- a/buildconfig/Jenkins/Conda/doxygen.sh +++ b/buildconfig/Jenkins/Conda/doxygen.sh @@ -24,7 +24,7 @@ shift 1 cd $WORKSPACE # Setup Mamba. Create and activate environment -setup_mamba $WORKSPACE/mambaforge "" true "" +setup_mamba $WORKSPACE/mambaforge "" true create_and_activate_mantid_developer_env $WORKSPACE # Create the build directory if it doesn't exist diff --git a/buildconfig/Jenkins/Conda/mamba-utils b/buildconfig/Jenkins/Conda/mamba-utils index 25821bc96e12..bd8afa38434d 100644 --- a/buildconfig/Jenkins/Conda/mamba-utils +++ b/buildconfig/Jenkins/Conda/mamba-utils @@ -9,18 +9,19 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # 1. Install prefix # 2. Optional. If provided, the name of an environment to create and activate # 3. Optional. If true is specified any existing mamba installation is removed -# 4. Optional. Target platform, e.g. linux-64 setup_mamba () { local install_prefix=$1 local env_name=$2 - local clean=$3 - local platform=$4 + local clean=false + if [ $# -eq 3 ]; then + clean=$3 + fi $SCRIPT_DIR/download-and-install-mambaforge $install_prefix $clean source $install_prefix/etc/profile.d/conda.sh source $install_prefix/etc/profile.d/mamba.sh if [ -n "$env_name" ]; then - create_and_activate_env "$env_name" "$platform" + create_and_activate_env "$env_name" fi } @@ -28,16 +29,23 @@ setup_mamba () { # create and activate a mamba environment # Args: # 1. Name of environment. -# 2. Optional platform, e.g. linux-64 +# 2. Optional environment file create_and_activate_env() { - local env_name=$1 - local conda_subdir_str=$2 - CONDA_SUBDIR=$conda_subdir_str mamba create --yes --name $env_name - mamba activate $env_name + #on ARM MAC OS, create x64 env rather than default ARM env. + if [[ $OSTYPE == 'darwin'* && $(uname -p) == 'arm' ]]; then + local conda_subdir_str="osx-64" + else + local conda_subdir_str="" + fi - if [[ -n "$conda_subdir_str" ]]; then - conda config --env --set subdir "$conda_subdir_str" + local env_name=$1 + local env_file=$2 + if [ -z "$env_file" ]; then + CONDA_SUBDIR=$conda_subdir_str mamba create --yes --name $env_name + else + CONDA_SUBDIR=$conda_subdir_str mamba env create --force --name $env_name --file $env_file fi + mamba activate $env_name } # Build the mantid-developer metapackage from source and @@ -45,17 +53,22 @@ create_and_activate_env() { # Args: # 1. Path to pass to the package-conda script for building # the mantid-developer metapackage. -# 2. Optional platform, e.g. linux-64 create_and_activate_mantid_developer_env() { local packaging_dir=$1 if [[ -z "$packaging_dir" ]]; then echo "A path is required for building the mantid-developer metapackage." exit 1 fi - shift - local platform=$1 - $SCRIPT_DIR/package-conda "$packaging_dir" --build-mantid-developer --platform "$platform" - create_and_activate_env mantid-developer "$platform" + $SCRIPT_DIR/package-conda "$packaging_dir" --build-mantid-developer + create_and_activate_env mantid-developer + + # We currently only build the mantid-developer metapackage for osx-64 + # so we need to make sure we set the subdir if we're running on an ARM machine. + # This should be removed once we start creating developer packages for ARM machine. + if [[ $OSTYPE == 'darwin'* && $(uname -p) == 'arm' ]]; then + conda config --env --set subdir osx-64 + fi + mamba install -c "$packaging_dir"/conda-bld mantid-developer --yes } diff --git a/buildconfig/Jenkins/Conda/nightly_build_and_deploy.jenkinsfile b/buildconfig/Jenkins/Conda/nightly_build_and_deploy.jenkinsfile index 58e3296ef009..2d1fbf595d14 100644 --- a/buildconfig/Jenkins/Conda/nightly_build_and_deploy.jenkinsfile +++ b/buildconfig/Jenkins/Conda/nightly_build_and_deploy.jenkinsfile @@ -39,7 +39,7 @@ switch(GIT_BRANCH) { default: PACKAGE_SUFFIX_DEFAULT = 'Unstable' ANACONDA_CHANNEL_LABEL_DEFAULT = 'unstable' - PLATFORM_CHOICES = ['none', 'all', 'linux-64', 'win-64', 'osx-64', 'osx-arm64'] + PLATFORM_CHOICES = ['none', 'all', 'linux-64', 'win-64', 'osx-64'] break } @@ -198,28 +198,6 @@ pipeline { } } } - stage('build and test: osx-arm64') { - when { - beforeAgent true - beforeOptions true - anyOf { - expression { env.BUILD_DEVEL == 'all' } - expression { env.BUILD_DEVEL == 'osx-arm64' } - } - } - agent { label 'osx-arm64' } - options { timestamps () } - steps { - checkoutSource("${GIT_SHA}") - build_and_test('osx-arm64') - } - post { - always { - archive_test_logs() - publish_test_reports() - } - } - } stage('package conda: linux-64') { when { beforeAgent true @@ -316,38 +294,6 @@ pipeline { } } } - stage('package conda: osx-arm64') { - when { - beforeAgent true - beforeOptions true - anyOf { - expression { env.BUILD_PACKAGE == 'osx-arm64' } - expression { env.BUILD_PACKAGE == 'all' } - } - } - agent { label 'osx-arm64' } - options { - timestamps () - retry(3) - } - steps { - // Clean up conda-bld before we start to avoid any - // confusion with old packages - dir('conda-bld') { - deleteDir() - } - checkoutSource("${GIT_SHA}") - // Build the base set of packages (ones not required for mantidworkbench) - // in parallel - package_conda('osx-arm64', 'base') - archive_conda_packages('osx-arm64') - } - post { - always { - archive_env_logs('osx-arm64') - } - } - } } } stage('Package workbench') { @@ -355,7 +301,7 @@ pipeline { axes { axis { name 'PLATFORM' - values 'linux-64', 'win-64', 'osx-64', 'osx-arm64' + values 'linux-64', 'win-64', 'osx-64' } } stages { @@ -390,7 +336,7 @@ pipeline { package_conda("${PLATFORM}", "workbench") archive_conda_packages("${PLATFORM}") - package_standalone("${PLATFORM}") + package_standalone() archive_standalone_package("${PLATFORM}") } post { @@ -619,7 +565,7 @@ def package_conda_options(platform, base_or_workbench) { } } - package_options = "${package_flags} --git-tag ${GIT_TAG} --platform ${platform}" + package_options = "${package_flags} --git-tag ${GIT_TAG}" return package_options.trim() } @@ -644,23 +590,23 @@ def generate_git_tag() { return git_tag } -def package_standalone(platform) { +def package_standalone() { packagescript_path = "${CISCRIPT_DIR}/package-standalone" if(isUnix()) { - sh "${packagescript_path} ${WORKSPACE} ${package_standalone_options(platform)}" + sh "${packagescript_path} ${WORKSPACE} ${package_standalone_options()}" } else { workspace_unix_style = toUnixStylePath("${WORKSPACE}") bat "\"${WIN_BASH}\" -ex -c \"${packagescript_path} ${workspace_unix_style}\ - ${package_standalone_options(platform)}\"" + ${package_standalone_options()}\"" } } -def package_standalone_options(platform) { +def package_standalone_options() { package_options = "" if(PACKAGE_SUFFIX.trim() != '') { package_options += " --package-suffix ${PACKAGE_SUFFIX}" } - return package_options.trim() + " --platform ${platform}" + return package_options.trim() } // Determine whether this build should be marked as a prerelease on GitHub. diff --git a/buildconfig/Jenkins/Conda/package-conda b/buildconfig/Jenkins/Conda/package-conda index 923b0be6315c..43f46370d86c 100755 --- a/buildconfig/Jenkins/Conda/package-conda +++ b/buildconfig/Jenkins/Conda/package-conda @@ -23,7 +23,6 @@ # --build-docs: build the HTML/Qthelp documentation # --build-workbench: build the workbench package using conda-build (this will implicitly build qt and mantid) # --git-tag: specify a tag for a release or nightly version -# --platform: target architecture, e.g. linux-64 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source $SCRIPT_DIR/mamba-utils start_time=$(date +%s) @@ -56,7 +55,6 @@ ENABLE_BUILD_QT=false ENABLE_BUILD_WORKBENCH=false ENABLE_BUILD_DOCS=false BUILD_WORKBENCH_WITH_DOCS=true -PLATFORM="" # Handle flag inputs while [ ! $# -eq 0 ] @@ -74,9 +72,6 @@ do --git-tag) GIT_TAG="$2" shift ;; - --platform) - PLATFORM="$2" - shift ;; *) echo "Argument not accepted: $1" exit 1 @@ -87,7 +82,7 @@ done # Mamba -setup_mamba $WORKSPACE/mambaforge "" true $PLATFORM +setup_mamba $WORKSPACE/mambaforge "" true mamba activate base mamba install --yes boa conda-verify versioningit @@ -127,12 +122,10 @@ EXTRA_BUILD_OPTIONS="--debug " if [[ $OSTYPE == "msys" ]]; then # Do not use build id as it makes the path too long (>260 chars) for CMake (Legacy Windows API issue) EXTRA_BUILD_OPTIONS+="--no-build-id" -elif [[ $PLATFORM == "osx-64" ]]; then +elif [[ $OSTYPE == 'darwin'* ]]; then EXTRA_BUILD_OPTIONS+="-m ./osx_64.yaml" fi -export CONDA_SUBDIR=$PLATFORM - # Run conda build. if [[ $ENABLE_BUILD_MANTID_DEVELOPER == true ]]; then conda mambabuild ./mantid-developer/ $EXTRA_BUILD_OPTIONS diff --git a/buildconfig/Jenkins/Conda/package-standalone b/buildconfig/Jenkins/Conda/package-standalone index bda09b204e86..0a5173caa0e0 100755 --- a/buildconfig/Jenkins/Conda/package-standalone +++ b/buildconfig/Jenkins/Conda/package-standalone @@ -18,7 +18,6 @@ # # Possible parameters: # --package-suffix: An optional suffix to pass to the standalone package step. -# --platform: Target platform, e.g. linux-64 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source $SCRIPT_DIR/mamba-utils @@ -45,16 +44,12 @@ fi # Parse options STANDALONE_PACKAGE_SUFFIX= -PLATFORM="" while [ ! $# -eq 0 ] do case "$1" in --package-suffix) STANDALONE_PACKAGE_SUFFIX="$2" shift ;; - --platform) - PLATFORM="$2" - shift ;; *) echo "Argument not accepted: $1" exit 1 @@ -64,7 +59,7 @@ do done # Mamba -setup_mamba $WORKSPACE/mambaforge "" true $PLATFORM +setup_mamba $WORKSPACE/mambaforge "" true mamba activate base mamba install --yes conda-index @@ -82,15 +77,11 @@ PACKAGING_ARGS="-c ${LOCAL_CHANNEL}" if [ -n "${STANDALONE_PACKAGE_SUFFIX}" ]; then PACKAGING_ARGS="${PACKAGING_ARGS} -s ${STANDALONE_PACKAGE_SUFFIX}" fi - if [[ $OSTYPE == 'msys'* ]]; then rm -fr *.exe ${PACKAGING_SCRIPTS_DIR}/win/create_package.sh $PACKAGING_ARGS elif [[ $OSTYPE == 'darwin'* ]]; then rm -fr *.dmg - if [ -n "${PLATFORM}" ]; then - PACKAGING_ARGS="${PACKAGING_ARGS} -p ${PLATFORM}" - fi ${PACKAGING_SCRIPTS_DIR}/osx/create_bundle.sh $PACKAGING_ARGS else rm -fr *.tar.xz diff --git a/buildconfig/Jenkins/Conda/publish-to-anaconda b/buildconfig/Jenkins/Conda/publish-to-anaconda index 5b5c0226368e..387ee2af5bc7 100755 --- a/buildconfig/Jenkins/Conda/publish-to-anaconda +++ b/buildconfig/Jenkins/Conda/publish-to-anaconda @@ -22,7 +22,7 @@ LABEL=$4 shift 4 # Setup Mamba -setup_mamba $WORKSPACE/mambaforge "publish-anaconda" false "" +setup_mamba $WORKSPACE/mambaforge "publish-anaconda" mamba install --yes anaconda-client for package in "$@" diff --git a/buildconfig/Jenkins/Conda/publish-to-github b/buildconfig/Jenkins/Conda/publish-to-github index 3ad422b1606b..8f96ea1ab158 100755 --- a/buildconfig/Jenkins/Conda/publish-to-github +++ b/buildconfig/Jenkins/Conda/publish-to-github @@ -40,7 +40,7 @@ github_release_cmd() { } # Mamba -setup_mamba $WORKSPACE/mambaforge publish-gh false "" +setup_mamba $WORKSPACE/mambaforge publish-gh mamba install --yes gh # Create a release and attach the given assets. diff --git a/buildconfig/Jenkins/build_and_publish_docs.sh b/buildconfig/Jenkins/build_and_publish_docs.sh index 2d5343d36c3a..4391c174c3fa 100755 --- a/buildconfig/Jenkins/build_and_publish_docs.sh +++ b/buildconfig/Jenkins/build_and_publish_docs.sh @@ -11,7 +11,7 @@ GIT_USER_EMAIL="mantid-buildserver@mantidproject.org" . source/buildconfig/Jenkins/Conda/mamba-utils # Install conda and environment -setup_mamba $WORKSPACE/mambaforge "docs-build" true "" +setup_mamba $WORKSPACE/mambaforge "docs-build" true mamba install -c ${CONDA_LABEL} --yes mantid-developer mantidqt rsync # Configure a clean build directory diff --git a/conda/recipes/archive_env_logs.sh b/conda/recipes/archive_env_logs.sh index bafc3bc85b5f..2933eb9ef0fd 100644 --- a/conda/recipes/archive_env_logs.sh +++ b/conda/recipes/archive_env_logs.sh @@ -4,14 +4,21 @@ build_prefix=$1 prefix=$2 package_name=$3 -log_directory=../../$target_platform/env_logs +platform=$(uname) +if [ "$platform" == Linux ] ; then + platform_dir=linux-64 +elif [ "$platform" == Darwin ] ; then + platform_dir=osx-64 +else + platform_dir=none +fi -mkdir -p $log_directory +mkdir -p ../../$platform_dir/env_logs source ../../../mambaforge/etc/profile.d/conda.sh #Just for first package (mantid), archive the package-conda environment if [ "$package_name" == mantid ] ; then - conda list --explicit --prefix ../../../mambaforge/envs/package-conda > $log_directory/package-conda_environment.txt 2>&1 || echo "Failed to write package-conda conda list output to file" + conda list --explicit --prefix ../../../mambaforge/envs/package-conda > ../../$platform_dir/env_logs/package-conda_environment.txt 2>&1 || echo "Failed to write package-conda conda list output to file" fi -conda list --explicit --prefix "$build_prefix" > $log_directory/"${package_name}"_build_environment.txt 2>&1 || echo "Failed to write build conda list output to file" -conda list --explicit --prefix "$prefix" > $log_directory/"${package_name}"_host_environment.txt 2>&1 || echo "Failed to write host conda list output to file" +conda list --explicit --prefix "$build_prefix" > ../../$platform_dir/env_logs/"${package_name}"_build_environment.txt 2>&1 || echo "Failed to write build conda list output to file" +conda list --explicit --prefix "$prefix" > ../../$platform_dir/env_logs/"${package_name}"_host_environment.txt 2>&1 || echo "Failed to write host conda list output to file" diff --git a/conda/recipes/conda_build_config.yaml b/conda/recipes/conda_build_config.yaml index 6586052af782..eaadf4e681cb 100644 --- a/conda/recipes/conda_build_config.yaml +++ b/conda/recipes/conda_build_config.yaml @@ -49,8 +49,7 @@ graphviz: # this must match the version in the developer dependencies jemalloc: - - 5.2.0 # [linux] - - 5.2.* # [osx] + - 5.2.0 jsoncpp: - '>=1.9.4,<2' diff --git a/installers/conda/osx/create_bundle.sh b/installers/conda/osx/create_bundle.sh index 75b846bc844d..c41343d862da 100755 --- a/installers/conda/osx/create_bundle.sh +++ b/installers/conda/osx/create_bundle.sh @@ -136,22 +136,17 @@ function usage() { echo "Options:" echo " -c Optional Conda channel overriding the default mantid" echo " -s Optional Add a suffix to the output mantid file, has to be Unstable, or Nightly or not used" - echo " -p Target platform, e.g. osx-64 or osx-arm64" + echo exit $exitcode } ## Script begin # Optional arguments conda_channel=mantid -platform="" suffix= while [ ! $# -eq 0 ] do case "$1" in - -p) - platform="$2" - shift - ;; -c) conda_channel="$2" shift @@ -215,7 +210,7 @@ if [[ "$suffix" == "Unstable" ]] || [[ "$suffix" == "Nightly" ]]; then fi echo "Creating Conda environment in '$bundle_conda_prefix'" -CONDA_SUBDIR="$platform" "$CONDA_EXE" create --quiet --prefix "$bundle_conda_prefix" --copy \ +CONDA_SUBDIR=osx-64 "$CONDA_EXE" create --quiet --prefix "$bundle_conda_prefix" --copy \ --channel "$conda_channel" --channel conda-forge --channel $mantid_channel --yes \ mantidworkbench \ jq # used for processing the version string @@ -242,6 +237,6 @@ create_plist "$bundle_contents" "$bundle_name" "$bundle_icon" "$version" # `create-dmg` returns error code by default due to lack of signing - this is suppressed using a command list. # Failure of the following `mv` command likely signifies `create-dmg` error. export PATH=$PATH:/opt/homebrew/bin/ -version_name="$bundle_name"-"$platform"-"$version" +version_name="$bundle_name"-"$version" create-dmg "$BUILD_DIR"/"$bundle_dirname" || true mv "${bundle_name} ${version}.dmg" "${version_name}.dmg" diff --git a/scripts/test/DirectPropertyManagerTest.py b/scripts/test/DirectPropertyManagerTest.py index 993eda1a0b5c..13c4bd8bae6d 100644 --- a/scripts/test/DirectPropertyManagerTest.py +++ b/scripts/test/DirectPropertyManagerTest.py @@ -761,7 +761,8 @@ def test_auto_ei(self): allEi = PropertyManager.incident_energy.getAllEiList() - np.testing.assert_allclose([allEi[0], allEi[1]], [8.8, 15.8], rtol=2e-2) + self.assertAlmostEqual(allEi[0], 8.8, 1) + self.assertAlmostEqual(allEi[1], 15.8, 1) def test_ignore_complex_defailts_changes_fom_instrument(self): ws = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=4, NumEvents=10)