From 9a9ff3ee2439d1b2969dac5bfed9abc7c3f4d080 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 07:24:36 +0200
Subject: [PATCH 01/13] corr comm

---
 Device/Unit/Axes.h      | 2 +-
 Device/Unit/AxisNames.h | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Device/Unit/Axes.h b/Device/Unit/Axes.h
index 369b18ee595..7e4fe791875 100644
--- a/Device/Unit/Axes.h
+++ b/Device/Unit/Axes.h
@@ -3,7 +3,7 @@
 //  BornAgain: simulate and fit reflection and scattering
 //
 //! @file      Device/Unit/Axes.h
-//! @brief     Defines interface IUnitConverter and possible axis units.
+//! @brief     Defines enum Axis::Units.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
diff --git a/Device/Unit/AxisNames.h b/Device/Unit/AxisNames.h
index 005053269c3..600496a852a 100644
--- a/Device/Unit/AxisNames.h
+++ b/Device/Unit/AxisNames.h
@@ -3,7 +3,7 @@
 //  BornAgain: simulate and fit reflection and scattering
 //
 //! @file      Device/Unit/AxisNames.h
-//! @brief     Defines namespace AxisNames.
+//! @brief     Defines axisUnitLabel and maps in namespace AxisNames.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -30,8 +30,7 @@ const std::map<Axes::Units, const char*> axisUnitLabel = {
     {Axes::Units::DEGREES, "deg"},       {Axes::Units::MM, "mm"},     {Axes::Units::QSPACE, "1/nm"},
     {Axes::Units::QXQY, "1/nm"},         {Axes::Units::RQ4, "nm^-4?"}};
 
-//! Contains functions to create maps that give the right axis names for different
-//! detector types and units
+//! Contains const maps that give the right axis names for different detector types and units
 //! @ingroup detector
 
 namespace AxisNames {
-- 
GitLab


From 2e266a6cc697067c24d22a43932ac25e107e16c7 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 11:26:54 +0200
Subject: [PATCH 02/13] class comment

---
 GUI/coregui/Models/JobItemUtils.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/GUI/coregui/Models/JobItemUtils.h b/GUI/coregui/Models/JobItemUtils.h
index d2c9690eaa0..ab394ab1a07 100644
--- a/GUI/coregui/Models/JobItemUtils.h
+++ b/GUI/coregui/Models/JobItemUtils.h
@@ -25,10 +25,11 @@ class JobItem;
 class ISimulation;
 class IUnitConverter;
 
-//! Contains set of convenience methods to set data to the IntensityDataItem from domain simulation.
+//! Contains convenience methods to trasfer data from domain simulation to IntensityDataItem.
 //! Used to modify OutputData's axes units as requested by IntensityDataItem.
 
 namespace JobItemUtils {
+
 //! updates axes of OutputData in IntensityData item
 void updateDataAxes(DataItem* intensityItem, const InstrumentItem* instrumentItem);
 
@@ -48,6 +49,7 @@ void createDefaultDetectorMap(DataItem* intensityItem, const InstrumentItem* ins
 void setResults(DataItem* intensityItem, const ISimulation* simulation);
 
 ComboProperty availableUnits(const IUnitConverter& converter);
+
 } // namespace JobItemUtils
 
 #endif // BORNAGAIN_GUI_COREGUI_MODELS_JOBITEMUTILS_H
-- 
GitLab


From 3e1294b65155d6b6a034cb7bd5bad1a6b6e2ede4 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 11:33:17 +0200
Subject: [PATCH 03/13] + class comment

---
 GUI/coregui/Models/DataItem.h          | 11 +++++------
 GUI/coregui/Models/IntensityDataItem.h | 15 +++++++--------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/GUI/coregui/Models/DataItem.h b/GUI/coregui/Models/DataItem.h
index 63d89ab14b8..afea0576608 100644
--- a/GUI/coregui/Models/DataItem.h
+++ b/GUI/coregui/Models/DataItem.h
@@ -24,7 +24,8 @@
 class ImportDataInfo;
 class InstrumentItem;
 
-//! Provides common functionality for IntensityDataItem and SpecularDataItem
+//! Abstract base class for IntensityDataItem and SpecularDataItem.
+//! Owns one simulated(?) data set of type OutputData<double>.
 
 class BA_CORE_API_ DataItem : public SessionItem, public SaveLoadInterface {
 private:
@@ -39,9 +40,8 @@ public:
     //! The given pointer becomes owned by this class!!
     virtual void setOutputData(OutputData<double>* data) = 0;
 
-    //! Sets the raw data vector from external source
-    //! Checks only the equality of data size,
-    //! no dimension checks are applied.
+    //! Sets the raw data vector from external source.
+    //! Checks only the equality of data size; no dimension checks are applied.
     void setRawDataVector(std::vector<double> data);
 
     using SaveLoadInterface::fileName;
@@ -62,8 +62,7 @@ public:
     virtual void updateAxesUnits(const InstrumentItem* instrument) = 0;
     virtual std::vector<int> shape() const = 0;
 
-    //! Resets data to the state defined by user (imported)
-    //! data.
+    //! Resets data to the state defined by user (imported) data.
     virtual void reset(ImportDataInfo data) = 0;
 
 protected:
diff --git a/GUI/coregui/Models/IntensityDataItem.h b/GUI/coregui/Models/IntensityDataItem.h
index 6ae86e13640..1f7d607890a 100644
--- a/GUI/coregui/Models/IntensityDataItem.h
+++ b/GUI/coregui/Models/IntensityDataItem.h
@@ -43,23 +43,23 @@ public:
     int getNbinsX() const;
     int getNbinsY() const;
 
-    //! returns lower and upper zoom ranges of x-axis
+    //! Returns lower and upper zoom ranges of x-axis
     double getLowerX() const;
     double getUpperX() const;
 
-    //! returns min and max range of x-axis as given by IntensityData
+    //! Returns min and max range of x-axis as given by IntensityData
     double getXmin() const;
     double getXmax() const;
 
-    //! returns lower and upper zoom ranges of y-axis
+    //! Returns lower and upper zoom ranges of y-axis
     double getLowerY() const;
     double getUpperY() const;
 
-    //! returns min and max range of y-axis as given by IntensityData
+    //! Returns min and max range of y-axis as given by IntensityData
     double getYmin() const;
     double getYmax() const;
 
-    //! returns lower and upper zoom ranges of z-axis
+    //! Returns lower and upper zoom ranges of z-axis
     double getLowerZ() const;
     double getUpperZ() const;
 
@@ -69,7 +69,7 @@ public:
     QString getXaxisTitle() const;
     QString getYaxisTitle() const;
 
-    //! return true if min, max range of Z-axis is locked (change not allowed)
+    //! Returns true if min, max range of Z-axis is locked (change not allowed)
     bool isZAxisLocked() const;
     void setZAxisLocked(bool state);
 
@@ -100,8 +100,7 @@ public:
     void updateAxesUnits(const InstrumentItem* instrument) override;
     std::vector<int> shape() const override;
 
-    //! Returns data to the state defined by user (imported)
-    //! data.
+    //! Returns data to the state defined by user (imported) data.
     void reset(ImportDataInfo data) override;
 
 public slots:
-- 
GitLab


From 4cb8175d3de615f224cac735c96e6cbd0f4d898a Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 11:38:19 +0200
Subject: [PATCH 04/13] + class comments

---
 GUI/coregui/Models/DataItem.h     | 4 +++-
 GUI/coregui/Models/RealDataItem.h | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/GUI/coregui/Models/DataItem.h b/GUI/coregui/Models/DataItem.h
index afea0576608..107f1014a7d 100644
--- a/GUI/coregui/Models/DataItem.h
+++ b/GUI/coregui/Models/DataItem.h
@@ -25,7 +25,9 @@ class ImportDataInfo;
 class InstrumentItem;
 
 //! Abstract base class for IntensityDataItem and SpecularDataItem.
-//! Owns one simulated(?) data set of type OutputData<double>.
+//! Owns one simulated data set of type OutputData<double>.
+
+//! For experimental data, use RealDataItem.
 
 class BA_CORE_API_ DataItem : public SessionItem, public SaveLoadInterface {
 private:
diff --git a/GUI/coregui/Models/RealDataItem.h b/GUI/coregui/Models/RealDataItem.h
index 6299a9e5b8c..c63d5a6f4ca 100644
--- a/GUI/coregui/Models/RealDataItem.h
+++ b/GUI/coregui/Models/RealDataItem.h
@@ -30,7 +30,8 @@ class ImportDataInfo;
 class RealDataModel;
 class AbstractDataLoader;
 
-//! The RealDataItem class represents intensity data imported from file and intended for fitting.
+//! Provides access to experimental data, for display and fitting.
+//! Owns an AbstractDataLoader.
 
 class BA_CORE_API_ RealDataItem : public QObject, public SessionItem {
 
-- 
GitLab


From 09bb1d44f2884747bf4c5ddda04eccbc30b1941d Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 11:44:23 +0200
Subject: [PATCH 05/13] typo

---
 GUI/coregui/Models/JobItemUtils.cpp              | 10 ++++++----
 GUI/coregui/Models/ParameterTreeUtils.cpp        |  2 +-
 GUI/coregui/Views/SampleDesigner/DesignerScene.h |  2 +-
 GUI/coregui/mainwindow/OutputDataIOHistory.h     |  2 +-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/GUI/coregui/Models/JobItemUtils.cpp b/GUI/coregui/Models/JobItemUtils.cpp
index d905a63ca75..032911b5ece 100644
--- a/GUI/coregui/Models/JobItemUtils.cpp
+++ b/GUI/coregui/Models/JobItemUtils.cpp
@@ -69,15 +69,17 @@ void JobItemUtils::updateDataAxes(DataItem* intensityItem, const InstrumentItem*
     updateAxesTitle(intensityItem, *converter, requested_units);
 }
 
-//! Correspondance of domain detector axes types to their gui counterpart.
+//! Correspondence of domain detector axes types to their GUI counterpart.
 
 QString JobItemUtils::nameFromAxesUnits(Axes::Units units)
 {
-    return names_from_units.find(units) != names_from_units.end() ? names_from_units.at(units)
-                                                                  : QString();
+    const auto it = names_from_units.find(units);
+    if (it == names_from_units.end())
+        return "";
+    return it->second;
 }
 
-//! Correspondance of GUI axes units names to their domain counterpart.
+//! Correspondence of GUI axes units names to their domain counterpart.
 
 Axes::Units JobItemUtils::axesUnitsFromName(const QString& name)
 {
diff --git a/GUI/coregui/Models/ParameterTreeUtils.cpp b/GUI/coregui/Models/ParameterTreeUtils.cpp
index d4067a247c8..e02fa0449f7 100644
--- a/GUI/coregui/Models/ParameterTreeUtils.cpp
+++ b/GUI/coregui/Models/ParameterTreeUtils.cpp
@@ -131,7 +131,7 @@ QStringList ParameterTreeUtils::translatedParameterTreeNames(const SessionItem*
     return result;
 }
 
-//! Correspondance of parameter name to translated name for all properties found in source
+//! Correspondence of parameter name to translated name for all properties found in source
 //! in its children.
 
 QVector<QPair<QString, QString>> ParameterTreeUtils::parameterDictionary(const SessionItem* source)
diff --git a/GUI/coregui/Views/SampleDesigner/DesignerScene.h b/GUI/coregui/Views/SampleDesigner/DesignerScene.h
index 30888b72c64..c3a038d18af 100644
--- a/GUI/coregui/Views/SampleDesigner/DesignerScene.h
+++ b/GUI/coregui/Views/SampleDesigner/DesignerScene.h
@@ -106,7 +106,7 @@ private:
     bool m_block_selection;
 
     QMap<SessionItem*, IView*> m_ItemToView;
-    //!< Correspondance of model's item and scene's view
+    //!< Correspondence of model's item and scene's view
 
     QLineF m_layer_interface_line;
     //!< Foreground line representing appropriate interface during layer's movement
diff --git a/GUI/coregui/mainwindow/OutputDataIOHistory.h b/GUI/coregui/mainwindow/OutputDataIOHistory.h
index 2ccd46fba58..57236eb7c5b 100644
--- a/GUI/coregui/mainwindow/OutputDataIOHistory.h
+++ b/GUI/coregui/mainwindow/OutputDataIOHistory.h
@@ -76,7 +76,7 @@ public:
     QStringList savedFileNames(const QString& dirname) const;
 
 private:
-    //!< Correspondance of directory name to save history.
+    //!< Correspondence of directory name to save history.
     QMap<QString, OutputDataDirHistory> m_dir_history;
 };
 
-- 
GitLab


From 6ee528d3680ffdfc3c5ee7314200fdb11fc34a62 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 13:08:35 +0200
Subject: [PATCH 06/13] rm unused error code

---
 GUI/coregui/DataLoaders/AbstractDataLoader.h    | 5 +----
 GUI/coregui/DataLoaders/AbstractDataLoader1D.h  | 2 +-
 GUI/coregui/DataLoaders/AutomaticDataLoader1D.h | 3 ++-
 GUI/coregui/utils/ImportDataInfo.cpp            | 3 +--
 4 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/GUI/coregui/DataLoaders/AbstractDataLoader.h b/GUI/coregui/DataLoaders/AbstractDataLoader.h
index 5cc28163f2f..5db108385b3 100644
--- a/GUI/coregui/DataLoaders/AbstractDataLoader.h
+++ b/GUI/coregui/DataLoaders/AbstractDataLoader.h
@@ -25,7 +25,7 @@ class AbstractDataLoaderResultModel;
 
 #include <QtCore>
 
-//! Base class for all data loaders (classes which can import real data)
+//! Abstract base class for all data loaders (classes to import real data).
 
 class AbstractDataLoader : public QObject {
     Q_OBJECT
@@ -115,9 +115,6 @@ signals:
     //! Emitted whenever contents have been processed
     void contentsProcessed();
 
-protected:
-    enum class Error { DifferendNumberOfColumns };
-
 protected:
     RealDataItem* m_item; //< The real-data-item which owns this loader. Never delete this!
 };
diff --git a/GUI/coregui/DataLoaders/AbstractDataLoader1D.h b/GUI/coregui/DataLoaders/AbstractDataLoader1D.h
index a1bc6b91db5..0a616743368 100644
--- a/GUI/coregui/DataLoaders/AbstractDataLoader1D.h
+++ b/GUI/coregui/DataLoaders/AbstractDataLoader1D.h
@@ -17,7 +17,7 @@
 
 #include "GUI/coregui/DataLoaders/AbstractDataLoader.h"
 
-//! Base class for data loaders for 1D import
+//! Abstract base class for reflectometry data loaders.
 
 class AbstractDataLoader1D : public AbstractDataLoader {
 };
diff --git a/GUI/coregui/DataLoaders/AutomaticDataLoader1D.h b/GUI/coregui/DataLoaders/AutomaticDataLoader1D.h
index 0f37d40e1ad..82506f3bb1a 100644
--- a/GUI/coregui/DataLoaders/AutomaticDataLoader1D.h
+++ b/GUI/coregui/DataLoaders/AutomaticDataLoader1D.h
@@ -18,7 +18,8 @@
 #include "Device/Data/OutputData.h"
 #include "GUI/coregui/DataLoaders/AbstractDataLoader1D.h"
 
-//! Implements the legacy importer from BornAgain with no user interaction
+//! The legacy importer for reflectometry, with no user interaction.
+
 class AutomaticDataLoader1D : public AbstractDataLoader1D {
 public:
     virtual QString name() const override;
diff --git a/GUI/coregui/utils/ImportDataInfo.cpp b/GUI/coregui/utils/ImportDataInfo.cpp
index beb67363b1f..ce92e10e577 100644
--- a/GUI/coregui/utils/ImportDataInfo.cpp
+++ b/GUI/coregui/utils/ImportDataInfo.cpp
@@ -22,8 +22,7 @@ namespace {
 std::vector<Axes::Units> specularUnits()
 {
     std::vector<Axes::Units> result;
-    const auto units_map = AxisNames::specAxis;
-    for (auto& pair : units_map)
+    for (auto& pair : AxisNames::specAxis)
         result.push_back(pair.first);
     return result;
 }
-- 
GitLab


From efa029fbff5a32c0e5509401ea6ae291fb91a4e0 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 13:19:00 +0200
Subject: [PATCH 07/13] shorter comment lines

---
 GUI/coregui/DataLoaders/AbstractDataLoader.h | 49 +++++++++++---------
 1 file changed, 27 insertions(+), 22 deletions(-)

diff --git a/GUI/coregui/DataLoaders/AbstractDataLoader.h b/GUI/coregui/DataLoaders/AbstractDataLoader.h
index 5db108385b3..eadaa3ec6d5 100644
--- a/GUI/coregui/DataLoaders/AbstractDataLoader.h
+++ b/GUI/coregui/DataLoaders/AbstractDataLoader.h
@@ -47,8 +47,9 @@ public:
     //! The real data item on which the import shall work.
     const RealDataItem* realDataItem() const;
 
-    //! Fills the widget on the import dialog pane. This base class' implementation does nothing
-    //! (meaning "no editable properties")
+    //! Fills the widget on the import dialog pane.
+    //! The implementation here in the base class does nothing
+    //! (meaning "no editable properties").
     virtual void populateImportSettingsWidget(QWidget* parent);
 
     //! Read all values from the properties UI into the internal variables
@@ -66,44 +67,48 @@ public:
     //! Returns every internal setting so it can be restored completely
     virtual QByteArray serialize() const;
 
-    //! Initialize from serialization data. If any error occurred, then a DeserializationException
-    //! has to be thrown.
-    //! The complete state has to be restored. Therefore if e.g. errors occurred in the former
-    //! serialization, but errors are not serialized, then they have to be regenerated/recalculated
-    //! in here.
+    //! Initialize from serialization data. If any error occurred,
+    //! then a DeserializationException has to be thrown.
+    //! The complete state has to be restored.
+    //! Therefore if e.g. errors occurred in the former serialization,
+    //! but errors are not serialized, then they have to be regenerated/
+    //! recalculated in here.
     virtual void deserialize(const QByteArray& data);
 
-    //! Sets the file contents to be imported. If the file was a compressed file, here already the
-    //! decompressed content will be overhanded.
+    //! Sets the file contents to be imported.
+    //! If the file was a compressed file, then the decompressed content
+    //! will be handed over already here.
     virtual void setFileContents(const QByteArray& fileContent) = 0;
 
-    //! Returns the original file content. If not available any more (like for legacy project file
-    //! import), then an empty array will be returned.
+    //! Returns the original file content.
+    //! If not available any more (like for legacy project file import),
+    //! then an empty array will be returned.
     virtual QByteArray fileContent() const;
 
-    //! Guess appropriate settings (for example the separator in a CSV file). Is called only once,
-    //! directly after setting the file content.
+    //! Guess appropriate settings (for example the separator in a CSV file).
+    //! Is called only once, directly after setting the file content.
     virtual void guessSettings();
 
-    //! Process the file contents. Can be called more than once, e.g. if the import settings have
-    //! changed.
+    //! Process the file contents.
+    //! Can be called more than once, e.g. if the import settings have changed.
     //! Any error has to be stored in the loader (see numErrors()).
     virtual void processContents() = 0;
 
-    //! Number of errors found while processing the content. An error means that either a particular
-    //! content (line) can't be used or may be suspicious (line related error), or that the whole
-    //! content can't be used (e.g. only 1 line present).
+    //! Number of errors found while processing the content.
+    //! An error means that either a particular content (line) can't be used
+    //! or may be suspicious (line related error), or that the whole content
+    //! can't be used (e.g. only 1 line present).
     virtual int numErrors() const;
 
-    //! Number of errors related to a specific line. Such an error means that a particular
-    //! content (line) can't be used or may be suspicious.
+    //! Number of errors related to a specific line. Such an error means that
+    //! a particular content (line) can't be used or may be suspicious.
     virtual int numLineRelatedErrors() const;
 
     //! Errors not related to a particular line.
     virtual QStringList lineUnrelatedErrors() const;
 
-    //! Create a table model which contains the import information like original file content, raw
-    //! content, processed content
+    //! Create a table model which contains the import information like
+    //! original file content, raw content, processed content.
     //! The returned pointer will be owned by the caller.
     //! This base class' implementation does nothing (return nullptr).
     virtual AbstractDataLoaderResultModel* createResultModel() const;
-- 
GitLab


From f0d36ec714727535898d613b47796c131433c03b Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 13:41:19 +0200
Subject: [PATCH 08/13] format comments; make fct local

---
 .../ImportDataWidgets/ImportDataUtils.cpp      |  6 ++++--
 .../Views/ImportDataWidgets/ImportDataUtils.h  | 18 +++++++++---------
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
index c01fe266cea..bb72fbcc45a 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
@@ -33,6 +33,7 @@
 #include <QMessageBox>
 
 namespace {
+
 const QString filter_string_ba = "Intensity File (*.int *.gz *.tif *.tiff *.txt *.csv);;"
                                  "Other (*.*)";
 const QString filter_string_ascii = "Intensity File (*.int *.int.gz *.txt *.csv *.dat *.ascii);;"
@@ -48,8 +49,6 @@ int rank(const InstrumentItem& item)
     return static_cast<int>(item.shape().size());
 }
 
-} // namespace
-
 std::unique_ptr<OutputData<double>>
 ImportDataUtils::ImportKnownData(const QString& fileName,
                                  IntensityDataIOFactory::LoaderSelector loader)
@@ -69,6 +68,9 @@ ImportDataUtils::ImportKnownData(const QString& fileName,
     return result;
 }
 
+} // namespace
+
+
 std::unique_ptr<OutputData<double>>
 ImportDataUtils::ImportReflectometryData(const QString& fileName)
 {
diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
index 88d97c95975..060924abe99 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
@@ -31,19 +31,19 @@ class AbstractDataLoader;
 
 namespace ImportDataUtils {
 
+//! Imports 2D data, stores them as OutputData, and returns owning pointer.
 std::unique_ptr<OutputData<double>> Import2dData(const QString& fileName,
                                                  IntensityDataIOFactory::LoaderSelector loader);
 
-//! Import 1D data into the given item.
-//! Returns an error text if a fatal error occurred (discard item). "Empty string" means "no fatal
-//! error" => imported item should be kept. The imported item still can have errors, but they might
-//! be solvable by different import settings or by using a different data loader.
-//! selectedLoader is the one which was selected in the open-file-dialog (or null if none selected).
-QString Import1dData(RealDataItem* realDataItem, const AbstractDataLoader* selectedLoader);
+//! Imports 1D data into the given item.
 
-std::unique_ptr<OutputData<double>>
-ImportKnownData(const QString& fileName,
-                IntensityDataIOFactory::LoaderSelector loader = IntensityDataIOFactory::automatic);
+//! Returns an error text if a fatal error occurred (discard item).
+//! "Empty string" means "no fatal error" => imported item should be kept.
+//! The imported item still can have errors, but they might be solvable
+//! by different import settings or by using a different data loader.
+//! Argument selectedLoader is the one which was selected in the open-file-dialog
+//! (or null if none selected).
+QString Import1dData(RealDataItem* realDataItem, const AbstractDataLoader* selectedLoader);
 
 std::unique_ptr<OutputData<double>> ImportReflectometryData(const QString& fileName);
 
-- 
GitLab


From e71e69ec24ac921a0eddf3e95b7fae18648cca01 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 13:47:26 +0200
Subject: [PATCH 09/13] rm unused fct

---
 .../ImportDataWidgets/ImportDataUtils.cpp     | 25 +++----------------
 .../Views/ImportDataWidgets/ImportDataUtils.h |  3 ---
 2 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
index bb72fbcc45a..00d34406872 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
@@ -49,16 +49,16 @@ int rank(const InstrumentItem& item)
     return static_cast<int>(item.shape().size());
 }
 
-std::unique_ptr<OutputData<double>>
-ImportDataUtils::ImportKnownData(const QString& fileName,
-                                 IntensityDataIOFactory::LoaderSelector loader)
+std::unique_ptr<OutputData<double>> ImportKnownData(
+    const QString& fileName,
+    IntensityDataIOFactory::LoaderSelector loader = IntensityDataIOFactory::automatic)
 {
     // Try to use the canonical tools for importing data
     std::unique_ptr<OutputData<double>> result;
     try {
         std::unique_ptr<OutputData<double>> data(
             IntensityDataIOFactory::readOutputData(fileName.toStdString(), loader));
-        result = CreateSimplifiedOutputData(*data);
+        result = ImportDataUtils::CreateSimplifiedOutputData(*data);
     } catch (std::exception& ex) {
         QString message = QString("Error while trying to read file\n\n'%1'\n\n%2")
                               .arg(fileName)
@@ -71,23 +71,6 @@ ImportDataUtils::ImportKnownData(const QString& fileName,
 } // namespace
 
 
-std::unique_ptr<OutputData<double>>
-ImportDataUtils::ImportReflectometryData(const QString& fileName)
-{
-    std::unique_ptr<OutputData<double>> result;
-    try {
-        std::unique_ptr<OutputData<double>> data(
-            IntensityDataIOFactory::readReflectometryData(fileName.toStdString()));
-        result.swap(data);
-    } catch (std::exception& ex) {
-        QString message = QString("Error while trying to read file\n\n'%1'\n\n%2")
-                              .arg(fileName)
-                              .arg(QString::fromStdString(std::string(ex.what())));
-        QMessageBox::warning(nullptr, "IO Problem", message);
-    }
-    return result;
-}
-
 std::unique_ptr<OutputData<double>>
 ImportDataUtils::Import2dData(const QString& fileName,
                               IntensityDataIOFactory::LoaderSelector loader)
diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
index 060924abe99..6fd9632c750 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
@@ -24,7 +24,6 @@
 template <class T> class OutputData;
 class RealDataItem;
 class InstrumentItem;
-class GISASInstrumentItem;
 class AbstractDataLoader;
 
 //! Provides utility methods to import data files.
@@ -45,8 +44,6 @@ std::unique_ptr<OutputData<double>> Import2dData(const QString& fileName,
 //! (or null if none selected).
 QString Import1dData(RealDataItem* realDataItem, const AbstractDataLoader* selectedLoader);
 
-std::unique_ptr<OutputData<double>> ImportReflectometryData(const QString& fileName);
-
 //! Creates OutputData with bin-valued axes.
 std::unique_ptr<OutputData<double>> CreateSimplifiedOutputData(const OutputData<double>& data);
 
-- 
GitLab


From a56d2363639c7da9f3a20e661c684fb1941fd7bc Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 14:39:10 +0200
Subject: [PATCH 10/13] rm fct that was only used in tests; rm default c'tor

---
 .../CsvImportAssistant/CsvImportAssistant.h   |  1 -
 .../ImportDataWidgets/ImportDataUtils.cpp     |  9 +-
 GUI/coregui/utils/ImportDataInfo.cpp          |  2 -
 GUI/coregui/utils/ImportDataInfo.h            |  2 +-
 Tests/Performance/GUI/CMakeLists.txt          |  1 -
 .../GUI/CsvImportAssistantPerformanceTest.cpp | 92 ------------------
 .../UnitTests/GUI/TestCsvImportAssistant.cpp  | 96 -------------------
 7 files changed, 7 insertions(+), 196 deletions(-)
 delete mode 100644 Tests/Performance/GUI/CsvImportAssistantPerformanceTest.cpp
 delete mode 100644 Tests/UnitTests/GUI/TestCsvImportAssistant.cpp

diff --git a/GUI/coregui/Views/ImportDataWidgets/CsvImportAssistant/CsvImportAssistant.h b/GUI/coregui/Views/ImportDataWidgets/CsvImportAssistant/CsvImportAssistant.h
index 39f78c2a9af..ccdc7814906 100644
--- a/GUI/coregui/Views/ImportDataWidgets/CsvImportAssistant/CsvImportAssistant.h
+++ b/GUI/coregui/Views/ImportDataWidgets/CsvImportAssistant/CsvImportAssistant.h
@@ -53,7 +53,6 @@ class CsvImportAssistant : public QObject {
     Q_OBJECT
 public:
     CsvImportAssistant(const QString& file, const bool useGUI = false, QWidget* parent = nullptr);
-    ImportDataInfo getData() { return m_dataAvailable ? fillData() : ImportDataInfo(); }
     static void showErrorMessage(std::string message);
     void setIntensityColumn(int iCol, double multiplier = 1.0);
     void setCoordinateColumn(int iCol, Axes::Units units, double multiplier = 1.0);
diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
index 00d34406872..38b2e106e5b 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
@@ -49,6 +49,10 @@ int rank(const InstrumentItem& item)
     return static_cast<int>(item.shape().size());
 }
 
+//! Imports for 2D or 1D data, using given loader.
+//! Allocates OutputData, and returns owning pointer.
+//! Currently used for all 2D, and some 1D data files.
+
 std::unique_ptr<OutputData<double>> ImportKnownData(
     const QString& fileName,
     IntensityDataIOFactory::LoaderSelector loader = IntensityDataIOFactory::automatic)
@@ -111,9 +115,8 @@ QString ImportDataUtils::Import1dData(RealDataItem* realDataItem,
     // -- try with selected CSV loader. If none selected, try with QRE loader
 
     QFile file(fileName);
-    const bool fileCouldBeOpened = file.open(QFile::ReadOnly | QIODevice::Text);
-
-    if (!fileCouldBeOpened)
+    const bool ok = file.open(QFile::ReadOnly | QIODevice::Text);
+    if (!ok)
         return "File could not be opened.";
 
     QByteArray fileContent = file.readAll();
diff --git a/GUI/coregui/utils/ImportDataInfo.cpp b/GUI/coregui/utils/ImportDataInfo.cpp
index ce92e10e577..955f60b659f 100644
--- a/GUI/coregui/utils/ImportDataInfo.cpp
+++ b/GUI/coregui/utils/ImportDataInfo.cpp
@@ -32,8 +32,6 @@ std::map<size_t, std::vector<Axes::Units>> available_units = {{1u, specularUnits
                                                               {2u, {Axes::Units::NBINS}}};
 } // namespace
 
-ImportDataInfo::ImportDataInfo() = default;
-
 ImportDataInfo::ImportDataInfo(ImportDataInfo&& other)
     : m_data(std::move(other.m_data)), m_units(other.m_units)
 {
diff --git a/GUI/coregui/utils/ImportDataInfo.h b/GUI/coregui/utils/ImportDataInfo.h
index c2cab9935b4..d6242b7ad4b 100644
--- a/GUI/coregui/utils/ImportDataInfo.h
+++ b/GUI/coregui/utils/ImportDataInfo.h
@@ -25,7 +25,7 @@ template <class T> class OutputData;
 
 class ImportDataInfo {
 public:
-    ImportDataInfo();
+    ImportDataInfo() = delete;
     ImportDataInfo(ImportDataInfo&& other);
     ImportDataInfo(std::unique_ptr<OutputData<double>> data, Axes::Units units);
     ImportDataInfo(OutputData<double>&& data, Axes::Units units);
diff --git a/Tests/Performance/GUI/CMakeLists.txt b/Tests/Performance/GUI/CMakeLists.txt
index 6c94923d2ad..d8b5df1d120 100644
--- a/Tests/Performance/GUI/CMakeLists.txt
+++ b/Tests/Performance/GUI/CMakeLists.txt
@@ -7,5 +7,4 @@ function(PerformanceTest NAME SPEED DEPS)
     endif()
 endfunction()
 
-PerformanceTest(CsvImportAssistantPerformanceTest "fast" "")
 PerformanceTest(GUIPerformanceTest "too_slow" ../Benchmark.cpp) # don't run (timeout after 1500s)
diff --git a/Tests/Performance/GUI/CsvImportAssistantPerformanceTest.cpp b/Tests/Performance/GUI/CsvImportAssistantPerformanceTest.cpp
deleted file mode 100644
index 23c8af506f7..00000000000
--- a/Tests/Performance/GUI/CsvImportAssistantPerformanceTest.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//  ************************************************************************************************
-//
-//  BornAgain: simulate and fit reflection and scattering
-//
-//! @file      Tests/Performance/GUI/CsvImportAssistantPerformanceTest.cpp
-//! @brief     Implements GUI performance functional test.
-//!
-//! @homepage  http://www.bornagainproject.org
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2018
-//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-//
-//  ************************************************************************************************
-
-#include "Tests/Performance/GUI/CsvImportAssistantPerformanceTest.h"
-#include "Device/Data/ArrayUtils.h"
-#include "Device/Histo/IntensityDataIOFactory.h"
-#include "GUI/coregui/Views/ImportDataWidgets/CsvImportAssistant/CsvImportAssistant.h"
-#include <ctime>
-#include <iostream>
-
-void CsvImportAssistantPerformanceTest::writeTestFile()
-{
-    remove(m_testFilename.c_str());
-    OutputData<double>* data = ArrayUtils::createData(m_testVector).release();
-    IntensityDataIOFactory::writeOutputData(*data, m_testFilename);
-}
-
-void CsvImportAssistantPerformanceTest::writeTestFile(size_t nRows, size_t nCols)
-{
-    remove(m_testFilename.c_str());
-    std::ofstream myfile;
-    myfile.open(m_testFilename);
-    for (size_t i = 0; i < nRows; i++) {
-        for (size_t j = 0; j < nCols; j++) {
-            myfile << nCols * i + j << " ";
-        }
-        myfile << "\n";
-    }
-    myfile.close();
-}
-
-OutputData<double>* CsvImportAssistantPerformanceTest::readTestFile()
-{
-    return IntensityDataIOFactory::readOutputData(m_testFilename);
-}
-
-bool CsvImportAssistantPerformanceTest::runTest()
-{
-    std::cout << "CsvImportAssistantPerformanceTest -> Running ..." << std::endl;
-    size_t maxRows = 1000;
-    size_t maxCols = 1000;
-
-    for (size_t nRows = 10; nRows <= maxRows; nRows *= 10) {
-        for (size_t nCols = 10; nCols <= maxCols; nCols *= 10) {
-
-            // Write test file
-            writeTestFile(nRows, nCols);
-
-            // Time the process of reading and importing data:
-            std::clock_t c_start = std::clock();
-
-            // Reading and setting data to import:
-            CsvImportAssistant assistant(testFilename());
-            assistant.setIntensityColumn(1);
-            assistant.setCoordinateColumn(9, Axes::Units::DEGREES);
-            assistant.setFirstRow(1);
-            assistant.setLastRow(int(nRows));
-
-            // Importing of data:
-            // If something goes wrong, this line may make the test fail or even crash.
-            // The correctness of the reading is tested in test_readFile.
-            std::vector<double> RawDataVec =
-                assistant.getData().intensityData()->getRawDataVector();
-            if (RawDataVec.size() != nRows)
-                return false;
-
-            // Report on the test time:
-            std::clock_t c_end = std::clock();
-            double_t time_spent = 1000.0 * double_t(c_end - c_start) / double_t(CLOCKS_PER_SEC);
-            std::cout << "nRows: " << nRows << "; nCols: " << nCols << "; time: " << time_spent
-                      << " ms\n"
-                      << std::flush;
-        }
-    }
-    return true;
-}
-
-int main()
-{
-    return !CsvImportAssistantPerformanceTest().runTest();
-}
diff --git a/Tests/UnitTests/GUI/TestCsvImportAssistant.cpp b/Tests/UnitTests/GUI/TestCsvImportAssistant.cpp
deleted file mode 100644
index df737e845bf..00000000000
--- a/Tests/UnitTests/GUI/TestCsvImportAssistant.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-#include "Device/Data/ArrayUtils.h"
-#include "Device/Histo/IntensityDataIOFactory.h"
-#include "Device/Unit/AxisNames.h"
-#include "GUI/coregui/Models/JobItemUtils.h"
-#include "GUI/coregui/Models/SpecularDataItem.h"
-#include "GUI/coregui/Views/ImportDataWidgets/CsvImportAssistant/CsvImportAssistant.h"
-#include "Tests/GTestWrapper/google_test.h"
-#include <vector>
-
-class TestCsvImportAssistant : public ::testing::Test {
-protected:
-    const std::string m_testFilename = "tm_TestCsvImportAssistant.txt";
-    const std::vector<std::vector<double>> m_testVector = {
-        {0.0, 1.0, 2.0, 3.0},     {4.0, 5.0, 6.0, 7.0},     {8.0, 9.0, 10.0, 11.0},
-        {12.0, 13.0, 14.0, 15.0}, {16.0, 17.0, 18.0, 19.0}, {20.0, 21.0, 22.0, 23.0}};
-
-    const QString testFilename() { return QString::fromStdString(m_testFilename); }
-
-    void writeTestFile()
-    {
-        remove(m_testFilename.c_str());
-        OutputData<double>* data = ArrayUtils::createData(m_testVector).release();
-        IntensityDataIOFactory::writeOutputData(*data, m_testFilename);
-    }
-
-    void writeTestFile(size_t nRows, size_t nCols)
-    {
-        remove(m_testFilename.c_str());
-        std::ofstream myfile;
-        myfile.open(m_testFilename);
-        for (size_t i = 0; i < nRows; i++) {
-            for (size_t j = 0; j < nCols; j++) {
-                myfile << nCols * i + j << " ";
-            }
-            myfile << "\n";
-        }
-        myfile.close();
-    }
-
-    OutputData<double>* readTestFile()
-    {
-        return IntensityDataIOFactory::readOutputData(m_testFilename);
-    }
-};
-
-//! Testing component items of particle item.
-TEST_F(TestCsvImportAssistant, test_readFile)
-{
-    /*
-     * The file to read looks like this ['-' symbols added to clarify what is going on].
-     * It has originaly ten columns, not four (The separator is a space).
-     * When the separator is a space, repeated spaces will be merged into one.
-     * Thus, the ImportAssistant will read this file as a four-column file.
-    # - BornAgain - Intensity - Data -  -  -  -  -  -  -
-    # - Simple - 2D - array - suitable - for - numpy, - matlab - etc. -  -
-    # - [nrows=6, - ncols=4] -  -  -  -  -  -  -  -
-    0.000000000000e+00 -  -  -  - 1.000000000000e+00 -  -  -  - 2.000000000000e+00 -
-    3.000000000000e+00 -
-    4.000000000000e+00 -  -  -  - 5.000000000000e+00 -  -  -  - 6.000000000000e+00 -
-    7.000000000000e+00 -
-    8.000000000000e+00 -  -  -  - 9.000000000000e+00 -  -  -  - 1.000000000000e+01 -
-    1.100000000000e+01 -
-    1.200000000000e+01 -  -  -  - 1.300000000000e+01 -  -  -  - 1.400000000000e+01 -
-    1.500000000000e+01 -
-    1.600000000000e+01 -  -  -  - 1.700000000000e+01 -  -  -  - 1.800000000000e+01 -
-    1.900000000000e+01 -
-    2.000000000000e+01 -  -  -  - 2.100000000000e+01 -  -  -  - 2.200000000000e+01 -
-    2.300000000000e+01 -
-    Number of Columns: 10
-    Separator: >>> <<<
-    */
-    writeTestFile();
-
-    CsvImportAssistant assistant(testFilename());
-
-    assistant.setIntensityColumn(1);
-    assistant.setCoordinateColumn(3, Axes::Units::DEGREES);
-    assistant.setFirstRow(5);
-    assistant.setLastRow(7);
-
-    auto DataRank = assistant.getData().dataRank();
-    auto AllocSize = assistant.getData().intensityData()->getAllocatedSize();
-    auto RawDataVec = assistant.getData().intensityData()->getRawDataVector();
-    auto UnitsLabel = assistant.getData().unitsLabel();
-    auto AxisLabel0 = assistant.getData().axisLabel(0);
-    auto AxisLabel1 = assistant.getData().axisLabel(1);
-
-    const std::vector<double> expected = {4.0, 8.0, 12.0};
-
-    EXPECT_EQ(DataRank, 1u);
-    EXPECT_EQ(AllocSize, 3u);
-    EXPECT_EQ(RawDataVec, expected);
-    EXPECT_EQ(UnitsLabel, JobItemUtils::nameFromAxesUnits(Axes::Units::DEGREES));
-    EXPECT_EQ(AxisLabel0, QString::fromStdString(AxisNames::specAxis.at(Axes::Units::DEGREES)));
-    EXPECT_EQ(AxisLabel1, SpecularDataAxesNames::y_axis_default_name);
-}
-- 
GitLab


From 08711883f9500c416d8c8756dfeb7c207f5ec2af Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 14:44:35 +0200
Subject: [PATCH 11/13] rm local vars

---
 GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
index 38b2e106e5b..f47a127b5f4 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
@@ -163,10 +163,7 @@ ImportDataUtils::CreateSimplifiedOutputData(const OutputData<double>& data)
     std::unique_ptr<OutputData<double>> result(new OutputData<double>);
     for (size_t i = 0; i < data_rank; ++i) {
         const IAxis& axis = data.axis(i);
-        const size_t axis_size = axis.size();
-        const double min = 0.0;
-        const double max = axis_size;
-        result->addAxis(FixedBinAxis(axis.getName(), axis_size, min, max));
+        result->addAxis(FixedBinAxis(axis.getName(), axis.size(), 0., axis.size()));
     }
     result->setRawDataVector(data.getRawDataVector());
 
-- 
GitLab


From dc9570082e3e8616af0a5c726e9e7c1952c9351f Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 15:00:52 +0200
Subject: [PATCH 12/13] rename method -> binifyAxes

---
 .../Views/ImportDataWidgets/ImportDataUtils.cpp       | 11 +++--------
 GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h |  2 +-
 GUI/coregui/utils/ImportDataInfo.cpp                  |  2 +-
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
index f47a127b5f4..bc305ffb181 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
@@ -62,7 +62,7 @@ std::unique_ptr<OutputData<double>> ImportKnownData(
     try {
         std::unique_ptr<OutputData<double>> data(
             IntensityDataIOFactory::readOutputData(fileName.toStdString(), loader));
-        result = ImportDataUtils::CreateSimplifiedOutputData(*data);
+        result = ImportDataUtils::binifyAxes(*data);
     } catch (std::exception& ex) {
         QString message = QString("Error while trying to read file\n\n'%1'\n\n%2")
                               .arg(fileName)
@@ -153,15 +153,10 @@ bool ImportDataUtils::Compatible(const InstrumentItem& instrumentItem,
 }
 
 std::unique_ptr<OutputData<double>>
-ImportDataUtils::CreateSimplifiedOutputData(const OutputData<double>& data)
+ImportDataUtils::binifyAxes(const OutputData<double>& data)
 {
-    const size_t data_rank = data.rank();
-    if (data_rank > 2 || data_rank < 1)
-        throw std::runtime_error("Error in ImportDataUtils::CreateSimplifiedOutputData: passed "
-                                 "array is neither 1D nor 2D");
-
     std::unique_ptr<OutputData<double>> result(new OutputData<double>);
-    for (size_t i = 0; i < data_rank; ++i) {
+    for (size_t i = 0; i < data.rank(); ++i) {
         const IAxis& axis = data.axis(i);
         result->addAxis(FixedBinAxis(axis.getName(), axis.size(), 0., axis.size()));
     }
diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
index 6fd9632c750..2f82a416ce1 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h
@@ -45,7 +45,7 @@ std::unique_ptr<OutputData<double>> Import2dData(const QString& fileName,
 QString Import1dData(RealDataItem* realDataItem, const AbstractDataLoader* selectedLoader);
 
 //! Creates OutputData with bin-valued axes.
-std::unique_ptr<OutputData<double>> CreateSimplifiedOutputData(const OutputData<double>& data);
+std::unique_ptr<OutputData<double>> binifyAxes(const OutputData<double>& data);
 
 //! Check whether data item is compatible with instrument (same rank)
 bool Compatible(const InstrumentItem& instrumentItem, const RealDataItem& realDataItem);
diff --git a/GUI/coregui/utils/ImportDataInfo.cpp b/GUI/coregui/utils/ImportDataInfo.cpp
index 955f60b659f..48e6342e440 100644
--- a/GUI/coregui/utils/ImportDataInfo.cpp
+++ b/GUI/coregui/utils/ImportDataInfo.cpp
@@ -39,7 +39,7 @@ ImportDataInfo::ImportDataInfo(ImportDataInfo&& other)
 
 ImportDataInfo::ImportDataInfo(std::unique_ptr<OutputData<double>> data, Axes::Units units)
     : m_data(units == Axes::Units::NBINS && data
-                 ? ImportDataUtils::CreateSimplifiedOutputData(*data)
+                 ? ImportDataUtils::binifyAxes(*data)
                  : std::move(data))
     , m_units(units)
 {
-- 
GitLab


From b9e546ae4fea7b5579bea588bf8023c1b9f5ffe5 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 22 Apr 2021 15:21:17 +0200
Subject: [PATCH 13/13] rename var to reflect type

---
 GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
index bc305ffb181..4e946d87de1 100644
--- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
+++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp
@@ -93,9 +93,9 @@ QString ImportDataUtils::Import1dData(RealDataItem* realDataItem,
             || DataFormatUtils::isIntFile(fileNameStdString)
             || DataFormatUtils::isTiffFile(fileNameStdString)) {
             try {
-                ImportDataInfo data(ImportKnownData(fileName), Axes::Units::QSPACE);
-                if (data) {
-                    realDataItem->setImportData(std::move(data));
+                ImportDataInfo info(ImportKnownData(fileName), Axes::Units::QSPACE);
+                if (info) {
+                    realDataItem->setImportData(std::move(info));
                     return QString();
                 }
             } catch (std::exception& ex) {
-- 
GitLab