diff --git a/Core/Scan/UnitConverter1D.cpp b/Core/Scan/UnitConverter1D.cpp index 9b28bd67ec22cf031a82358b136c1333c23ff58f..cd328dc92bdc9ddbd79827a8e7946bca8dcf2000 100644 --- a/Core/Scan/UnitConverter1D.cpp +++ b/Core/Scan/UnitConverter1D.cpp @@ -82,7 +82,7 @@ std::unique_ptr<IAxis> UnitConverter1D::createConvertedAxis(size_t i_axis, Axes: std::unique_ptr<OutputData<double>> UnitConverter1D::createConvertedData(const OutputData<double>& data, Axes::Units units) const { - if (data.getRank() != 1) + if (data.rank() != 1) throw std::runtime_error("Error in UnitConverter1D::createConvertedData: unexpected " "dimensions of the input data"); diff --git a/Core/Simulation/ISimulation.cpp b/Core/Simulation/ISimulation.cpp index 614e82cef1c388ca2c6943e99c4f150d0224ebe0..e6c63e258e18a5c4acc2e9dc499661173f3ab8d7 100644 --- a/Core/Simulation/ISimulation.cpp +++ b/Core/Simulation/ISimulation.cpp @@ -32,7 +32,7 @@ namespace bool detHasSameDimensions(const IDetector& detector, const OutputData<double>& data) { - if (data.getRank() != detector.dimension()) + if (data.rank() != detector.dimension()) return false; for (size_t i = 0; i < detector.dimension(); ++i) diff --git a/Device/Data/LLData.h b/Device/Data/LLData.h index ec311b771541aff7e92459e152c5cd4b25443e6e..f4bc08d73eefd27b0b4cced4f2b3b0cdc41369a9 100644 --- a/Device/Data/LLData.h +++ b/Device/Data/LLData.h @@ -53,7 +53,7 @@ public: // retrieve basic info size_t getTotalSize() const; - inline size_t getRank() const { return m_rank; } + inline size_t rank() const { return m_rank; } const int* getDimensions() const { return m_dims; } T getTotalSum() const; @@ -91,7 +91,7 @@ inline LLData<T>::LLData(size_t rank, const int* dimensions) : m_rank(0), m_dims template <class T> LLData<T>::LLData(const LLData<T>& right) : m_rank(0), m_dims(0), m_data_array(0) { - allocate(right.getRank(), right.getDimensions()); + allocate(right.rank(), right.getDimensions()); for (size_t i = 0; i < getTotalSize(); ++i) { m_data_array[i] = right[i]; } @@ -295,11 +295,11 @@ template <class T> LLData<T> operator/(const LLData<T>& left, const LLData<T>& r template <class T> bool HaveSameDimensions(const LLData<T>& left, const LLData<T>& right) { - if (left.getRank() != right.getRank()) + if (left.rank() != right.rank()) return false; const int* ldims = left.getDimensions(); const int* rdims = right.getDimensions(); - for (size_t i = 0; i < left.getRank(); ++i) { + for (size_t i = 0; i < left.rank(); ++i) { if (ldims[i] != rdims[i]) return false; } diff --git a/Device/Data/OutputData.cpp b/Device/Data/OutputData.cpp index 88b623df6e00aa3e24ed198fb83025012e6879e9..25d9aaf6665f4969270413c0b5baf4528b3ad29c 100644 --- a/Device/Data/OutputData.cpp +++ b/Device/Data/OutputData.cpp @@ -22,7 +22,7 @@ template <> PyObject* OutputData<double>::getArray() const { std::vector<size_t> dimensions; - for (size_t i = 0; i < getRank(); i++) + for (size_t i = 0; i < rank(); i++) dimensions.push_back(axis(i).size()); // for rot90 of 2-dim arrays to conform with numpy @@ -45,7 +45,7 @@ template <> PyObject* OutputData<double>::getArray() const double* array_buffer = (double*)PyArray_DATA((PyArrayObject*)pyarray); // filling numpy array with output_data - if (getRank() == 2) { + if (rank() == 2) { for (size_t index = 0; index < getAllocatedSize(); ++index) { std::vector<int> axes_indices = getAxesBinIndices(index); size_t offset = diff --git a/Device/Data/OutputData.h b/Device/Data/OutputData.h index 1bd07d28c39991dad42372e390aa641afa30616e..0e4cbe630d7c4bf202781450e8feb846dbad682b 100644 --- a/Device/Data/OutputData.h +++ b/Device/Data/OutputData.h @@ -56,7 +56,7 @@ public: // retrieve basic info //! Returns number of dimensions. - size_t getRank() const { return m_value_axes.size(); } + size_t rank() const { return m_value_axes.size(); } //! Returns total size of data buffer (product of bin number in every dimension). size_t getAllocatedSize() const @@ -271,7 +271,7 @@ template <class T> void OutputData<T>::copyFrom(const OutputData<T>& other) template <class T> template <class U> void OutputData<T>::copyShapeFrom(const OutputData<U>& other) { clear(); - size_t rank = other.getRank(); + size_t rank = other.rank(); for (size_t i = 0; i < rank; ++i) addAxis(other.axis(i)); } @@ -325,7 +325,7 @@ template <class T> inline std::vector<size_t> OutputData<T>::getAllSizes() const { ASSERT(m_ll_data); std::vector<size_t> result; - for (size_t i = 0; i < getRank(); ++i) { + for (size_t i = 0; i < rank(); ++i) { int dim = m_ll_data->getDimensions()[i]; result.push_back(dim); } @@ -358,11 +358,11 @@ template <class T> std::vector<int> OutputData<T>::getAxesBinIndices(size_t glob ASSERT(m_ll_data); size_t remainder = global_index; std::vector<int> result; - result.resize(m_ll_data->getRank()); - for (size_t i = 0; i < m_ll_data->getRank(); ++i) { - result[m_ll_data->getRank() - 1 - i] = - (int)(remainder % m_value_axes[m_ll_data->getRank() - 1 - i]->size()); - remainder /= m_value_axes[m_ll_data->getRank() - 1 - i]->size(); + result.resize(m_ll_data->rank()); + for (size_t i = 0; i < m_ll_data->rank(); ++i) { + result[m_ll_data->rank() - 1 - i] = + (int)(remainder % m_value_axes[m_ll_data->rank() - 1 - i]->size()); + remainder /= m_value_axes[m_ll_data->rank() - 1 - i]->size(); } return result; } @@ -372,8 +372,8 @@ size_t OutputData<T>::getAxisBinIndex(size_t global_index, size_t i_selected_axi { ASSERT(m_ll_data); size_t remainder(global_index); - for (size_t i = 0; i < m_ll_data->getRank(); ++i) { - size_t i_axis = m_ll_data->getRank() - 1 - i; + for (size_t i = 0; i < m_ll_data->rank(); ++i) { + size_t i_axis = m_ll_data->rank() - 1 - i; size_t result = remainder % m_value_axes[i_axis]->size(); if (i_selected_axis == i_axis) return result; @@ -393,13 +393,13 @@ template <class T> size_t OutputData<T>::toGlobalIndex(const std::vector<unsigned>& axes_indices) const { ASSERT(m_ll_data); - if (axes_indices.size() != m_ll_data->getRank()) + if (axes_indices.size() != m_ll_data->rank()) throw Exceptions::LogicErrorException( "size_t OutputData<T>::toGlobalIndex() -> " "Error! Number of coordinates must match rank of data structure"); size_t result = 0; size_t step_size = 1; - for (size_t i = m_ll_data->getRank(); i > 0; --i) { + for (size_t i = m_ll_data->rank(); i > 0; --i) { if (axes_indices[i - 1] >= m_value_axes[i - 1]->size()) { std::ostringstream message; message << "size_t OutputData<T>::toGlobalIndex() -> Error. Index "; @@ -418,13 +418,13 @@ template <class T> size_t OutputData<T>::findGlobalIndex(const std::vector<double>& coordinates) const { ASSERT(m_ll_data); - if (coordinates.size() != m_ll_data->getRank()) + if (coordinates.size() != m_ll_data->rank()) throw Exceptions::LogicErrorException( "OutputData<T>::findClosestIndex() -> " "Error! Number of coordinates must match rank of data structure"); std::vector<unsigned> axes_indexes; - axes_indexes.resize(m_ll_data->getRank()); - for (size_t i = 0; i < m_ll_data->getRank(); ++i) + axes_indexes.resize(m_ll_data->rank()); + for (size_t i = 0; i < m_ll_data->rank(); ++i) axes_indexes[i] = static_cast<unsigned>(m_value_axes[i]->findClosestIndex(coordinates[i])); return toGlobalIndex(axes_indexes); } @@ -528,9 +528,9 @@ template <class T> bool OutputData<T>::isInitialized() const { if (!m_ll_data) return false; - if (getRank() != m_ll_data->getRank()) + if (rank() != m_ll_data->rank()) return false; - if (!getRank()) + if (!rank()) return false; return true; } @@ -581,9 +581,9 @@ inline bool OutputData<T>::hasSameDimensions(const OutputData<U>& right) const return false; if (!right.isInitialized()) return false; - if (getRank() != right.getRank()) + if (rank() != right.rank()) return false; - for (size_t i_axis = 0; i_axis < getRank(); ++i_axis) + for (size_t i_axis = 0; i_axis < rank(); ++i_axis) if (axis(i_axis).size() != right.axis(i_axis).size()) return false; return true; diff --git a/Device/Detector/DetectorMask.cpp b/Device/Detector/DetectorMask.cpp index aa3644a5cc1212ba77511de146f51f2c40cb0dfe..6841513b130b61799216be1275feda6583568bcd 100644 --- a/Device/Detector/DetectorMask.cpp +++ b/Device/Detector/DetectorMask.cpp @@ -68,7 +68,7 @@ void DetectorMask::initMaskData(const OutputData<double>& data) ASSERT(m_shapes.size() == m_mask_of_shape.size()); m_mask_data.clear(); - for (size_t dim = 0; dim < data.getRank(); ++dim) + for (size_t dim = 0; dim < data.rank(); ++dim) m_mask_data.addAxis(data.axis(dim)); process_masks(); diff --git a/Device/Detector/RegionOfInterest.cpp b/Device/Detector/RegionOfInterest.cpp index bd4241f84741493307b8762df5d7b819861e0f21..3503d1fc47740071678b570bf05c5993882a0887 100644 --- a/Device/Detector/RegionOfInterest.cpp +++ b/Device/Detector/RegionOfInterest.cpp @@ -27,7 +27,7 @@ RegionOfInterest::RegionOfInterest(const OutputData<double>& data, double xlow, double xup, double yup) : RegionOfInterest(xlow, ylow, xup, yup) { - if (data.getRank() != 2) + if (data.rank() != 2) throw Exceptions::RuntimeErrorException("RegionOfInterest::RegionOfInterest() -> Error. " "Data is not two-dimensional."); diff --git a/Device/Histo/Histogram1D.h b/Device/Histo/Histogram1D.h index 229508b5c2c6319eee491aa13c09334c7adb8a97..ee5a83029cd463b728de0d8e8636a99f5607305d 100644 --- a/Device/Histo/Histogram1D.h +++ b/Device/Histo/Histogram1D.h @@ -45,7 +45,7 @@ public: Histogram1D* clone() const; //! Returns the number of histogram dimensions - size_t getRank() const { return 1; } + size_t rank() const { return 1; } //! Increment bin with abscissa x with a weight. int fill(double x, double weight = 1.0); diff --git a/Device/Histo/Histogram2D.h b/Device/Histo/Histogram2D.h index f3db774f0259c8e87080fb609071883911484b78..2ca08ab08f9f2cfbd96b4c979a27634e467bd3f4 100644 --- a/Device/Histo/Histogram2D.h +++ b/Device/Histo/Histogram2D.h @@ -56,7 +56,7 @@ public: Histogram2D* clone() const; //! Returns the number of histogram dimensions - size_t getRank() const { return 2; } + size_t rank() const { return 2; } //! Increment bin with abscissa x and ordinate y with a weight. int fill(double x, double y, double weight = 1.0); diff --git a/Device/Histo/IHistogram.cpp b/Device/Histo/IHistogram.cpp index c8509382a7df1ad6645c6ca757d0b1ff0253f01e..b4083b18885a77586b06d47c12cff01ad86e0f30 100644 --- a/Device/Histo/IHistogram.cpp +++ b/Device/Histo/IHistogram.cpp @@ -87,7 +87,7 @@ size_t IHistogram::getGlobalBin(size_t binx, size_t biny) const { std::vector<unsigned> axes_indices; axes_indices.push_back(static_cast<unsigned>(binx)); - if (getRank() == 2) + if (rank() == 2) axes_indices.push_back(static_cast<unsigned>(biny)); return m_data.toGlobalIndex(axes_indices); } @@ -96,7 +96,7 @@ size_t IHistogram::findGlobalBin(double x, double y) const { std::vector<double> coordinates; coordinates.push_back(x); - if (getRank() == 2) + if (rank() == 2) coordinates.push_back(y); return m_data.findGlobalIndex(coordinates); } @@ -242,14 +242,14 @@ void IHistogram::reset() IHistogram* IHistogram::createHistogram(const OutputData<double>& source) { - if (source.getRank() == 1) { + if (source.rank() == 1) { return new Histogram1D(source); - } else if (source.getRank() == 2) { + } else if (source.rank() == 2) { return new Histogram2D(source); } else { std::ostringstream message; message << "IHistogram::createHistogram(const OutputData<double>& source) -> Error. "; - message << "The rank of source " << source.getRank() << " "; + message << "The rank of source " << source.rank() << " "; message << "is not suitable for creation neither 1-dim nor 2-dim histograms."; throw Exceptions::LogicErrorException(message.str()); } @@ -267,31 +267,31 @@ IHistogram* IHistogram::createFrom(const std::vector<std::vector<double>>& data) void IHistogram::check_x_axis() const { - if (getRank() < 1) { + if (rank() < 1) { std::ostringstream message; message << "IHistogram::check_x_axis() -> Error. X-xis does not exist. "; - message << "Rank of histogram " << getRank() << "." << std::endl; + message << "Rank of histogram " << rank() << "." << std::endl; throw Exceptions::LogicErrorException(message.str()); } } void IHistogram::check_y_axis() const { - if (getRank() < 2) { + if (rank() < 2) { std::ostringstream message; message << "IHistogram::check_y_axis() -> Error. Y-axis does not exist. "; - message << "Rank of histogram " << getRank() << "." << std::endl; + message << "Rank of histogram " << rank() << "." << std::endl; throw Exceptions::LogicErrorException(message.str()); } } void IHistogram::init_from_data(const OutputData<double>& source) { - if (getRank() != source.getRank()) { + if (rank() != source.rank()) { std::ostringstream message; message << "IHistogram::IHistogram(const OutputData<double>& data) -> Error. "; - message << "The dimension of this histogram " << getRank() << " "; - message << "is differ from the dimension of source " << m_data.getRank() << std::endl; + message << "The dimension of this histogram " << rank() << " "; + message << "is differ from the dimension of source " << m_data.rank() << std::endl; throw Exceptions::LogicErrorException(message.str()); } diff --git a/Device/Histo/IHistogram.h b/Device/Histo/IHistogram.h index 7d87c6109b2f2d9305e6e8f0a4dc8698a2db4607..c31589a9d103c9766c0228b69ec79a80a20cad37 100644 --- a/Device/Histo/IHistogram.h +++ b/Device/Histo/IHistogram.h @@ -38,7 +38,7 @@ public: virtual IHistogram* clone() const = 0; //! Returns number of histogram dimensions. - virtual size_t getRank() const = 0; + virtual size_t rank() const = 0; //! Returns total number of histogram bins. For 2D histograms the result will be the product //! of bin numbers along X and Y axes. diff --git a/Device/Histo/SimulationResult.cpp b/Device/Histo/SimulationResult.cpp index 0a2fc836d4bf4e5ad88457dd203e4a8aecb443a6..f14b7cf82916bd42ea95587e819e825be97ddaca 100644 --- a/Device/Histo/SimulationResult.cpp +++ b/Device/Histo/SimulationResult.cpp @@ -64,7 +64,7 @@ std::unique_ptr<OutputData<double>> SimulationResult::data(Axes::Units units) co Histogram2D* SimulationResult::histogram2d(Axes::Units units) const { - if (m_data->getRank() != 2 || m_unit_converter->dimension() != 2) + if (m_data->rank() != 2 || m_unit_converter->dimension() != 2) throw std::runtime_error("Error in SimulationResult::histogram2d: " "dimension of data is not 2. Please use axis(), array() and " "data() functions for 1D data."); @@ -146,7 +146,7 @@ std::vector<double> SimulationResult::axis(size_t i_axis, Axes::Units units) con void SimulationResult::checkDimensions() const { - if (m_data->getRank() != m_unit_converter->dimension()) + if (m_data->rank() != m_unit_converter->dimension()) throw std::runtime_error("Error in SimulationResults::checkDimensions(): " "dimensions of data and unit converter don't match"); } diff --git a/Device/InputOutput/OutputDataWriteStrategy.cpp b/Device/InputOutput/OutputDataWriteStrategy.cpp index 4820f77f4cd9d0643ae0604ecaf776f6af072dce..2cca13d9b31e7a05eed9f9b0df503dac345bd055 100644 --- a/Device/InputOutput/OutputDataWriteStrategy.cpp +++ b/Device/InputOutput/OutputDataWriteStrategy.cpp @@ -91,7 +91,7 @@ void OutputDataWriteINTStrategy::writeOutputData(const OutputData<double>& data, { output_stream << "# BornAgain Intensity Data\n\n"; - for (size_t i = 0; i < data.getRank(); ++i) { + for (size_t i = 0; i < data.rank(); ++i) { std::string axis_name = std::string("axis") + std::to_string(i); std::unique_ptr<IAxis> P_axis(data.axis(i).clone()); P_axis->setName(axis_name); @@ -99,7 +99,7 @@ void OutputDataWriteINTStrategy::writeOutputData(const OutputData<double>& data, output_stream << "# axis-" << i << "\n"; output_stream << (*P_axis) << "\n"; } - size_t n_columns = data.axis(data.getRank() - 1).size(); + size_t n_columns = data.axis(data.rank() - 1).size(); output_stream << "\n# data\n"; WriteOutputDataDoubles(data, output_stream, n_columns); @@ -116,7 +116,7 @@ void OutputDataWriteNumpyTXTStrategy::writeOutputData(const OutputData<double>& output_stream << "# BornAgain Intensity Data" << std::endl; output_stream << "# Simple array suitable for numpy, matlab etc." << std::endl; - const size_t dim = data.getRank(); + const size_t dim = data.rank(); switch (dim) { case 1: Write1DRepresentation(data, output_stream); diff --git a/Device/InputOutput/TiffHandler.cpp b/Device/InputOutput/TiffHandler.cpp index d1d96361c811fd05356409c18ab8aa6c39caa3eb..e7d2f1eab860e1563dd10082833a67668a7de022 100644 --- a/Device/InputOutput/TiffHandler.cpp +++ b/Device/InputOutput/TiffHandler.cpp @@ -48,7 +48,7 @@ const OutputData<double>* TiffHandler::getOutputData() const void TiffHandler::write(const OutputData<double>& data, std::ostream& output_stream) { m_data.reset(data.clone()); - if (m_data->getRank() != 2) + if (m_data->rank() != 2) throw Exceptions::LogicErrorException("TiffHandler::write -> Error. " "Only 2-dim arrays supported"); m_tiff = TIFFStreamOpen("MemTIFF", &output_stream); diff --git a/Device/Instrument/IntensityDataFunctions.cpp b/Device/Instrument/IntensityDataFunctions.cpp index 02474934e0111ba162fd853636a2727e38203109..79192d80037feef59a0bf711339d5ab24c54ff02 100644 --- a/Device/Instrument/IntensityDataFunctions.cpp +++ b/Device/Instrument/IntensityDataFunctions.cpp @@ -101,7 +101,7 @@ IntensityDataFunctions::createRelativeDifferenceData(const OutputData<double>& d std::unique_ptr<OutputData<double>> IntensityDataFunctions::createRearrangedDataSet(const OutputData<double>& data, int n) { - if (data.getRank() != 2) + if (data.rank() != 2) throw Exceptions::LogicErrorException("IntensityDataFunctions::rotateDataByN90Deg()" " -> Error! Works only on two-dimensional data"); n = (4 + n % 4) % 4; @@ -148,12 +148,12 @@ std::unique_ptr<OutputData<double>> IntensityDataFunctions::createClippedDataSet(const OutputData<double>& origin, double x1, double y1, double x2, double y2) { - if (origin.getRank() != 2) + if (origin.rank() != 2) throw Exceptions::LogicErrorException("IntensityDataFunctions::createClippedData()" " -> Error! Works only on two-dimensional data"); std::unique_ptr<OutputData<double>> result(new OutputData<double>); - for (size_t i_axis = 0; i_axis < origin.getRank(); i_axis++) { + for (size_t i_axis = 0; i_axis < origin.rank(); i_axis++) { const IAxis& axis = origin.axis(i_axis); IAxis* new_axis; if (i_axis == 0) @@ -229,7 +229,7 @@ void IntensityDataFunctions::coordinateFromBinf(double& x, double& y, std::vector<std::vector<double>> IntensityDataFunctions::create2DArrayfromOutputData(const OutputData<double>& data) { - if (data.getRank() != 2) + if (data.rank() != 2) throw Exceptions::LogicErrorException( "IntensityDataFunctions::create2DArrayfromOutputData() -> " "Error! Works only on two-dimensional data"); diff --git a/Device/Intensity/ArrayUtils.h b/Device/Intensity/ArrayUtils.h index 5822aa67fa9e76cf3baf5acbf7e0dc2905adc66a..b0d77bd8e97083ca628007cc034279f6aef14992 100644 --- a/Device/Intensity/ArrayUtils.h +++ b/Device/Intensity/ArrayUtils.h @@ -135,7 +135,7 @@ template <class T> std::pair<size_t, size_t> ArrayUtils::getShape(const T& data) template <class T> decltype(auto) ArrayUtils::createVector1D(const T& data) { - if (data.getRank() != 1) + if (data.rank() != 1) throw std::runtime_error("ArrayUtils::createVector1D() -> Error. Not 1D data."); using value_type = typename T::value_type; diff --git a/Device/Resolution/ConvolutionDetectorResolution.cpp b/Device/Resolution/ConvolutionDetectorResolution.cpp index 5d240d029ded4429acee243a0be1a5ea6d3b6e92..cfa51c3543f75b5483d38f8cf29539932e4c894a 100644 --- a/Device/Resolution/ConvolutionDetectorResolution.cpp +++ b/Device/Resolution/ConvolutionDetectorResolution.cpp @@ -54,7 +54,7 @@ std::vector<const INode*> ConvolutionDetectorResolution::getChildren() const void ConvolutionDetectorResolution::applyDetectorResolution( OutputData<double>* p_intensity_map) const { - if (p_intensity_map->getRank() != m_dimension) { + if (p_intensity_map->rank() != m_dimension) { throw Exceptions::RuntimeErrorException( "ConvolutionDetectorResolution::applyDetectorResolution() -> Error! " "Intensity map must have same dimension as detector resolution function."); @@ -85,7 +85,7 @@ void ConvolutionDetectorResolution::apply1dConvolution(OutputData<double>* p_int throw Exceptions::LogicErrorException( "ConvolutionDetectorResolution::apply1dConvolution() -> Error! " "No 1d resolution function present for convolution of 1d data."); - if (p_intensity_map->getRank() != 1) + if (p_intensity_map->rank() != 1) throw Exceptions::LogicErrorException( "ConvolutionDetectorResolution::apply1dConvolution() -> Error! " "Number of axes for intensity map does not correspond to the dimension of the map."); @@ -121,7 +121,7 @@ void ConvolutionDetectorResolution::apply2dConvolution(OutputData<double>* p_int throw Exceptions::LogicErrorException( "ConvolutionDetectorResolution::apply2dConvolution() -> Error! " "No 2d resolution function present for convolution of 2d data."); - if (p_intensity_map->getRank() != 2) + if (p_intensity_map->rank() != 2) throw Exceptions::LogicErrorException( "ConvolutionDetectorResolution::apply2dConvolution() -> Error! " "Number of axes for intensity map does not correspond to the dimension of the map."); diff --git a/Device/Unit/IUnitConverter.cpp b/Device/Unit/IUnitConverter.cpp index b3dd5928ea37523370529d0faa6652aae0edf64c..f3ff32b48d9e43b660be5c75abfaaab36f1baba1 100644 --- a/Device/Unit/IUnitConverter.cpp +++ b/Device/Unit/IUnitConverter.cpp @@ -35,7 +35,7 @@ std::string IUnitConverter::axisName(size_t i_axis, Axes::Units units_type) cons std::unique_ptr<OutputData<double>> IUnitConverter::createConvertedData(const OutputData<double>& data, Axes::Units units) const { - const size_t dim = data.getRank(); + const size_t dim = data.rank(); std::unique_ptr<OutputData<double>> result(new OutputData<double>); for (size_t i = 0; i < dim; ++i) result->addAxis(*createConvertedAxis(i, units)); diff --git a/Examples/python/utils/plot_intensity_data.py b/Examples/python/utils/plot_intensity_data.py index 65a8376b78678aa6ac60bcf3faf0c5dd6891de3f..077bdbc2c014527463b4760296f77a0089eeadc2 100755 --- a/Examples/python/utils/plot_intensity_data.py +++ b/Examples/python/utils/plot_intensity_data.py @@ -18,9 +18,9 @@ def plot_intensity_data(file_name, intensity_max=None): data = ba.IntensityDataIOFactory.readIntensityData(file_name) if intensity_max is None: intensity_max = data.getMaximum() - if data.getRank() == 1: + if data.rank() == 1: plot_intensity_data_1d(data, intensity_max) - elif data.getRank() == 2: + elif data.rank() == 2: plot_intensity_data_2d(data, intensity_max) else: exit("Error in plot_intensity_data: wrong data rank") diff --git a/Examples/python/utils/plot_intensity_data_diff.py b/Examples/python/utils/plot_intensity_data_diff.py index 2bd7eada7cbc0ce72baa556ea1ae7b583f0910ed..0ed169f832d62a9e343350d8ebb1d62fa037f6d8 100755 --- a/Examples/python/utils/plot_intensity_data_diff.py +++ b/Examples/python/utils/plot_intensity_data_diff.py @@ -17,7 +17,7 @@ def plot_intensity_data_diff(filename1, filename2): / (np.abs(intensity_ref.array()) + np.abs(intensity_other.array())) if data.max() == 0: exit("Both data sets are equal, there is nothing to plot.") - rank = intensity_ref.getRank() + rank = intensity_ref.rank() if rank == 2: pid.plot_raw_data_2d(data, [intensity_ref.getXmin() / ba.deg, intensity_ref.getXmax() / ba.deg, diff --git a/GUI/coregui/Models/IntensityDataItem.cpp b/GUI/coregui/Models/IntensityDataItem.cpp index 7677940b165fc8f55d3548417a53a091a647f39e..e8240d860d9d04f25da00e50fe8ab2fef75a7d04 100644 --- a/GUI/coregui/Models/IntensityDataItem.cpp +++ b/GUI/coregui/Models/IntensityDataItem.cpp @@ -85,7 +85,7 @@ IntensityDataItem::IntensityDataItem() : DataItem("IntensityData") void IntensityDataItem::setOutputData(OutputData<double>* data) { ASSERT(data && "Assertion failed in IntensityDataItem::setOutputData: nullptr data passed"); - if (data->getRank() != 2) + if (data->rank() != 2) throw GUIHelpers::Error( "Error in IntensityDataItem::setOutputData: cannot handle non-2D data"); DataItem::setOutputData(data); diff --git a/GUI/coregui/Models/RealDataItem.cpp b/GUI/coregui/Models/RealDataItem.cpp index dbbb78f00c1aed552e18f2dc0c295a0c0c6d4922..b3e03d80e63a852b40ab4eecac17379dc29e0872 100644 --- a/GUI/coregui/Models/RealDataItem.cpp +++ b/GUI/coregui/Models/RealDataItem.cpp @@ -103,10 +103,10 @@ const DataItem* RealDataItem::nativeData() const void RealDataItem::setOutputData(OutputData<double>* data) { ASSERT(data && "Assertion failed in RealDataItem::setOutputData: passed data is nullptr"); - ASSERT(data->getRank() < 3 && data->getRank() > 0); + ASSERT(data->rank() < 3 && data->rank() > 0); const QString& target_model_type = - data->getRank() == 2 ? "IntensityData" : data->getRank() == 1 ? "SpecularData" : ""; + data->rank() == 2 ? "IntensityData" : data->rank() == 1 ? "SpecularData" : ""; auto data_item = getItem(T_INTENSITY_DATA); if (data_item && data_item->modelType() != target_model_type) throw GUIHelpers::Error("Error in RealDataItem::setOutputData: trying to set data " diff --git a/GUI/coregui/Models/SpecularDataItem.cpp b/GUI/coregui/Models/SpecularDataItem.cpp index 24bea0d67b505de4c096c1d29feb3144345c469b..43ee5883d4eda09ad33d5d6c89d34851bb7e4fd6 100644 --- a/GUI/coregui/Models/SpecularDataItem.cpp +++ b/GUI/coregui/Models/SpecularDataItem.cpp @@ -44,7 +44,7 @@ SpecularDataItem::SpecularDataItem() : DataItem("SpecularData") void SpecularDataItem::setOutputData(OutputData<double>* data) { ASSERT(data && "Assertion failed in SpecularDataItem::setOutputData: nullptr data passed"); - if (data->getRank() != 1) + if (data->rank() != 1) throw GUIHelpers::Error( "Error in SpecularDataItem::setOutputData: cannot handle non-1D data"); DataItem::setOutputData(data); diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp index 85b4b4e76c33a85f225c052184bc866638d8c2e2..ef70e5c50017d2df9c66468d6c88e6bf0773abaf 100644 --- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp +++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp @@ -34,12 +34,12 @@ const QString filter_string_ba = "Intensity File (*.int *.gz *.tif *.tiff *.txt const QString filter_string_ascii = "Intensity File (*.int *.int.gz *.txt *.csv *.dat *.ascii);;" "Ascii column-wise data (*.*)"; -int getRank(const RealDataItem& item) +int rank(const RealDataItem& item) { return static_cast<int>(item.shape().size()); } -int getRank(const InstrumentItem& item) +int rank(const InstrumentItem& item) { return static_cast<int>(item.shape().size()); } @@ -138,13 +138,13 @@ ImportDataInfo ImportDataUtils::getFromImportAssistant(QString& fileName) bool ImportDataUtils::Compatible(const InstrumentItem& instrumentItem, const RealDataItem& realDataItem) { - return getRank(instrumentItem) == getRank(realDataItem); + return rank(instrumentItem) == rank(realDataItem); } std::unique_ptr<OutputData<double>> ImportDataUtils::CreateSimplifiedOutputData(const OutputData<double>& data) { - const size_t data_rank = data.getRank(); + 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"); diff --git a/GUI/coregui/utils/ImportDataInfo.cpp b/GUI/coregui/utils/ImportDataInfo.cpp index ff4c191430d656ed768768df654bcf7a8f1bf57c..a44d6bc101aa046e7dfad25014b8a3c8f05b3979 100644 --- a/GUI/coregui/utils/ImportDataInfo.cpp +++ b/GUI/coregui/utils/ImportDataInfo.cpp @@ -79,7 +79,7 @@ size_t ImportDataInfo::dataRank() const { if (!m_data) return 0; - return m_data->getRank(); + return m_data->rank(); } QString ImportDataInfo::unitsLabel() const @@ -92,7 +92,7 @@ QString ImportDataInfo::axisLabel(size_t axis_index) const if (!m_data) return ""; - const size_t rank = m_data->getRank(); + const size_t rank = m_data->rank(); if (rank == 2) return axis_index == 0 ? "X [nbins]" : "Y [nbins]"; else if (rank == 1) { @@ -109,7 +109,7 @@ void ImportDataInfo::checkValidity() { if (!m_data) return; - auto iter = available_units.find(m_data->getRank()); + auto iter = available_units.find(m_data->rank()); if (iter == available_units.end()) throw GUIHelpers::Error("Error in ImportDataInfo constructor: unsupported data type"); for (auto& value : iter->second) diff --git a/Tests/Functional/Python/PyCore/intensitydata.py b/Tests/Functional/Python/PyCore/intensitydata.py index dd17475dcb3f88aee80ea4cc0dcbba8d6ee86700..7a3b93636437016510e6c3164db2aea1be7487c5 100644 --- a/Tests/Functional/Python/PyCore/intensitydata.py +++ b/Tests/Functional/Python/PyCore/intensitydata.py @@ -13,7 +13,7 @@ class IntensityDataTest(unittest.TestCase): def test_empty_data(self): data = ba.IntensityData() self.assertEqual(1, data.getAllocatedSize()) - self.assertEqual(0, data.getRank()) + self.assertEqual(0, data.rank()) self.assertEqual(0, data.totalSum()) def test_create_1d_output_data_from_numpy(self): @@ -38,7 +38,7 @@ class IntensityDataTest(unittest.TestCase): data = ba.IntensityData() data.addAxis(axis0) self.assertEqual(20, data.getAllocatedSize()) - self.assertEqual(1, data.getRank()) + self.assertEqual(1, data.rank()) self.assertEqual(0, data.totalSum()) def test_create_2d_object(self): @@ -46,7 +46,7 @@ class IntensityDataTest(unittest.TestCase): data.addAxis("axis0", 10, 0.0, 10.0) data.addAxis("axis1", 20, 0.0, 20.0) self.assertEqual(200, data.getAllocatedSize()) - self.assertEqual(2, data.getRank()) + self.assertEqual(2, data.rank()) self.assertEqual(0, data.totalSum()) data.setAllTo(1.0) self.assertEqual(200.0, data.totalSum()) @@ -59,7 +59,7 @@ class IntensityDataTest(unittest.TestCase): simulation.setDetectorParameters(10, -1.0, 1.0, 100, 0.0, 2.0) data = simulation.result().histogram2d() self.assertEqual(1000, data.getTotalNumberOfBins()) - self.assertEqual(2, data.getRank()) + self.assertEqual(2, data.rank()) self.assertEqual(0, data.integral()) self.assertEqual(10, data.xAxis().size()) diff --git a/Tests/Functional/Python/PyCore/intensitydata_io.py b/Tests/Functional/Python/PyCore/intensitydata_io.py index 73585a7440802c9e28f2cc4fb3fd1a38fb7df09b..f764771c8484075f7d83d0eebb197507748dff93 100644 --- a/Tests/Functional/Python/PyCore/intensitydata_io.py +++ b/Tests/Functional/Python/PyCore/intensitydata_io.py @@ -19,9 +19,9 @@ def is_the_same_data(data1, data2): """ if data1.getAllocatedSize() != data2.getAllocatedSize(): return False - if data1.getRank() != data2.getRank(): + if data1.rank() != data2.rank(): return False - for i in range(0, data1.getRank()): + for i in range(0, data1.rank()): if data1.axis(i) != data2.axis(i): return False for i in range(0, data1.getAllocatedSize()): diff --git a/Tests/Functional/Python/PyCore/intensitydata_io_tiff.py b/Tests/Functional/Python/PyCore/intensitydata_io_tiff.py index 41140fc918fabc6c3d18fbf13766492cecf8a966..8ae1ad26bb573b3d8aa2cc250fc558bde0d78fa8 100644 --- a/Tests/Functional/Python/PyCore/intensitydata_io_tiff.py +++ b/Tests/Functional/Python/PyCore/intensitydata_io_tiff.py @@ -20,9 +20,9 @@ def is_the_same_data(data1, data2): """ if data1.getAllocatedSize() != data2.getAllocatedSize(): return False - if data1.getRank() != data2.getRank(): + if data1.rank() != data2.rank(): return False - for i in range(0, data1.getRank()): + for i in range(0, data1.rank()): if data1.axis(i) != data2.axis(i): return False for i in range(0, data1.getAllocatedSize()): diff --git a/Tests/UnitTests/Core/Axes/Histogram1DTest.cpp b/Tests/UnitTests/Core/Axes/Histogram1DTest.cpp index c7429c11346fa1fb71538e35ab6faf6ff982c097..4630d9179ea55180e26967c4d122842d9221acaf 100644 --- a/Tests/UnitTests/Core/Axes/Histogram1DTest.cpp +++ b/Tests/UnitTests/Core/Axes/Histogram1DTest.cpp @@ -10,7 +10,7 @@ TEST_F(Histogram1DTest, FixedBinConstructor) { Histogram1D hist(5, 0.0, 5.0); - EXPECT_EQ(size_t(1), hist.getRank()); + EXPECT_EQ(size_t(1), hist.rank()); EXPECT_EQ(size_t(5), hist.getTotalNumberOfBins()); EXPECT_EQ(0.0, hist.getXmin()); EXPECT_EQ(5.0, hist.getXmax()); @@ -137,7 +137,7 @@ TEST_F(Histogram1DTest, CreateHistogram) } std::unique_ptr<IHistogram> hist(IHistogram::createHistogram(data)); - EXPECT_EQ(size_t(1), hist->getRank()); + EXPECT_EQ(size_t(1), hist->rank()); EXPECT_EQ(data.getAllocatedSize(), hist->getNbinsX()); EXPECT_EQ(data.axis(0).getMin(), hist->getXmin()); EXPECT_EQ(data.axis(0).getMax(), hist->getXmax()); @@ -159,7 +159,7 @@ TEST_F(Histogram1DTest, CreateOutputData) } std::unique_ptr<OutputData<double>> data(hist.createOutputData(IHistogram::DataType::INTEGRAL)); - EXPECT_EQ(size_t(1), data->getRank()); + EXPECT_EQ(size_t(1), data->rank()); EXPECT_EQ(data->getAllocatedSize(), hist.getNbinsX()); EXPECT_EQ(data->axis(0).getMin(), hist.getXmin()); EXPECT_EQ(data->axis(0).getMax(), hist.getXmax()); diff --git a/Tests/UnitTests/Core/Axes/Histogram2DTest.cpp b/Tests/UnitTests/Core/Axes/Histogram2DTest.cpp index 1e8406f40009cc4e1d9a7e847c90dabeae07c827..dddbd4e7332dcd364defa68a101a87b463c22a7a 100644 --- a/Tests/UnitTests/Core/Axes/Histogram2DTest.cpp +++ b/Tests/UnitTests/Core/Axes/Histogram2DTest.cpp @@ -32,7 +32,7 @@ TEST_F(Histogram2DTest, VariableHist) // basic axes check EXPECT_EQ(size_t(12), hist.getTotalNumberOfBins()); - EXPECT_EQ(hist.getRank(), size_t(2)); + EXPECT_EQ(hist.rank(), size_t(2)); EXPECT_EQ(hist.xAxis().size(), size_t(4)); EXPECT_EQ(hist.getXmin(), -1.0); EXPECT_EQ(hist.getXmax(), 2.0); @@ -344,7 +344,7 @@ TEST_F(Histogram2DTest, CreateHistogram) } std::unique_ptr<IHistogram> h2(IHistogram::createHistogram(data)); - EXPECT_EQ(size_t(2), h2->getRank()); + EXPECT_EQ(size_t(2), h2->rank()); EXPECT_EQ(data.getAllocatedSize(), h2->getTotalNumberOfBins()); EXPECT_EQ(data.axis(0).getMin(), h2->getXmin()); EXPECT_EQ(data.axis(0).getMax(), h2->getXmax()); @@ -371,7 +371,7 @@ TEST_F(Histogram2DTest, CreateOutputData) } std::unique_ptr<OutputData<double>> data(h2.createOutputData(IHistogram::DataType::INTEGRAL)); - EXPECT_EQ(size_t(2), data->getRank()); + EXPECT_EQ(size_t(2), data->rank()); EXPECT_EQ(data->getAllocatedSize(), h2.getTotalNumberOfBins()); EXPECT_EQ(data->axis(0).getMin(), h2.getXmin()); EXPECT_EQ(data->axis(0).getMax(), h2.getXmax()); diff --git a/Tests/UnitTests/Core/DataStructure/ArrayUtilsTest.cpp b/Tests/UnitTests/Core/DataStructure/ArrayUtilsTest.cpp index 9460c7b2588fd8ed357bd1303852b28ef1808522..b2ac1bc78fecb065b7613cbb762d91701fafc380 100644 --- a/Tests/UnitTests/Core/DataStructure/ArrayUtilsTest.cpp +++ b/Tests/UnitTests/Core/DataStructure/ArrayUtilsTest.cpp @@ -46,7 +46,7 @@ TEST_F(ArrayUtilsTest, OutputDataFromVector2D) {0.0, 1.0, 2.0, 3.0}, {4.0, 5.0, 6.0, 7.0}, {8.0, 9.0, 10.0, 11.0}}; auto data = ArrayUtils::createData(vec_double); - EXPECT_EQ(data->getRank(), 2u); + EXPECT_EQ(data->rank(), 2u); EXPECT_EQ(data->getAllocatedSize(), 12u); EXPECT_EQ(data->axis(0).size(), 4u); EXPECT_EQ(data->axis(0).getMin(), 0.0); diff --git a/Tests/UnitTests/Core/DataStructure/IOStrategyTest.cpp b/Tests/UnitTests/Core/DataStructure/IOStrategyTest.cpp index f5ecfacbe9473ced627fd551ea9f5be5be112c8a..86fdc752d976ca36ad397c46f8f6c5d1ea42c212 100644 --- a/Tests/UnitTests/Core/DataStructure/IOStrategyTest.cpp +++ b/Tests/UnitTests/Core/DataStructure/IOStrategyTest.cpp @@ -35,7 +35,7 @@ TEST_F(IOStrategyTest, TestINTStrategies) EXPECT_EQ(m_model_data.axis(index).getMax(), result->axis(index).getMax()); }; - EXPECT_EQ(m_model_data.getRank(), result->getRank()); + EXPECT_EQ(m_model_data.rank(), result->rank()); EXPECT_EQ(m_model_data.getAllSizes(), result->getAllSizes()); compare_axis(0); compare_axis(1); @@ -51,7 +51,7 @@ TEST_F(IOStrategyTest, TestNumpyTXTStrategies) OutputDataReadNumpyTXTStrategy read_txt_strategy; auto result = std::unique_ptr<OutputData<double>>(read_txt_strategy.readOutputData(ss)); - EXPECT_EQ(m_model_data.getRank(), result->getRank()); + EXPECT_EQ(m_model_data.rank(), result->rank()); EXPECT_EQ(m_model_data.getAllSizes(), result->getAllSizes()); for (size_t i = 0, size = m_model_data.getAllocatedSize(); i < size; ++i) EXPECT_EQ(m_model_data[i], (*result)[i]); @@ -67,7 +67,7 @@ TEST_F(IOStrategyTest, TestTIFFStrategies) OutputDataReadTiffStrategy read_tiff_strategy; auto result = std::unique_ptr<OutputData<double>>(read_tiff_strategy.readOutputData(ss)); - EXPECT_EQ(m_model_data.getRank(), result->getRank()); + EXPECT_EQ(m_model_data.rank(), result->rank()); EXPECT_EQ(m_model_data.getAllSizes(), result->getAllSizes()); for (size_t i = 0, size = m_model_data.getAllocatedSize(); i < size; ++i) EXPECT_EQ(m_model_data[i], (*result)[i]); diff --git a/Tests/UnitTests/Core/DataStructure/LLDataTest.cpp b/Tests/UnitTests/Core/DataStructure/LLDataTest.cpp index 4220132efb4e462ed9b99051155a66b7e77f0cd0..6b43e7d18fede59f964aa960d0a957f3daffb0c8 100644 --- a/Tests/UnitTests/Core/DataStructure/LLDataTest.cpp +++ b/Tests/UnitTests/Core/DataStructure/LLDataTest.cpp @@ -48,10 +48,10 @@ TEST_F(LLDataTest, TotalSize) TEST_F(LLDataTest, GetRank) { - EXPECT_EQ(0u, int_data_0d->getRank()); - EXPECT_EQ(1u, fl_data_1d->getRank()); - EXPECT_EQ(3u, db_data_3d->getRank()); - EXPECT_EQ(2u, matrix_data_2d->getRank()); + EXPECT_EQ(0u, int_data_0d->rank()); + EXPECT_EQ(1u, fl_data_1d->rank()); + EXPECT_EQ(3u, db_data_3d->rank()); + EXPECT_EQ(2u, matrix_data_2d->rank()); } TEST_F(LLDataTest, SetAll) diff --git a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp index de4b50abab3a16742027d63406f42f1ce0eed067..695fe617fbb2f9e0c75424b851afaf728cfb8559 100644 --- a/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp +++ b/Tests/UnitTests/Core/Fresnel/DepthProbeSimulationTest.cpp @@ -150,7 +150,7 @@ TEST_F(DepthProbeSimulationTest, ResultAquisition) const std::unique_ptr<Histogram2D> depth_map(sim_result.histogram2d()); EXPECT_EQ(10u * 12u, depth_map->getTotalNumberOfBins()); - EXPECT_EQ(2u, depth_map->getRank()); + EXPECT_EQ(2u, depth_map->rank()); EXPECT_EQ(0.0, depth_map->xAxis().getMin()); EXPECT_EQ(2.0, depth_map->xAxis().getMax()); EXPECT_EQ(-30.0, depth_map->yAxis().getMin()); @@ -160,7 +160,7 @@ TEST_F(DepthProbeSimulationTest, ResultAquisition) const auto output = sim_result.data(); EXPECT_EQ(depth_map->getTotalNumberOfBins(), output->getAllocatedSize()); - EXPECT_EQ(depth_map->getRank(), output->getRank()); + EXPECT_EQ(depth_map->rank(), output->rank()); EXPECT_EQ(depth_map->xAxis().getMin(), output->axis(0).getMin()); EXPECT_EQ(depth_map->xAxis().getMax(), output->axis(0).getMax()); diff --git a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp index c2034698cdbc0e10f68c368e13eaca3573f4a40e..0a46296f9da2ba9034c176f2dc291ac6ac9419cf 100644 --- a/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp +++ b/Tests/UnitTests/Core/Fresnel/SpecularSimulationTest.cpp @@ -172,14 +172,14 @@ TEST_F(SpecularSimulationTest, ConstructSimulation) auto data = sim_result.data(); EXPECT_EQ(data->getAllocatedSize(), 10u); EXPECT_EQ(data->totalSum(), 0.0); - EXPECT_EQ(data->getRank(), 1u); + EXPECT_EQ(data->rank(), 1u); sim->runSimulation(); sim_result = sim->result(); data = sim_result.data(); EXPECT_EQ(data->getAllocatedSize(), 10u); - EXPECT_EQ(data->getRank(), 1u); + EXPECT_EQ(data->rank(), 1u); EXPECT_NEAR(0.1 * Units::degree, sim_result.axis(Axes::Units::RADIANS).front(), Units::degree * 1e-11); diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i index 7c2c9645112a9c677e79bc15e30fc2a5b258733e..79c4e6c00f6b8831c2cb6911d744d614519a5f6b 100644 --- a/auto/Wrap/doxygenDevice.i +++ b/auto/Wrap/doxygenDevice.i @@ -628,7 +628,7 @@ Constructor for 1D histograms from basic OutputData object. Returns clone of other histogram. "; -%feature("docstring") Histogram1D::getRank "size_t Histogram1D::getRank() const +%feature("docstring") Histogram1D::rank "size_t Histogram1D::rank() const Returns the number of histogram dimensions. "; @@ -742,7 +742,7 @@ Constructor for 2D histograms from numpy array (thanks to swig) Returns clone of other histogram. "; -%feature("docstring") Histogram2D::getRank "size_t Histogram2D::getRank() const +%feature("docstring") Histogram2D::rank "size_t Histogram2D::rank() const Returns the number of histogram dimensions. "; @@ -1196,7 +1196,7 @@ C++ includes: IHistogram.h %feature("docstring") IHistogram::clone "virtual IHistogram* IHistogram::clone() const =0 "; -%feature("docstring") IHistogram::getRank "virtual size_t IHistogram::getRank() const =0 +%feature("docstring") IHistogram::rank "virtual size_t IHistogram::rank() const =0 Returns number of histogram dimensions. "; @@ -1832,7 +1832,7 @@ C++ includes: LLData.h %feature("docstring") LLData::getTotalSize "size_t LLData< T >::getTotalSize() const "; -%feature("docstring") LLData::getRank "size_t LLData< T >::getRank() const +%feature("docstring") LLData::rank "size_t LLData< T >::rank() const "; %feature("docstring") LLData::getDimensions "const int* LLData< T >::getDimensions() const @@ -1914,7 +1914,7 @@ returns axis with given serial number returns axis with given name "; -%feature("docstring") OutputData::getRank "size_t OutputData< T >::getRank() const +%feature("docstring") OutputData::rank "size_t OutputData< T >::rank() const Returns number of dimensions. "; diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index 7e9007ad4f11d4c05ad8a13bdb58bb514d5ca4d2..919dfda0c95ee819f79e8e06a81af292d568f5eb 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2279,15 +2279,15 @@ class IntensityData(object): """ return _libBornAgainDevice.IntensityData_axis(self, *args) - def getRank(self): + def rank(self): r""" - getRank(IntensityData self) -> size_t - size_t OutputData< T >::getRank() const + rank(IntensityData self) -> size_t + size_t OutputData< T >::rank() const Returns number of dimensions. """ - return _libBornAgainDevice.IntensityData_getRank(self) + return _libBornAgainDevice.IntensityData_rank(self) def getAllocatedSize(self): r""" @@ -5266,15 +5266,15 @@ class IHistogram(object): """ return _libBornAgainDevice.IHistogram_clone(self) - def getRank(self): + def rank(self): r""" - getRank(IHistogram self) -> size_t - virtual size_t IHistogram::getRank() const =0 + rank(IHistogram self) -> size_t + virtual size_t IHistogram::rank() const =0 Returns number of histogram dimensions. """ - return _libBornAgainDevice.IHistogram_getRank(self) + return _libBornAgainDevice.IHistogram_rank(self) def getTotalNumberOfBins(self): r""" @@ -5724,15 +5724,15 @@ class Histogram1D(IHistogram): """ return _libBornAgainDevice.Histogram1D_clone(self) - def getRank(self): + def rank(self): r""" - getRank(Histogram1D self) -> size_t - size_t Histogram1D::getRank() const + rank(Histogram1D self) -> size_t + size_t Histogram1D::rank() const Returns the number of histogram dimensions. """ - return _libBornAgainDevice.Histogram1D_getRank(self) + return _libBornAgainDevice.Histogram1D_rank(self) def fill(self, x, weight=1.0): r""" @@ -5849,15 +5849,15 @@ class Histogram2D(IHistogram): """ return _libBornAgainDevice.Histogram2D_clone(self) - def getRank(self): + def rank(self): r""" - getRank(Histogram2D self) -> size_t - size_t Histogram2D::getRank() const + rank(Histogram2D self) -> size_t + size_t Histogram2D::rank() const Returns the number of histogram dimensions. """ - return _libBornAgainDevice.Histogram2D_getRank(self) + return _libBornAgainDevice.Histogram2D_rank(self) def fill(self, x, y, weight=1.0): r""" diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index a5fd64c7ba0ea4a65e88f12e2a2cef3961cf2a3f..e6ce71b12e2ea583ac31bb1f56d3a17962df65af 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -29257,7 +29257,7 @@ fail: } -SWIGINTERN PyObject *_wrap_IntensityData_getRank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IntensityData_rank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; OutputData< double > *arg1 = (OutputData< double > *) 0 ; void *argp1 = 0 ; @@ -29269,10 +29269,10 @@ SWIGINTERN PyObject *_wrap_IntensityData_getRank(PyObject *SWIGUNUSEDPARM(self), swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_OutputDataT_double_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntensityData_getRank" "', argument " "1"" of type '" "OutputData< double > const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntensityData_rank" "', argument " "1"" of type '" "OutputData< double > const *""'"); } arg1 = reinterpret_cast< OutputData< double > * >(argp1); - result = ((OutputData< double > const *)arg1)->getRank(); + result = ((OutputData< double > const *)arg1)->rank(); resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: @@ -40926,7 +40926,7 @@ fail: } -SWIGINTERN PyObject *_wrap_IHistogram_getRank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_IHistogram_rank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; IHistogram *arg1 = (IHistogram *) 0 ; void *argp1 = 0 ; @@ -40938,10 +40938,10 @@ SWIGINTERN PyObject *_wrap_IHistogram_getRank(PyObject *SWIGUNUSEDPARM(self), Py swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IHistogram, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IHistogram_getRank" "', argument " "1"" of type '" "IHistogram const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IHistogram_rank" "', argument " "1"" of type '" "IHistogram const *""'"); } arg1 = reinterpret_cast< IHistogram * >(argp1); - result = ((IHistogram const *)arg1)->getRank(); + result = ((IHistogram const *)arg1)->rank(); resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: @@ -43051,7 +43051,7 @@ fail: } -SWIGINTERN PyObject *_wrap_Histogram1D_getRank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Histogram1D_rank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Histogram1D *arg1 = (Histogram1D *) 0 ; void *argp1 = 0 ; @@ -43063,10 +43063,10 @@ SWIGINTERN PyObject *_wrap_Histogram1D_getRank(PyObject *SWIGUNUSEDPARM(self), P swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Histogram1D, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Histogram1D_getRank" "', argument " "1"" of type '" "Histogram1D const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Histogram1D_rank" "', argument " "1"" of type '" "Histogram1D const *""'"); } arg1 = reinterpret_cast< Histogram1D * >(argp1); - result = ((Histogram1D const *)arg1)->getRank(); + result = ((Histogram1D const *)arg1)->rank(); resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: @@ -43741,7 +43741,7 @@ fail: } -SWIGINTERN PyObject *_wrap_Histogram2D_getRank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_Histogram2D_rank(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Histogram2D *arg1 = (Histogram2D *) 0 ; void *argp1 = 0 ; @@ -43753,10 +43753,10 @@ SWIGINTERN PyObject *_wrap_Histogram2D_getRank(PyObject *SWIGUNUSEDPARM(self), P swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Histogram2D, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Histogram2D_getRank" "', argument " "1"" of type '" "Histogram2D const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Histogram2D_rank" "', argument " "1"" of type '" "Histogram2D const *""'"); } arg1 = reinterpret_cast< Histogram2D * >(argp1); - result = ((Histogram2D const *)arg1)->getRank(); + result = ((Histogram2D const *)arg1)->rank(); resultobj = SWIG_From_size_t(static_cast< size_t >(result)); return resultobj; fail: @@ -46450,9 +46450,9 @@ static PyMethodDef SwigMethods[] = { "returns axis with given name \n" "\n" ""}, - { "IntensityData_getRank", _wrap_IntensityData_getRank, METH_O, "\n" - "IntensityData_getRank(IntensityData self) -> size_t\n" - "size_t OutputData< T >::getRank() const\n" + { "IntensityData_rank", _wrap_IntensityData_rank, METH_O, "\n" + "IntensityData_rank(IntensityData self) -> size_t\n" + "size_t OutputData< T >::rank() const\n" "\n" "Returns number of dimensions. \n" "\n" @@ -48193,9 +48193,9 @@ static PyMethodDef SwigMethods[] = { "virtual IHistogram* IHistogram::clone() const =0\n" "\n" ""}, - { "IHistogram_getRank", _wrap_IHistogram_getRank, METH_O, "\n" - "IHistogram_getRank(IHistogram self) -> size_t\n" - "virtual size_t IHistogram::getRank() const =0\n" + { "IHistogram_rank", _wrap_IHistogram_rank, METH_O, "\n" + "IHistogram_rank(IHistogram self) -> size_t\n" + "virtual size_t IHistogram::rank() const =0\n" "\n" "Returns number of histogram dimensions. \n" "\n" @@ -48489,9 +48489,9 @@ static PyMethodDef SwigMethods[] = { "Returns clone of other histogram. \n" "\n" ""}, - { "Histogram1D_getRank", _wrap_Histogram1D_getRank, METH_O, "\n" - "Histogram1D_getRank(Histogram1D self) -> size_t\n" - "size_t Histogram1D::getRank() const\n" + { "Histogram1D_rank", _wrap_Histogram1D_rank, METH_O, "\n" + "Histogram1D_rank(Histogram1D self) -> size_t\n" + "size_t Histogram1D::rank() const\n" "\n" "Returns the number of histogram dimensions. \n" "\n" @@ -48567,9 +48567,9 @@ static PyMethodDef SwigMethods[] = { "Returns clone of other histogram. \n" "\n" ""}, - { "Histogram2D_getRank", _wrap_Histogram2D_getRank, METH_O, "\n" - "Histogram2D_getRank(Histogram2D self) -> size_t\n" - "size_t Histogram2D::getRank() const\n" + { "Histogram2D_rank", _wrap_Histogram2D_rank, METH_O, "\n" + "Histogram2D_rank(Histogram2D self) -> size_t\n" + "size_t Histogram2D::rank() const\n" "\n" "Returns the number of histogram dimensions. \n" "\n"