From c261835d1232019d550dcd636cf5a998c67c440e Mon Sep 17 00:00:00 2001 From: Pete Peterson Date: Tue, 11 Feb 2025 13:56:02 -0500 Subject: [PATCH 1/3] Change from NexusCpp to LegacyNexus This is a squashed version of #38824 Disambiguate which NeXus::File is actually being used Rename NexusDescriptor to LegacyNexusDescriptor Add LegacyNexus --- .../API/inc/MantidAPI/FileLoaderRegistry.h | 4 +- Framework/API/src/FileLoaderRegistry.cpp | 11 +- Framework/Kernel/CMakeLists.txt | 7 +- ...usDescriptor.h => LegacyNexusDescriptor.h} | 20 +-- ...scriptor.cpp => LegacyNexusDescriptor.cpp} | 27 ++-- ...ptorTest.h => LegacyNexusDescriptorTest.h} | 26 +-- .../LegacyNexus/inc/MantidLegacyNexus/napi.h | 148 ++++++++++-------- Framework/Muon/inc/MantidMuon/LoadMuonNexus.h | 6 +- .../Muon/inc/MantidMuon/LoadMuonNexus1.h | 2 +- .../Muon/inc/MantidMuon/LoadMuonNexus2.h | 2 +- Framework/Muon/src/LoadMuonNexus.cpp | 5 +- Framework/Muon/src/LoadMuonNexus1.cpp | 25 +-- Framework/Muon/src/LoadMuonNexus2.cpp | 5 +- .../CMake/MantidFrameworkConfig.cmake.in | 1 + 14 files changed, 165 insertions(+), 124 deletions(-) rename Framework/Kernel/inc/MantidKernel/{NexusDescriptor.h => LegacyNexusDescriptor.h} (80%) rename Framework/Kernel/src/{NexusDescriptor.cpp => LegacyNexusDescriptor.cpp} (80%) rename Framework/Kernel/test/{NexusDescriptorTest.h => LegacyNexusDescriptorTest.h} (76%) diff --git a/Framework/API/inc/MantidAPI/FileLoaderRegistry.h b/Framework/API/inc/MantidAPI/FileLoaderRegistry.h index 2eb466367a4f..ae163c00d5bf 100644 --- a/Framework/API/inc/MantidAPI/FileLoaderRegistry.h +++ b/Framework/API/inc/MantidAPI/FileLoaderRegistry.h @@ -9,7 +9,7 @@ #include "MantidAPI/AlgorithmFactory.h" #include "MantidAPI/IFileLoader.h" #include "MantidKernel/FileDescriptor.h" -#include "MantidKernel/NexusDescriptor.h" +#include "MantidKernel/LegacyNexusDescriptor.h" #include "MantidKernel/NexusHDF5Descriptor.h" #include "MantidKernel/SingletonHolder.h" @@ -90,7 +90,7 @@ class MANTID_API_DLL FileLoaderRegistryImpl { static void check(LoaderFormat format) { switch (format) { case Nexus: - if (!std::is_base_of, T>::value) { + if (!std::is_base_of, T>::value) { throw std::runtime_error(std::string("FileLoaderRegistryImpl::subscribe - Class '") + typeid(T).name() + "' registered as Nexus loader but it does not " "inherit from " diff --git a/Framework/API/src/FileLoaderRegistry.cpp b/Framework/API/src/FileLoaderRegistry.cpp index 7bdafa51e04f..1588e318eced 100644 --- a/Framework/API/src/FileLoaderRegistry.cpp +++ b/Framework/API/src/FileLoaderRegistry.cpp @@ -113,7 +113,7 @@ void FileLoaderRegistryImpl::unsubscribe(const std::string &name, const int vers */ const std::shared_ptr FileLoaderRegistryImpl::chooseLoader(const std::string &filename) const { using Kernel::FileDescriptor; - using Kernel::NexusDescriptor; + using Kernel::LegacyNexusDescriptor; using Kernel::NexusHDF5Descriptor; m_log.debug() << "Trying to find loader for '" << filename << "'\n"; @@ -125,7 +125,7 @@ const std::shared_ptr FileLoaderRegistryImpl::chooseLoader(const std // must also try NexusDescriptor algorithms because LoadMuonNexus can load both HDF4 and HDF5 files std::pair HDF4result = - searchForLoader>(filename, m_names[Nexus], m_log); + searchForLoader>(filename, m_names[Nexus], m_log); if (HDF5result.second > HDF4result.second) bestLoader = HDF5result.first; @@ -134,7 +134,8 @@ const std::shared_ptr FileLoaderRegistryImpl::chooseLoader(const std } else { try { bestLoader = - searchForLoader>(filename, m_names[Nexus], m_log).first; + searchForLoader>(filename, m_names[Nexus], m_log) + .first; } catch (std::exception const &e) { m_log.debug() << "Error in looking for NeXus files: " << e.what() << '\n'; } @@ -159,7 +160,7 @@ const std::shared_ptr FileLoaderRegistryImpl::chooseLoader(const std */ bool FileLoaderRegistryImpl::canLoad(const std::string &algorithmName, const std::string &filename) const { using Kernel::FileDescriptor; - using Kernel::NexusDescriptor; + using Kernel::LegacyNexusDescriptor; using Kernel::NexusHDF5Descriptor; // Check if it is in one of our lists @@ -175,7 +176,7 @@ bool FileLoaderRegistryImpl::canLoad(const std::string &algorithmName, const std IAlgorithm_sptr loader; if (nexus) { try { - loader = searchForLoader>(filename, names, m_log).first; + loader = searchForLoader>(filename, names, m_log).first; } catch (std::exception const &e) { m_log.debug() << "Error in looking for NeXus files: " << e.what() << '\n'; } diff --git a/Framework/Kernel/CMakeLists.txt b/Framework/Kernel/CMakeLists.txt index 322b0a364ccd..bc42ed66c642 100644 --- a/Framework/Kernel/CMakeLists.txt +++ b/Framework/Kernel/CMakeLists.txt @@ -74,7 +74,7 @@ set(SRC_FILES src/MultiFileValidator.cpp src/NDRandomNumberGenerator.cpp src/NeutronAtom.cpp - src/NexusDescriptor.cpp + src/LegacyNexusDescriptor.cpp src/NexusHDF5Descriptor.cpp src/NullValidator.cpp src/OptionalBool.cpp @@ -232,7 +232,7 @@ set(INC_FILES inc/MantidKernel/NearestNeighbours.h inc/MantidKernel/NetworkProxy.h inc/MantidKernel/NeutronAtom.h - inc/MantidKernel/NexusDescriptor.h + inc/MantidKernel/LegacyNexusDescriptor.h inc/MantidKernel/NexusHDF5Descriptor.h inc/MantidKernel/NullValidator.h inc/MantidKernel/OptionalBool.h @@ -388,7 +388,7 @@ set(TEST_FILES NDRandomNumberGeneratorTest.h NearestNeighboursTest.h NeutronAtomTest.h - NexusDescriptorTest.h + LegacyNexusDescriptorTest.h NexusHDF5DescriptorTest.h NullValidatorTest.h OptionalBoolTest.h @@ -488,6 +488,7 @@ target_link_libraries( PUBLIC Mantid::Types Mantid::Json Mantid::NexusCpp + Mantid::LegacyNexus Eigen3::Eigen TBB::tbb Poco::Foundation diff --git a/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h b/Framework/Kernel/inc/MantidKernel/LegacyNexusDescriptor.h similarity index 80% rename from Framework/Kernel/inc/MantidKernel/NexusDescriptor.h rename to Framework/Kernel/inc/MantidKernel/LegacyNexusDescriptor.h index abd554276500..37c992f9289a 100644 --- a/Framework/Kernel/inc/MantidKernel/NexusDescriptor.h +++ b/Framework/Kernel/inc/MantidKernel/LegacyNexusDescriptor.h @@ -15,7 +15,7 @@ #include #include -namespace NeXus { +namespace Mantid::LegacyNexus { class File; } @@ -29,22 +29,22 @@ namespace Kernel { On construction the simple details about the layout of the file are cached for faster querying later. */ -class MANTID_KERNEL_DLL NexusDescriptor { +class MANTID_KERNEL_DLL LegacyNexusDescriptor { public: /// Constructor accepting a filename - NexusDescriptor(const std::string &filename); + LegacyNexusDescriptor(const std::string &filename); /// Destructor - ~NexusDescriptor(); + ~LegacyNexusDescriptor(); /// Disable default constructor - NexusDescriptor() = delete; + LegacyNexusDescriptor() = delete; /// Disable copy operator - NexusDescriptor(const NexusDescriptor &) = delete; + LegacyNexusDescriptor(const LegacyNexusDescriptor &) = delete; /// Disable assignment operator - NexusDescriptor &operator=(const NexusDescriptor &) = delete; + LegacyNexusDescriptor &operator=(const LegacyNexusDescriptor &) = delete; /** * Access the filename @@ -61,7 +61,7 @@ class MANTID_KERNEL_DLL NexusDescriptor { * Access the open NeXus File object * @returns A reference to the open ::NeXus file object */ - inline ::NeXus::File &data() { return *m_file; } + inline Mantid::LegacyNexus::File &data() { return *m_file; } /// Returns the name & type of the first entry in the file const std::pair &firstEntryNameType() const; @@ -72,7 +72,7 @@ class MANTID_KERNEL_DLL NexusDescriptor { /// Initialize object with filename void initialize(const std::string &filename); /// Walk the tree and cache the structure - void walkFile(::NeXus::File &file, const std::string &rootPath, const std::string &className, + void walkFile(Mantid::LegacyNexus::File &file, const std::string &rootPath, const std::string &className, std::map &pmap, int level); /// Full filename @@ -87,7 +87,7 @@ class MANTID_KERNEL_DLL NexusDescriptor { std::map m_pathsToTypes; /// Open NeXus handle - std::unique_ptr<::NeXus::File> m_file; + std::unique_ptr m_file; }; } // namespace Kernel diff --git a/Framework/Kernel/src/NexusDescriptor.cpp b/Framework/Kernel/src/LegacyNexusDescriptor.cpp similarity index 80% rename from Framework/Kernel/src/NexusDescriptor.cpp rename to Framework/Kernel/src/LegacyNexusDescriptor.cpp index 40f5ca164ec3..539c9d2907f7 100644 --- a/Framework/Kernel/src/NexusDescriptor.cpp +++ b/Framework/Kernel/src/LegacyNexusDescriptor.cpp @@ -4,9 +4,9 @@ // NScD Oak Ridge National Laboratory, European Spallation Source, // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // SPDX - License - Identifier: GPL - 3.0 + -#include "MantidKernel/NexusDescriptor.h" -#include "MantidNexusCpp/NeXusException.hpp" -#include "MantidNexusCpp/NeXusFile.hpp" +#include "MantidKernel/LegacyNexusDescriptor.h" +#include "MantidLegacyNexus/NeXusException.hpp" +#include "MantidLegacyNexus/NeXusFile.hpp" #include #include @@ -26,7 +26,7 @@ namespace Mantid::Kernel { * involves simply checking for the signature if a HDF file at the start of the * file */ -NexusDescriptor::NexusDescriptor(const std::string &filename) +LegacyNexusDescriptor::LegacyNexusDescriptor(const std::string &filename) : m_filename(), m_extension(), m_firstEntryNameType(), m_rootAttrs(), m_pathsToTypes(), m_file(nullptr) { if (filename.empty()) { throw std::invalid_argument("NexusDescriptor() - Empty filename '" + filename + "'"); @@ -37,23 +37,25 @@ NexusDescriptor::NexusDescriptor(const std::string &filename) try { // this is very expesive as it walk the entire file initialize(filename); - } catch (::NeXus::Exception &e) { + } catch (Mantid::LegacyNexus::Exception &e) { throw std::invalid_argument("NexusDescriptor::initialize - File '" + filename + "' does not look like a HDF file.\n Error was: " + e.what()); } } -NexusDescriptor::~NexusDescriptor() = default; +LegacyNexusDescriptor::~LegacyNexusDescriptor() = default; /// Returns the name & type of the first entry in the file -const std::pair &NexusDescriptor::firstEntryNameType() const { return m_firstEntryNameType; } +const std::pair &LegacyNexusDescriptor::firstEntryNameType() const { + return m_firstEntryNameType; +} /** * @param path A string giving a path using UNIX-style path separators (/), e.g. * /raw_data_1, /entry/bank1 * @return True if the path exists in the file, false otherwise */ -bool NexusDescriptor::pathExists(const std::string &path) const { +bool LegacyNexusDescriptor::pathExists(const std::string &path) const { return (m_pathsToTypes.find(path) != m_pathsToTypes.end()); } @@ -64,11 +66,11 @@ bool NexusDescriptor::pathExists(const std::string &path) const { /** * Creates the internal cached structure of the file as a tree of nodes */ -void NexusDescriptor::initialize(const std::string &filename) { +void LegacyNexusDescriptor::initialize(const std::string &filename) { m_filename = filename; m_extension = std::filesystem::path(filename).extension().string(); - m_file = std::make_unique<::NeXus::File>(this->filename()); + m_file = std::make_unique(this->filename()); m_file->openPath("/"); m_rootAttrs.clear(); @@ -84,8 +86,9 @@ void NexusDescriptor::initialize(const std::string &filename) { * @param pmap [Out] An output map filled with mappings of path->type * @param level An integer defining the current level in the file */ -void NexusDescriptor::walkFile(::NeXus::File &file, const std::string &rootPath, const std::string &className, - std::map &pmap, int level) { +void LegacyNexusDescriptor::walkFile(Mantid::LegacyNexus::File &file, const std::string &rootPath, + const std::string &className, std::map &pmap, + int level) { if (!rootPath.empty()) { pmap.emplace(rootPath, className); } diff --git a/Framework/Kernel/test/NexusDescriptorTest.h b/Framework/Kernel/test/LegacyNexusDescriptorTest.h similarity index 76% rename from Framework/Kernel/test/NexusDescriptorTest.h rename to Framework/Kernel/test/LegacyNexusDescriptorTest.h index 4af6b83d2759..55f0123f2eb0 100644 --- a/Framework/Kernel/test/NexusDescriptorTest.h +++ b/Framework/Kernel/test/LegacyNexusDescriptorTest.h @@ -7,8 +7,8 @@ #pragma once #include "MantidKernel/ConfigService.h" -#include "MantidKernel/NexusDescriptor.h" -#include "MantidNexusCpp/NeXusFile.hpp" +#include "MantidKernel/LegacyNexusDescriptor.h" +#include "MantidLegacyNexus/NeXusFile.hpp" #include #include @@ -16,16 +16,16 @@ #include -using Mantid::Kernel::NexusDescriptor; +using Mantid::Kernel::LegacyNexusDescriptor; -class NexusDescriptorTest : public CxxTest::TestSuite { +class LegacyNexusDescriptorTest : public CxxTest::TestSuite { public: // This pair of boilerplate methods prevent the suite being created statically // This means the constructor isn't called when running other tests - static NexusDescriptorTest *createSuite() { return new NexusDescriptorTest(); } - static void destroySuite(NexusDescriptorTest *suite) { delete suite; } + static LegacyNexusDescriptorTest *createSuite() { return new LegacyNexusDescriptorTest(); } + static void destroySuite(LegacyNexusDescriptorTest *suite) { delete suite; } - NexusDescriptorTest() { + LegacyNexusDescriptorTest() { using Mantid::Kernel::ConfigService; auto dataPaths = ConfigService::Instance().getDataSearchDirs(); for (auto &dataPath : dataPaths) { @@ -45,10 +45,10 @@ class NexusDescriptorTest : public CxxTest::TestSuite { "The AutoTestData directory needs to be in the search path"); } - m_testHDF5 = std::make_shared(m_testHDF5Path); + m_testHDF5 = std::make_shared(m_testHDF5Path); } - //=================================== NexusDescriptor methods + //=================================== LegacyNexusDescriptor methods //================================== void test_Constructor_Initializes_Object_Correctly_Given_HDF_File() { @@ -57,15 +57,15 @@ class NexusDescriptorTest : public CxxTest::TestSuite { } void test_Constructor_Throws_With_Empty_filename() { - TS_ASSERT_THROWS(NexusDescriptor(""), const std::invalid_argument &); + TS_ASSERT_THROWS(LegacyNexusDescriptor(""), const std::invalid_argument &); } void test_Constructor_Throws_With_NonExistant_filename() { - TS_ASSERT_THROWS(NexusDescriptor("__ThisShouldBeANonExistantFile.txt"), const std::invalid_argument &); + TS_ASSERT_THROWS(LegacyNexusDescriptor("__ThisShouldBeANonExistantFile.txt"), const std::invalid_argument &); } void test_Constructor_Throws_When_Given_File_Not_Identified_As_HDF() { - TS_ASSERT_THROWS(NexusDescriptor fd(m_testNonHDFPath), const std::invalid_argument &); + TS_ASSERT_THROWS(LegacyNexusDescriptor fd(m_testNonHDFPath), const std::invalid_argument &); } void test_File_Handle_Returned_By_Data_Is_Valid() { @@ -95,5 +95,5 @@ class NexusDescriptorTest : public CxxTest::TestSuite { private: std::string m_testHDF5Path; std::string m_testNonHDFPath; - std::shared_ptr m_testHDF5; + std::shared_ptr m_testHDF5; }; diff --git a/Framework/LegacyNexus/inc/MantidLegacyNexus/napi.h b/Framework/LegacyNexus/inc/MantidLegacyNexus/napi.h index 1da18fab8a38..e5a751e4be3e 100644 --- a/Framework/LegacyNexus/inc/MantidLegacyNexus/napi.h +++ b/Framework/LegacyNexus/inc/MantidLegacyNexus/napi.h @@ -193,14 +193,15 @@ extern "C" { * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_init */ -MANTID_LEGACYNEXUS_DLL NXstatus NXopen(CONSTCHAR *filename, NXaccess access_method, NXhandle *pHandle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXopen(CONSTCHAR *filename, NXaccess access_method, + NXhandle *pHandle); /** * Opens an existing NeXus file a second time for e.g. access from another thread. * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_init */ -MANTID_LEGACYNEXUS_DLL NXstatus NXreopen(NXhandle pOrigHandle, NXhandle *pNewHandle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXreopen(NXhandle pOrigHandle, NXhandle *pNewHandle); /** * close a NeXus file @@ -209,7 +210,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXreopen(NXhandle pOrigHandle, NXhandle *pNewHan * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_init */ -MANTID_LEGACYNEXUS_DLL NXstatus NXclose(NXhandle *pHandle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXclose(NXhandle *pHandle); /** * flush data to disk @@ -217,7 +218,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXclose(NXhandle *pHandle); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXflush(NXhandle *pHandle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXflush(NXhandle *pHandle); /** * NeXus groups are NeXus way of structuring information into a hierarchy. @@ -228,7 +229,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXflush(NXhandle *pHandle); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_group */ -MANTID_LEGACYNEXUS_DLL NXstatus NXmakegroup(NXhandle handle, CONSTCHAR *name, CONSTCHAR *NXclass); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXmakegroup(NXhandle handle, CONSTCHAR *name, CONSTCHAR *NXclass); /** * Step into a group. All further access will be within the opened group. @@ -238,7 +239,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXmakegroup(NXhandle handle, CONSTCHAR *name, CO * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_group */ -MANTID_LEGACYNEXUS_DLL NXstatus NXopengroup(NXhandle handle, CONSTCHAR *name, CONSTCHAR *NXclass); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXopengroup(NXhandle handle, CONSTCHAR *name, CONSTCHAR *NXclass); /** * Open the NeXus object with the path specified @@ -249,7 +250,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXopengroup(NXhandle handle, CONSTCHAR *name, CO * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_navigation */ -MANTID_LEGACYNEXUS_DLL NXstatus NXopenpath(NXhandle handle, CONSTCHAR *path); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXopenpath(NXhandle handle, CONSTCHAR *path); /** * Opens the group in which the NeXus object with the specified path exists @@ -260,7 +261,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXopenpath(NXhandle handle, CONSTCHAR *path); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_navigation */ -MANTID_LEGACYNEXUS_DLL NXstatus NXopengrouppath(NXhandle handle, CONSTCHAR *path); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXopengrouppath(NXhandle handle, CONSTCHAR *path); /** * Retrieve the current path in the NeXus file @@ -270,7 +271,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXopengrouppath(NXhandle handle, CONSTCHAR *path * \return NX_OK or NX_ERROR * \ingroup c_navigation */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetpath(NXhandle handle, char *path, int pathlen); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetpath(NXhandle handle, char *path, int pathlen); /** * Closes the currently open group and steps one step down in the NeXus file @@ -278,7 +279,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetpath(NXhandle handle, char *path, int pathl * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_group */ -MANTID_LEGACYNEXUS_DLL NXstatus NXclosegroup(NXhandle handle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXclosegroup(NXhandle handle); /** * Create a multi dimensional data array or dataset. The dataset is NOT opened. @@ -291,13 +292,14 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXclosegroup(NXhandle handle); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXmakedata(NXhandle handle, CONSTCHAR *label, NXnumtype datatype, int rank, int dim[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus +NXmakedata(NXhandle handle, CONSTCHAR *label, Mantid::LegacyNexus::NXnumtype datatype, int rank, int dim[]); /** * @copydoc NXmakedata() */ -MANTID_LEGACYNEXUS_DLL NXstatus NXmakedata64(NXhandle handle, CONSTCHAR *label, NXnumtype datatype, int rank, - int64_t dim[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus +NXmakedata64(NXhandle handle, CONSTCHAR *label, Mantid::LegacyNexus::NXnumtype datatype, int rank, int64_t dim[]); /** * Create a compressed dataset. The dataset is NOT opened. Data from this set will automatically be compressed when @@ -319,14 +321,17 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXmakedata64(NXhandle handle, CONSTCHAR *label, * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXcompmakedata(NXhandle handle, CONSTCHAR *label, NXnumtype datatype, int rank, - int dim[], int comp_typ, int const bufsize[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXcompmakedata(NXhandle handle, CONSTCHAR *label, + Mantid::LegacyNexus::NXnumtype datatype, int rank, + int dim[], int comp_typ, int const bufsize[]); /** * @copydoc NXcompmakedata() */ -MANTID_LEGACYNEXUS_DLL NXstatus NXcompmakedata64(NXhandle handle, CONSTCHAR *label, NXnumtype datatype, int rank, - int64_t dim[], int comp_typ, int64_t const chunk_size[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXcompmakedata64(NXhandle handle, CONSTCHAR *label, + Mantid::LegacyNexus::NXnumtype datatype, int rank, + int64_t dim[], int comp_typ, + int64_t const chunk_size[]); /** * Open access to a dataset. After this call it is possible to write and read data or @@ -336,7 +341,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXcompmakedata64(NXhandle handle, CONSTCHAR *lab * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXopendata(NXhandle handle, CONSTCHAR *label); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXopendata(NXhandle handle, CONSTCHAR *label); /** * Close access to a dataset. @@ -344,7 +349,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXopendata(NXhandle handle, CONSTCHAR *label); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXclosedata(NXhandle handle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXclosedata(NXhandle handle); /** * Write data to a datset which has previouly been opened with NXopendata. @@ -355,7 +360,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXclosedata(NXhandle handle); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXputdata(NXhandle handle, const void *data); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXputdata(NXhandle handle, const void *data); /** * Write an attribute. The kind of attribute written depends on the @@ -372,8 +377,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXputdata(NXhandle handle, const void *data); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXputattr(NXhandle handle, CONSTCHAR *name, const void *data, int iDataLen, - NXnumtype iType); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXputattr(NXhandle handle, CONSTCHAR *name, const void *data, + int iDataLen, Mantid::LegacyNexus::NXnumtype iType); /** * Write an attribute of any rank. The kind of attribute written depends on the @@ -389,8 +394,9 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXputattr(NXhandle handle, CONSTCHAR *name, cons * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXputattra(NXhandle handle, CONSTCHAR *name, const void *data, const int rank, - const int dim[], const NXnumtype iType); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXputattra(NXhandle handle, CONSTCHAR *name, const void *data, + const int rank, const int dim[], + const Mantid::LegacyNexus::NXnumtype iType); /** * Write a subset of a multi dimensional dataset. @@ -401,13 +407,14 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXputattra(NXhandle handle, CONSTCHAR *name, con * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXputslab(NXhandle handle, const void *data, const int start[], const int size[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXputslab(NXhandle handle, const void *data, const int start[], + const int size[]); /** * @copydoc NXputdata() */ -MANTID_LEGACYNEXUS_DLL NXstatus NXputslab64(NXhandle handle, const void *data, const int64_t start[], - const int64_t size[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXputslab64(NXhandle handle, const void *data, + const int64_t start[], const int64_t size[]); /** * Retrieve link data for a dataset. This link data can later on be used to link this @@ -418,7 +425,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXputslab64(NXhandle handle, const void *data, c * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_linking */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetdataID(NXhandle handle, NXlink *pLink); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetdataID(NXhandle handle, Mantid::LegacyNexus::NXlink *pLink); /** * Create a link to the group or dataset described by pLink in the currently open @@ -429,7 +436,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetdataID(NXhandle handle, NXlink *pLink); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_linking */ -MANTID_LEGACYNEXUS_DLL NXstatus NXmakelink(NXhandle handle, NXlink *pLink); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXmakelink(NXhandle handle, Mantid::LegacyNexus::NXlink *pLink); /** * Create a link to the group or dataset described by pLink in the currently open @@ -441,7 +448,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXmakelink(NXhandle handle, NXlink *pLink); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_linking */ -MANTID_LEGACYNEXUS_DLL NXstatus NXmakenamedlink(NXhandle handle, CONSTCHAR *newname, NXlink *pLink); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXmakenamedlink(NXhandle handle, CONSTCHAR *newname, + Mantid::LegacyNexus::NXlink *pLink); /** * Open the source group of a linked group or dataset. Returns an error when the item is @@ -450,7 +458,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXmakenamedlink(NXhandle handle, CONSTCHAR *newn * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_navigation */ -MANTID_LEGACYNEXUS_DLL NXstatus NXopensourcegroup(NXhandle handle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXopensourcegroup(NXhandle handle); /** * Read a complete dataset from the currently open dataset into memory. @@ -461,7 +469,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXopensourcegroup(NXhandle handle); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetdata(NXhandle handle, void *data); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetdata(NXhandle handle, void *data); /** * Retrieve information about the curretly open dataset. @@ -474,12 +482,14 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetdata(NXhandle handle, void *data); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_metadata */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetinfo(NXhandle handle, int *rank, int dimension[], NXnumtype *datatype); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetinfo(NXhandle handle, int *rank, int dimension[], + Mantid::LegacyNexus::NXnumtype *datatype); /** * @copydoc NXgetinfo() */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetinfo64(NXhandle handle, int *rank, int64_t dimension[], NXnumtype *datatype); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetinfo64(NXhandle handle, int *rank, int64_t dimension[], + Mantid::LegacyNexus::NXnumtype *datatype); /** * Get the next entry in the currently open group. This is for retrieving infromation about the @@ -493,7 +503,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetinfo64(NXhandle handle, int *rank, int64_t * \return NX_OK on success, NX_ERROR in the case of an error, NX_EOD when there are no more items. * \ingroup c_navigation */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetnextentry(NXhandle handle, NXname name, NXname nxclass, NXnumtype *datatype); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetnextentry(NXhandle handle, NXname name, NXname nxclass, + Mantid::LegacyNexus::NXnumtype *datatype); /** * Read a subset of data from file into memory. @@ -505,12 +516,14 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetnextentry(NXhandle handle, NXname name, NXn * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetslab(NXhandle handle, void *data, const int start[], const int size[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetslab(NXhandle handle, void *data, const int start[], + const int size[]); /** * @copydoc NXgetslab() */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetslab64(NXhandle handle, void *data, const int64_t start[], const int64_t size[]); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetslab64(NXhandle handle, void *data, const int64_t start[], + const int64_t size[]); /** * Read an attribute containing a single string or numerical value. @@ -523,8 +536,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetslab64(NXhandle handle, void *data, const i * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetattr(NXhandle handle, const char *name, void *data, int *iDataLen, - NXnumtype *iType); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetattr(NXhandle handle, const char *name, void *data, + int *iDataLen, Mantid::LegacyNexus::NXnumtype *iType); /** * Get the count of attributes in the currently open dataset, group or global attributes when at root level. @@ -533,7 +546,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetattr(NXhandle handle, const char *name, voi * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_metadata */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetattrinfo(NXhandle handle, int *no_items); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetattrinfo(NXhandle handle, int *no_items); /** * Iterate over global, group or dataset attributes depending on the currently open group or @@ -549,7 +562,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetattrinfo(NXhandle handle, int *no_items); * \return NX_OK on success, NX_ERROR in the case of an error, NX_EOD when there are no more items. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetnextattra(NXhandle handle, NXname pName, int *rank, int dim[], NXnumtype *iType); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetnextattra(NXhandle handle, NXname pName, int *rank, int dim[], + Mantid::LegacyNexus::NXnumtype *iType); /** * Read an arbitrarily shaped attribute. @@ -559,7 +573,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetnextattra(NXhandle handle, NXname pName, in * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_readwrite */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetattra(NXhandle handle, const char *name, void *data); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetattra(NXhandle handle, const char *name, void *data); /** * Get the information about the storage of the named attribute. @@ -570,7 +584,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetattra(NXhandle handle, const char *name, vo * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_metadata */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetattrainfo(NXhandle handle, NXname pName, int *rank, int dim[], NXnumtype *iType); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetattrainfo(NXhandle handle, NXname pName, int *rank, int dim[], + Mantid::LegacyNexus::NXnumtype *iType); /** * Retrieve link data for the currently open group. This link data can later on be used to link this @@ -581,7 +596,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetattrainfo(NXhandle handle, NXname pName, in * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_linking */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetgroupID(NXhandle handle, NXlink *pLink); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetgroupID(NXhandle handle, Mantid::LegacyNexus::NXlink *pLink); /** * Retrieve information about the currently open group. @@ -594,7 +609,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetgroupID(NXhandle handle, NXlink *pLink); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_metadata */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetgroupinfo(NXhandle handle, int *no_items, NXname name, NXname nxclass); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetgroupinfo(NXhandle handle, int *no_items, NXname name, + NXname nxclass); /** * Tests if two link data structures describe the same item. @@ -604,7 +620,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXgetgroupinfo(NXhandle handle, int *no_items, N * \return NX_OK when both link data structures describe the same item, NX_ERROR else. * \ingroup c_linking */ -MANTID_LEGACYNEXUS_DLL NXstatus NXsameID(NXhandle handle, NXlink const *pFirstID, NXlink const *pSecondID); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus +NXsameID(NXhandle handle, Mantid::LegacyNexus::NXlink const *pFirstID, Mantid::LegacyNexus::NXlink const *pSecondID); /** * Resets a pending group search to the start again. To be called in a #NXgetnextentry loop when @@ -613,7 +630,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXsameID(NXhandle handle, NXlink const *pFirstID * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_navigation */ -MANTID_LEGACYNEXUS_DLL NXstatus NXinitgroupdir(NXhandle handle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXinitgroupdir(NXhandle handle); /** * Resets a pending attribute search to the start again. To be called in a #NXgetnextattr loop when @@ -622,7 +639,7 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXinitgroupdir(NXhandle handle); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_navigation */ -MANTID_LEGACYNEXUS_DLL NXstatus NXinitattrdir(NXhandle handle); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXinitattrdir(NXhandle handle); /** * Inquire the filename of the currently open file. FilenameBufferLength of the file name @@ -633,7 +650,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXinitattrdir(NXhandle handle); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_metadata */ -MANTID_LEGACYNEXUS_DLL NXstatus NXinquirefile(NXhandle handle, char *filename, int filenameBufferLength); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXinquirefile(NXhandle handle, char *filename, + int filenameBufferLength); /** * Test if a group is actually pointing to an external file. If so, retrieve the URL of the @@ -646,8 +664,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXinquirefile(NXhandle handle, char *filename, i * \return NX_OK when the group is pointing to an external file, NX_ERROR else. * \ingroup c_external */ -MANTID_LEGACYNEXUS_DLL NXstatus NXisexternalgroup(NXhandle handle, CONSTCHAR *name, CONSTCHAR *nxclass, char *url, - int urlLen); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXisexternalgroup(NXhandle handle, CONSTCHAR *name, + CONSTCHAR *nxclass, char *url, int urlLen); /** * Test if a dataset is actually pointing to an external file. If so, retrieve the URL of the @@ -659,7 +677,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXisexternalgroup(NXhandle handle, CONSTCHAR *na * \return NX_OK when the dataset is pointing to an external file, NX_ERROR else. * \ingroup c_external */ -MANTID_LEGACYNEXUS_DLL NXstatus NXisexternaldataset(NXhandle handle, CONSTCHAR *name, char *url, int urlLen); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXisexternaldataset(NXhandle handle, CONSTCHAR *name, char *url, + int urlLen); /** * Create a link to a group in an external file. This works by creating a NeXus group under the current level in @@ -673,7 +692,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXisexternaldataset(NXhandle handle, CONSTCHAR * * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_external */ -MANTID_LEGACYNEXUS_DLL NXstatus NXlinkexternal(NXhandle handle, CONSTCHAR *name, CONSTCHAR *nxclass, CONSTCHAR *url); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXlinkexternal(NXhandle handle, CONSTCHAR *name, + CONSTCHAR *nxclass, CONSTCHAR *url); /** * Create a link to a dataset in an external file. This works by creating a dataset under the current level in @@ -686,7 +706,8 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXlinkexternal(NXhandle handle, CONSTCHAR *name, * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_external */ -MANTID_LEGACYNEXUS_DLL NXstatus NXlinkexternaldataset(NXhandle handle, CONSTCHAR *name, CONSTCHAR *url); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXlinkexternaldataset(NXhandle handle, CONSTCHAR *name, + CONSTCHAR *url); /** * Utility function which allocates a suitably sized memory area for the dataset characteristics specified. @@ -697,12 +718,14 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXlinkexternaldataset(NXhandle handle, CONSTCHAR * \return NX_OK when allocation succeeds, NX_ERROR in the case of an error. * \ingroup c_memory */ -MANTID_LEGACYNEXUS_DLL NXstatus NXmalloc(void **data, int rank, const int dimensions[], NXnumtype datatype); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXmalloc(void **data, int rank, const int dimensions[], + Mantid::LegacyNexus::NXnumtype datatype); /** * @copydoc NXmalloc() */ -MANTID_LEGACYNEXUS_DLL NXstatus NXmalloc64(void **data, int rank, const int64_t dimensions[], NXnumtype datatype); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXmalloc64(void **data, int rank, const int64_t dimensions[], + Mantid::LegacyNexus::NXnumtype datatype); /** * Utility function to return NeXus version @@ -718,9 +741,10 @@ MANTID_LEGACYNEXUS_DLL const char *NXgetversion(); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_memory */ -MANTID_LEGACYNEXUS_DLL NXstatus NXfree(void **data); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXfree(void **data); -MANTID_LEGACYNEXUS_DLL NXstatus NXIprintlink(NXhandle fid, NXlink const *link); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXIprintlink(NXhandle fid, + Mantid::LegacyNexus::NXlink const *link); /** * Retrieve information about the currently open dataset. In contrast to the main function below, @@ -734,12 +758,14 @@ MANTID_LEGACYNEXUS_DLL NXstatus NXIprintlink(NXhandle fid, NXlink const *link); * \return NX_OK on success, NX_ERROR in the case of an error. * \ingroup c_metadata */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetrawinfo(NXhandle handle, int *rank, int dimension[], NXnumtype *datatype); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetrawinfo(NXhandle handle, int *rank, int dimension[], + Mantid::LegacyNexus::NXnumtype *datatype); /** * @copydoc NXgetrawinfo */ -MANTID_LEGACYNEXUS_DLL NXstatus NXgetrawinfo64(NXhandle handle, int *rank, int64_t dimension[], NXnumtype *datatype); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXgetrawinfo64(NXhandle handle, int *rank, int64_t dimension[], + Mantid::LegacyNexus::NXnumtype *datatype); /** \typedef void (*ErrFunc)(void *data, const char *text) * All NeXus error reporting happens through this special function, the @@ -796,7 +822,7 @@ MANTID_LEGACYNEXUS_DLL char *NXIformatNeXusTime(); * A function for setting the default cache size for HDF-5 * \ingroup c_init */ -MANTID_LEGACYNEXUS_DLL NXstatus NXsetcache(long newVal); +MANTID_LEGACYNEXUS_DLL Mantid::LegacyNexus::NXstatus NXsetcache(long newVal); #ifdef __cplusplus }; diff --git a/Framework/Muon/inc/MantidMuon/LoadMuonNexus.h b/Framework/Muon/inc/MantidMuon/LoadMuonNexus.h index fd7e16c8aeba..253f80dc3a9c 100644 --- a/Framework/Muon/inc/MantidMuon/LoadMuonNexus.h +++ b/Framework/Muon/inc/MantidMuon/LoadMuonNexus.h @@ -12,7 +12,7 @@ #include "MantidAPI/IFileLoader.h" #include "MantidDataObjects/Workspace2D_fwd.h" #include "MantidGeometry/IDTypes.h" -#include "MantidKernel/NexusDescriptor.h" +#include "MantidKernel/LegacyNexusDescriptor.h" #include "MantidMuon/DllConfig.h" //---------------------------------------------------------------------- @@ -48,7 +48,7 @@ multiperiod file) together based on the groupings in the NeXus file. */ -class MANTID_MUON_DLL LoadMuonNexus : public API::IFileLoader { +class MANTID_MUON_DLL LoadMuonNexus : public API::IFileLoader { public: /// Default constructor LoadMuonNexus(); @@ -68,7 +68,7 @@ class MANTID_MUON_DLL LoadMuonNexus : public API::IFileLoader seeAlso() const override { return {"LoadNexus"}; } /// Returns a confidence value that this algorithm can load a file - int confidence(Kernel::NexusDescriptor &descriptor) const override; + int confidence(Kernel::LegacyNexusDescriptor &descriptor) const override; private: void exec() override; diff --git a/Framework/Muon/src/LoadMuonNexus.cpp b/Framework/Muon/src/LoadMuonNexus.cpp index 8a0c118ded76..a6271d09f7c8 100644 --- a/Framework/Muon/src/LoadMuonNexus.cpp +++ b/Framework/Muon/src/LoadMuonNexus.cpp @@ -26,6 +26,9 @@ #include "MantidNexusCpp/NeXusException.hpp" #include "MantidNexusCpp/NeXusFile.hpp" +// must be after MantidNexusCpp/NeXusFile.hpp +#include "MantidLegacyNexus/NeXusFile.hpp" + #include #include #include @@ -175,7 +178,7 @@ void LoadMuonNexus::runLoadInstrument(const DataObjects::Workspace2D_sptr &local * @returns An integer specifying the confidence level. 0 indicates it will not * be used */ -int LoadMuonNexus::confidence(Kernel::NexusDescriptor &descriptor) const { +int LoadMuonNexus::confidence(Kernel::LegacyNexusDescriptor &descriptor) const { UNUSED_ARG(descriptor); return 0; // Not to be used but LoadMuonNexus2, which inherits from this will } diff --git a/Framework/Muon/src/LoadMuonNexus1.cpp b/Framework/Muon/src/LoadMuonNexus1.cpp index 51b8cf1e62a2..0becbedf456d 100644 --- a/Framework/Muon/src/LoadMuonNexus1.cpp +++ b/Framework/Muon/src/LoadMuonNexus1.cpp @@ -33,6 +33,9 @@ #include "MantidNexusCpp/NeXusException.hpp" #include "MantidNexusCpp/NeXusFile.hpp" +// must be after MantidNexusCpp/NeXusFile.hpp +#include "MantidLegacyNexus/NeXusFile.hpp" + #include #include @@ -93,7 +96,7 @@ void LoadMuonNexus1::exec() { NXEntry entry = root.openEntry("run/histogram_data_1"); try { NXInfo info = entry.getDataSetInfo("time_zero"); - if (info.stat != NXstatus::NX_ERROR) { + if (info.stat != ::NXstatus::NX_ERROR) { double dum = root.getFloat("run/histogram_data_1/time_zero"); setProperty("TimeZero", dum); } @@ -104,14 +107,14 @@ void LoadMuonNexus1::exec() { NXInfo infoResolution = entry.getDataSetInfo("resolution"); NXInt counts = root.openNXInt("run/histogram_data_1/counts"); std::string firstGoodBin = counts.attributes("first_good_bin"); - if (!firstGoodBin.empty() && infoResolution.stat != NXstatus::NX_ERROR) { + if (!firstGoodBin.empty() && infoResolution.stat != ::NXstatus::NX_ERROR) { double resolution; switch (infoResolution.type) { - case NXnumtype::FLOAT32: + case ::NXnumtype::FLOAT32: resolution = static_cast(entry.getFloat("resolution")); break; - case NXnumtype::INT32: + case ::NXnumtype::INT32: resolution = static_cast(entry.getInt("resolution")); break; default: @@ -131,14 +134,14 @@ void LoadMuonNexus1::exec() { NXInfo infoResolution = entry.getDataSetInfo("resolution"); NXInt counts = root.openNXInt("run/histogram_data_1/counts"); std::string lastGoodBin = counts.attributes("last_good_bin"); - if (!lastGoodBin.empty() && infoResolution.stat != NXstatus::NX_ERROR) { + if (!lastGoodBin.empty() && infoResolution.stat != ::NXstatus::NX_ERROR) { double resolution; switch (infoResolution.type) { - case NXnumtype::FLOAT32: + case ::NXnumtype::FLOAT32: resolution = static_cast(entry.getFloat("resolution")); break; - case NXnumtype::INT32: + case ::NXnumtype::INT32: resolution = static_cast(entry.getInt("resolution")); break; default: @@ -388,7 +391,7 @@ void LoadMuonNexus1::loadDeadTimes(NXRoot &root) { NXEntry detector = root.openEntry("run/instrument/detector"); NXInfo infoDeadTimes = detector.getDataSetInfo("deadtimes"); - if (infoDeadTimes.stat != NXstatus::NX_ERROR) { + if (infoDeadTimes.stat != ::NXstatus::NX_ERROR) { NXFloat deadTimesData = detector.openNXFloat("deadtimes"); deadTimesData.load(); @@ -485,7 +488,7 @@ Workspace_sptr LoadMuonNexus1::loadDetectorGrouping(NXRoot &root, const Geometry NXEntry dataEntry = root.openEntry("run/histogram_data_1"); NXInfo infoGrouping = dataEntry.getDataSetInfo("grouping"); - if (infoGrouping.stat != NXstatus::NX_ERROR) { + if (infoGrouping.stat != ::NXstatus::NX_ERROR) { NXInt groupingData = dataEntry.openNXInt("grouping"); groupingData.load(); @@ -812,7 +815,7 @@ void LoadMuonNexus1::addPeriodLog(const DataObjects::Workspace2D_sptr &localWork void LoadMuonNexus1::addGoodFrames(const DataObjects::Workspace2D_sptr &localWorkspace, int64_t period, int nperiods) { // Get handle to nexus file - ::NeXus::File handle(m_filename, NXACC_READ); + ::NeXus::File handle(m_filename, ::NXACC_READ); // For single-period datasets, read /run/instrument/beam/frames_good if (nperiods == 1) { @@ -894,7 +897,7 @@ void LoadMuonNexus1::addGoodFrames(const DataObjects::Workspace2D_sptr &localWor * @returns An integer specifying the confidence level. 0 indicates it will not * be used */ -int LoadMuonNexus1::confidence(Kernel::NexusDescriptor &descriptor) const { +int LoadMuonNexus1::confidence(Kernel::LegacyNexusDescriptor &descriptor) const { const auto &firstEntryNameType = descriptor.firstEntryNameType(); const std::string root = "/" + firstEntryNameType.first; if (!descriptor.pathExists(root + "/analysis")) diff --git a/Framework/Muon/src/LoadMuonNexus2.cpp b/Framework/Muon/src/LoadMuonNexus2.cpp index 7acf586bc19b..850c4c17dfb1 100644 --- a/Framework/Muon/src/LoadMuonNexus2.cpp +++ b/Framework/Muon/src/LoadMuonNexus2.cpp @@ -27,6 +27,9 @@ #include "MantidNexusCpp/NeXusException.hpp" #include "MantidNexusCpp/NeXusFile.hpp" +// must be after MantidNexusCpp/NeXusFile.hpp +#include "MantidLegacyNexus/NeXusFile.hpp" + #include #include #include @@ -368,7 +371,7 @@ void LoadMuonNexus2::loadRunDetails(const DataObjects::Workspace2D_sptr &localWo * @returns An integer specifying the confidence level. 0 indicates it will not * be used */ -int LoadMuonNexus2::confidence(Kernel::NexusDescriptor &descriptor) const { +int LoadMuonNexus2::confidence(Kernel::LegacyNexusDescriptor &descriptor) const { const auto &firstEntryNameType = descriptor.firstEntryNameType(); const std::string root = "/" + firstEntryNameType.first; if (!descriptor.pathExists(root + "/definition")) diff --git a/buildconfig/CMake/MantidFrameworkConfig.cmake.in b/buildconfig/CMake/MantidFrameworkConfig.cmake.in index 7dd324604e8f..8e043a90e220 100644 --- a/buildconfig/CMake/MantidFrameworkConfig.cmake.in +++ b/buildconfig/CMake/MantidFrameworkConfig.cmake.in @@ -30,6 +30,7 @@ set(MODULES Types Json NexusCpp + LegacyNexus Kernel Parallel HistogramData From 86109b07b221c6af897dbe50668d8d264789c860 Mon Sep 17 00:00:00 2001 From: Yusuf Jimoh Date: Fri, 7 Feb 2025 16:00:22 +0000 Subject: [PATCH 2/3] fix cppcheck issues for delta set54 --- .../Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h | 2 +- Framework/Muon/src/LoadMuonNexus2.cpp | 2 +- Framework/Muon/src/PlotAsymmetryByLogValue.cpp | 12 ++++++------ Framework/NexusGeometry/src/NexusShapeFactory.cpp | 2 +- .../MantidParallel/IO/EventsListsShmemStorage.h | 1 - .../core/DataServiceExporter.h | 4 ++-- .../core/inc/MantidPythonInterface/core/IsNone.h | 2 +- .../core/src/Converters/CloneToNDArray.cpp | 4 ++++ .../core/src/Converters/NDArrayToVector.cpp | 6 +++--- buildconfig/CMake/CppCheck_Suppressions.txt.in | 15 --------------- 10 files changed, 19 insertions(+), 31 deletions(-) diff --git a/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h b/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h index fa8d6381f8b3..c03470faa242 100644 --- a/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h +++ b/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h @@ -86,7 +86,7 @@ class MANTID_MUON_DLL PlotAsymmetryByLogValue final : public API::Algorithm { /// Group detectors void groupDetectors(API::MatrixWorkspace_sptr &ws, const std::vector &spectraList); /// Get log value - double getLogValue(API::MatrixWorkspace &ws); + double getLogValue(const API::MatrixWorkspace &ws); /// Populate output workspace with results void populateOutputWorkspace(API::MatrixWorkspace_sptr &outWS, int nplots, const std::string &units); /// get log units diff --git a/Framework/Muon/src/LoadMuonNexus2.cpp b/Framework/Muon/src/LoadMuonNexus2.cpp index 850c4c17dfb1..440ff353227b 100644 --- a/Framework/Muon/src/LoadMuonNexus2.cpp +++ b/Framework/Muon/src/LoadMuonNexus2.cpp @@ -87,7 +87,7 @@ void LoadMuonNexus2::exec() { } // Need to extract the user-defined output workspace name - Property *ws = getProperty("OutputWorkspace"); + const Property *ws = getProperty("OutputWorkspace"); std::string localWSName = ws->value(); // If multiperiod, will need to hold the Instrument & Sample for copying std::shared_ptr instrument; diff --git a/Framework/Muon/src/PlotAsymmetryByLogValue.cpp b/Framework/Muon/src/PlotAsymmetryByLogValue.cpp index 391e03e4ecb2..064712c3d9e1 100644 --- a/Framework/Muon/src/PlotAsymmetryByLogValue.cpp +++ b/Framework/Muon/src/PlotAsymmetryByLogValue.cpp @@ -213,7 +213,7 @@ const std::string PlotAsymmetryByLogValue::getLogUnits(const std::string &fileNa ws = std::dynamic_pointer_cast(group->getItem(m_red - 1)); } const Run &run = ws->run(); - auto property = run.getLogData(m_logName); + const auto *property = run.getLogData(m_logName); return property->units(); } @@ -449,7 +449,7 @@ void PlotAsymmetryByLogValue::populateOutputWorkspace(MatrixWorkspace_sptr &outW auto tAxis = std::make_unique(nplots); if (nplots == 1) { size_t i = 0; - for (auto &value : m_logValue) { + for (const auto &value : m_logValue) { outWS->mutableX(0)[i] = value.second; outWS->mutableY(0)[i] = m_redY[value.first]; outWS->mutableE(0)[i] = m_redE[value.first]; @@ -459,7 +459,7 @@ void PlotAsymmetryByLogValue::populateOutputWorkspace(MatrixWorkspace_sptr &outW } else { size_t i = 0; - for (auto &value : m_logValue) { + for (const auto &value : m_logValue) { outWS->mutableX(0)[i] = value.second; outWS->mutableY(0)[i] = m_diffY[value.first]; outWS->mutableE(0)[i] = m_diffE[value.first]; @@ -494,7 +494,7 @@ void PlotAsymmetryByLogValue::saveResultsToADS(MatrixWorkspace_sptr &outWS, int if (nplots == 2) { size_t i = 0; - for (auto &value : m_logValue) { + for (const auto &value : m_logValue) { size_t run = value.first; outWS->mutableX(0)[i] = static_cast(run); // run number outWS->mutableY(0)[i] = value.second; // log value @@ -504,7 +504,7 @@ void PlotAsymmetryByLogValue::saveResultsToADS(MatrixWorkspace_sptr &outWS, int } } else { size_t i = 0; - for (auto &value : m_logValue) { + for (const auto &value : m_logValue) { size_t run = value.first; outWS->mutableX(0)[i] = static_cast(run); // run number outWS->mutableY(0)[i] = value.second; // log value @@ -865,7 +865,7 @@ void PlotAsymmetryByLogValue::calcIntAsymmetry(const MatrixWorkspace_sptr &ws_re * @throw :: std::invalid_argument if the log cannot be converted to a double or *doesn't exist. */ -double PlotAsymmetryByLogValue::getLogValue(MatrixWorkspace &ws) { +double PlotAsymmetryByLogValue::getLogValue(const MatrixWorkspace &ws) { const Run &run = ws.run(); const auto &runROI = run.getTimeROI(); diff --git a/Framework/NexusGeometry/src/NexusShapeFactory.cpp b/Framework/NexusGeometry/src/NexusShapeFactory.cpp index 86b18ac903a4..7fb547b16ce4 100644 --- a/Framework/NexusGeometry/src/NexusShapeFactory.cpp +++ b/Framework/NexusGeometry/src/NexusShapeFactory.cpp @@ -30,7 +30,7 @@ namespace { /// Finalise shape std::unique_ptr createCylinderShape(const std::map> &surfaces, const std::string &algebra, - std::vector &boundingBox, Geometry::detail::ShapeInfo &&shapeInfo) { + const std::vector &boundingBox, Geometry::detail::ShapeInfo &&shapeInfo) { auto shape = std::make_unique(); shape->setObject(21, algebra); shape->populate(surfaces); diff --git a/Framework/Parallel/inc/MantidParallel/IO/EventsListsShmemStorage.h b/Framework/Parallel/inc/MantidParallel/IO/EventsListsShmemStorage.h index 016d70742a3b..8e20a1602b91 100644 --- a/Framework/Parallel/inc/MantidParallel/IO/EventsListsShmemStorage.h +++ b/Framework/Parallel/inc/MantidParallel/IO/EventsListsShmemStorage.h @@ -29,7 +29,6 @@ class MANTID_PARALLEL_DLL EventsListsShmemStorage : public EventsListsShmemManag public: EventsListsShmemStorage(const std::string &segmentName, const std::string &elName, size_t size, size_t chunksCnt, size_t pixelsCount); - virtual ~EventsListsShmemStorage() = default; void reserve(std::size_t chunkN, std::size_t pixelN, std::size_t size); diff --git a/Framework/PythonInterface/core/inc/MantidPythonInterface/core/DataServiceExporter.h b/Framework/PythonInterface/core/inc/MantidPythonInterface/core/DataServiceExporter.h index 7c557ab8f071..3b7b9bcf5328 100644 --- a/Framework/PythonInterface/core/inc/MantidPythonInterface/core/DataServiceExporter.h +++ b/Framework/PythonInterface/core/inc/MantidPythonInterface/core/DataServiceExporter.h @@ -157,12 +157,12 @@ template struct DataServiceExporter { * @return A shared_ptr to the named object. If the name does not exist it * sets a KeyError error indicator. */ - static WeakPtr retrieveOrKeyError(SvcType &self, const std::string &name) { + static WeakPtr retrieveOrKeyError(const SvcType *const self, const std::string &name) { using namespace Mantid::Kernel; SvcPtrType item; try { - item = self.retrieve(name); + item = self->retrieve(name); } catch (Exception::NotFoundError &) { // Translate into a Python KeyError std::string err = "'" + name + "' does not exist."; diff --git a/Framework/PythonInterface/core/inc/MantidPythonInterface/core/IsNone.h b/Framework/PythonInterface/core/inc/MantidPythonInterface/core/IsNone.h index 8d9a222ece49..cfb713566e2b 100644 --- a/Framework/PythonInterface/core/inc/MantidPythonInterface/core/IsNone.h +++ b/Framework/PythonInterface/core/inc/MantidPythonInterface/core/IsNone.h @@ -23,7 +23,7 @@ namespace PythonInterface { * @param ptr A * to a raw PyObject * @returns true if the given object is of type None */ -inline bool isNone(PyObject *ptr) { return (ptr == Py_None); } +inline bool isNone(const PyObject *ptr) { return (ptr == Py_None); } /** * @param obj A const reference to boost python object wrapper diff --git a/Framework/PythonInterface/core/src/Converters/CloneToNDArray.cpp b/Framework/PythonInterface/core/src/Converters/CloneToNDArray.cpp index d6e67ba6fb65..54499a904460 100644 --- a/Framework/PythonInterface/core/src/Converters/CloneToNDArray.cpp +++ b/Framework/PythonInterface/core/src/Converters/CloneToNDArray.cpp @@ -120,6 +120,10 @@ template PyObject *cloneND(const ElementType *carray, con * @param dims :: The length of the arrays in each dimension * @return */ +// cppcheck-suppress constParameterPointer +// Suppressed because one of the cloneND overloads calls +// PyArray_NewFromDescrclasses inside NumpyFunctions::func_PyArray_NewFromDescr, which +// requires the dim parameter to be non-const. template <> PyObject *cloneND(const std::string *carray, const int ndims, Py_intptr_t *dims) { boost::python::list pystrs; const std::string *iter = carray; diff --git a/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp b/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp index 54126201363c..bb809120de5e 100644 --- a/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp +++ b/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp @@ -123,7 +123,7 @@ NDArrayToVector::NDArrayToVector(const NDArray &value) : m_arr( */ template typename NDArrayToVector::TypedVector NDArrayToVector::operator()() { - std::vector cvector(PyArray_SIZE((PyArrayObject *)m_arr.ptr())); + std::vector cvector(PyArray_SIZE(reinterpret_cast(m_arr.ptr()))); copyTo(cvector); return cvector; } @@ -134,9 +134,9 @@ typename NDArrayToVector::TypedVector NDArrayToVector void NDArrayToVector::copyTo(TypedVector &dest) const { - if (PyArray_SIZE((PyArrayObject *)m_arr.ptr()) > 0) { + if (PyArray_SIZE(reinterpret_cast(m_arr.ptr())) > 0) { throwIfSizeMismatched(dest); - CopyToImpl()(std::begin(dest), (PyArrayObject *)m_arr.ptr()); + CopyToImpl()(std::begin(dest), reinterpret_cast(m_arr.ptr())); } } diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt.in b/buildconfig/CMake/CppCheck_Suppressions.txt.in index 98ec8bffc600..594359746075 100644 --- a/buildconfig/CMake/CppCheck_Suppressions.txt.in +++ b/buildconfig/CMake/CppCheck_Suppressions.txt.in @@ -880,21 +880,6 @@ missingOverride:${CMAKE_SOURCE_DIR}/Framework/Muon/inc/MantidMuon/MuonGroupingCo missingOverride:${CMAKE_SOURCE_DIR}/Framework/Muon/inc/MantidMuon/MuonPairingAsymmetry.h:22 missingOverride:${CMAKE_SOURCE_DIR}/Framework/Muon/inc/MantidMuon/MuonPreProcess.h:23 variableScope:${CMAKE_SOURCE_DIR}/Framework/Muon/src/EstimateMuonAsymmetryFromCounts.cpp:157 -constVariablePointer:${CMAKE_SOURCE_DIR}/Framework/Muon/src/LoadMuonNexus2.cpp:87 -constVariablePointer:${CMAKE_SOURCE_DIR}/Framework/Muon/src/PlotAsymmetryByLogValue.cpp:216 -constVariableReference:${CMAKE_SOURCE_DIR}/Framework/Muon/src/PlotAsymmetryByLogValue.cpp:452 -constVariableReference:${CMAKE_SOURCE_DIR}/Framework/Muon/src/PlotAsymmetryByLogValue.cpp:462 -constVariableReference:${CMAKE_SOURCE_DIR}/Framework/Muon/src/PlotAsymmetryByLogValue.cpp:497 -constVariableReference:${CMAKE_SOURCE_DIR}/Framework/Muon/src/PlotAsymmetryByLogValue.cpp:507 -constParameterReference:${CMAKE_SOURCE_DIR}/Framework/Muon/src/PlotAsymmetryByLogValue.cpp:868 -constParameterReference:${CMAKE_SOURCE_DIR}/Framework/NexusGeometry/src/NexusShapeFactory.cpp:33 -missingOverride:${CMAKE_SOURCE_DIR}/Framework/Parallel/inc/MantidParallel/IO/EventsListsShmemStorage.h:32 -constParameterCallback:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/inc/MantidPythonInterface/core/DataServiceExporter.h:160 -constParameterPointer:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/inc/MantidPythonInterface/core/IsNone.h:26 -constParameterPointer:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/src/Converters/CloneToNDArray.cpp:123 -cstyleCast:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp:126 -cstyleCast:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp:137 -cstyleCast:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp:139 cstyleCast:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp:151 cstyleCast:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/src/Converters/NDArrayToVector.cpp:156 cstyleCast:${CMAKE_SOURCE_DIR}/Framework/PythonInterface/core/src/Converters/PyObjectToMatrix.cpp:44 From 9dc7fa9793453855f425a2a17fb3b8888833ac0f Mon Sep 17 00:00:00 2001 From: Pete Peterson Date: Wed, 19 Feb 2025 11:25:58 -0500 Subject: [PATCH 3/3] Migrate to LegacyNexusDescriptor like main --- Framework/Muon/inc/MantidMuon/LoadMuonNexus3.h | 2 +- Framework/Muon/src/LoadMuonNexus3.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Framework/Muon/inc/MantidMuon/LoadMuonNexus3.h b/Framework/Muon/inc/MantidMuon/LoadMuonNexus3.h index 070d48d9e8e7..46fc9fbcd465 100644 --- a/Framework/Muon/inc/MantidMuon/LoadMuonNexus3.h +++ b/Framework/Muon/inc/MantidMuon/LoadMuonNexus3.h @@ -71,7 +71,7 @@ class MANTID_MUON_DLL LoadMuonNexus3 : public LoadMuonNexus { const std::vector seeAlso() const override { return {"LoadNexus", "LoadMuonNexusV2"}; } // Returns 0, as this wrapper version of the algorithm is never to be selected via load. - int confidence(Kernel::NexusDescriptor &) const override { return 0; }; + int confidence(Kernel::LegacyNexusDescriptor &) const override { return 0; }; // Methods to enable testing. const std::string &getSelectedAlg() const { return m_loadAlgs[m_selectedIndex].m_name; } int getSelectedVersion() const { return m_loadAlgs[m_selectedIndex].m_version; } diff --git a/Framework/Muon/src/LoadMuonNexus3.cpp b/Framework/Muon/src/LoadMuonNexus3.cpp index 735b4511ecc2..5684f84b4ba0 100644 --- a/Framework/Muon/src/LoadMuonNexus3.cpp +++ b/Framework/Muon/src/LoadMuonNexus3.cpp @@ -34,8 +34,9 @@ int calculateConfidenceHDF5(const std::string &filePath, const std::shared_ptr &alg) { - const auto fileLoader = std::dynamic_pointer_cast>(alg); - Mantid::Kernel::NexusDescriptor descriptor(filePath); + const auto fileLoader = + std::dynamic_pointer_cast>(alg); + Mantid::Kernel::LegacyNexusDescriptor descriptor(filePath); const int confidence = fileLoader->confidence(descriptor); return (confidence >= CONFIDENCE_THRESHOLD) ? confidence : 0; }