Skip to content

Commit 885c47e

Browse files
authored
Merge branch 'main' into 38405_capture_cpp_stacktraces_from_core_dumps
2 parents 5674ecd + 8c5586f commit 885c47e

File tree

186 files changed

+1774
-1780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+1774
-1780
lines changed

.githooks/commit-msg

Lines changed: 0 additions & 163 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ repos:
5959
)$
6060
6161
- repo: https://github.com/astral-sh/ruff-pre-commit
62-
rev: v0.9.3
62+
rev: v0.9.6
6363
# ruff must appear before black in the list of hooks
6464
hooks:
6565
- id: ruff

Framework/API/inc/MantidAPI/FrameworkManager.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ class MANTID_API_DLL FrameworkManagerImpl {
7676
void loadPluginsUsingKey(const std::string &locationKey, const std::string &excludeKey);
7777
/// Set up the global locale
7878
void setGlobalNumericLocaleToC();
79-
/// Silence NeXus output
80-
void disableNexusOutput();
8179
/// Starts asynchronous tasks that are done as part of Start-up
8280
void asynchronousStartupTasks();
8381
/// Setup Usage Reporting if enabled

Framework/API/src/FrameworkManager.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "MantidKernel/MultiThreaded.h"
1717
#include "MantidKernel/PropertyManagerDataService.h"
1818
#include "MantidKernel/UsageService.h"
19-
#include "MantidNexusCpp/NeXusFile.hpp"
2019

2120
#include <boost/algorithm/string/classification.hpp>
2221
#include <boost/algorithm/string/split.hpp>
@@ -64,15 +63,6 @@ const char *PLUGINS_DIR_KEY = "framework.plugins.directory";
6463
const char *PLUGINS_EXCLUDE_KEY = "framework.plugins.exclude";
6564
} // namespace
6665

67-
/** This is a function called every time NeXuS raises an error.
68-
* This swallows the errors and outputs nothing.
69-
*/
70-
// Prevent clang-tidy trying to change the signature for ext. interface
71-
// NOLINTNEXTLINE(readability-non-const-parameter)
72-
void NexusErrorFunction(void *, const char *) {
73-
// Do nothing.
74-
}
75-
7666
#ifdef __linux__
7767
/**
7868
* Print current backtrace to the given stream
@@ -133,7 +123,6 @@ FrameworkManagerImpl::FrameworkManagerImpl() {
133123
ConfigService::Instance();
134124
g_log.notice() << Mantid::welcomeMessage() << '\n';
135125
loadPlugins();
136-
disableNexusOutput();
137126
setNumOMPThreadsToConfigValue();
138127

139128
g_log.debug() << "FrameworkManager created.\n";
@@ -339,9 +328,6 @@ void FrameworkManagerImpl::setGlobalNumericLocaleToC() {
339328
setlocale(LC_NUMERIC, "C");
340329
}
341330

342-
/// Silence NeXus output
343-
void FrameworkManagerImpl::disableNexusOutput() { ::NeXus::setError(nullptr, NexusErrorFunction); }
344-
345331
/// Starts asynchronous tasks that are done as part of Start-up.
346332
void FrameworkManagerImpl::asynchronousStartupTasks() {
347333
auto instrumentUpdates = Kernel::ConfigService::Instance().getValue<bool>("UpdateInstrumentDefinitions.OnStartup");

Framework/API/src/MatrixWorkspace.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,12 @@ void MatrixWorkspace::setPlotType(const std::string &t) {
333333
StringListValidator v(validPlotTypes);
334334

335335
if (v.isValid(t) == "") {
336-
if (run.hasProperty("plot_type"))
337-
run.addProperty("plot_type", t, true);
338-
else
339-
run.addProperty("plot_type", t, false);
336+
run.addProperty("plot_type", t, true);
340337
} else {
341338
std::string validValues = std::accumulate(
342339
validPlotTypes.begin() + 1, validPlotTypes.end(), validPlotTypes.front(),
343340
[](const std::string &valuesString, const std::string &plotType) { return valuesString + ", " + plotType; });
344-
g_log.warning("Invalid plot type '" + t + "'. Must be one of: " + validValues);
341+
throw std::invalid_argument("Invalid plot type '" + t + "'. Must be one of: " + validValues);
345342
}
346343
}
347344

@@ -375,7 +372,7 @@ void MatrixWorkspace::setMarkerStyle(const std::string &markerType) {
375372
[](const std::string &valuesString, const std::string &markerStyle) {
376373
return valuesString + ", " + markerStyle;
377374
});
378-
g_log.warning("Invalid marker type '" + markerType + "'. Must be one of: " + validValues);
375+
throw std::invalid_argument("Invalid marker type '" + markerType + "'. Must be one of: " + validValues);
379376
}
380377
}
381378

Framework/API/test/MatrixWorkspaceTest.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ class MatrixWorkspaceTest : public CxxTest::TestSuite {
407407
TS_ASSERT_EQUALS(ws->getPlotType(), "plot");
408408

409409
// test invalid is rejected
410-
ws->setPlotType("invalid");
410+
TS_ASSERT_THROWS(ws->setPlotType("invalid"), const std::invalid_argument &);
411411
TS_ASSERT_EQUALS(ws->getPlotType(), "plot");
412412

413413
// test valid is accepted
@@ -419,6 +419,9 @@ class MatrixWorkspaceTest : public CxxTest::TestSuite {
419419
// test default
420420
TS_ASSERT_EQUALS(ws->getMarkerStyle(), "vline");
421421

422+
TS_ASSERT_THROWS(ws->setMarkerStyle("invalid"), const std::invalid_argument &);
423+
TS_ASSERT_EQUALS(ws->getMarkerStyle(), "vline");
424+
422425
// test set
423426
ws->setMarkerStyle("square");
424427
TS_ASSERT_EQUALS(ws->getMarkerStyle(), "square");

Framework/Algorithms/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set(SRC_FILES
55
src/AddPeak.cpp
66
src/AddSampleLog.cpp
77
src/AddTimeSeriesLog.cpp
8-
src/AlignDetectors.cpp
98
src/AnnularRingAbsorption.cpp
109
src/AnyShapeAbsorption.cpp
1110
src/ApodizationFunctions.cpp
@@ -356,7 +355,6 @@ set(INC_FILES
356355
inc/MantidAlgorithms/AddPeak.h
357356
inc/MantidAlgorithms/AddSampleLog.h
358357
inc/MantidAlgorithms/AddTimeSeriesLog.h
359-
inc/MantidAlgorithms/AlignDetectors.h
360358
inc/MantidAlgorithms/AnnularRingAbsorption.h
361359
inc/MantidAlgorithms/AnyShapeAbsorption.h
362360
inc/MantidAlgorithms/ApodizationFunctions.h
@@ -714,7 +712,6 @@ set(TEST_FILES
714712
AddPeakTest.h
715713
AddSampleLogTest.h
716714
AddTimeSeriesLogTest.h
717-
AlignDetectorsTest.h
718715
AnnularRingAbsorptionTest.h
719716
AnyShapeAbsorptionTest.h
720717
AppendSpectraTest.h

Framework/Algorithms/inc/MantidAlgorithms/AlignDetectors.h

Lines changed: 0 additions & 77 deletions
This file was deleted.

Framework/Algorithms/inc/MantidAlgorithms/CreateCalFileByNames.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace Algorithms {
2222
* The offsets are all sets to zero and all detectors are selected. Detectors
2323
not assigned
2424
* to any group will appear as group 0, i.e. not included when using
25-
AlignDetector or
26-
* DiffractionFocussing algorithms.
25+
the
26+
* DiffractionFocussing algorithm.
2727
* The group number is assigned based on a descent in the instrument tree
2828
assembly.
2929
* If two assemblies are parented, say Bank1 and module1, and both assembly
@@ -59,7 +59,7 @@ class MANTID_ALGORITHMS_DLL CreateCalFileByNames final : public API::Algorithm {
5959
/// Algorithm's version
6060
int version() const override { return (1); }
6161
const std::vector<std::string> seeAlso() const override {
62-
return {"ReadGroupsFromFile", "CreateDummyCalFile", "AlignDetectors", "DiffractionFocussing",
62+
return {"ReadGroupsFromFile", "CreateDummyCalFile", "DiffractionFocussing",
6363
"LoadCalFile", "SaveCalFile", "MergeCalFiles"};
6464
}
6565
/// Algorithm's category for identification

0 commit comments

Comments
 (0)