diff --git a/RELEASE.md b/RELEASE.md index afda148..1bf04d6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -6,6 +6,7 @@ Features: - Cluster finder now works with 5x5, 7x7 and 9x9 clusters +- Added ClusterVector::empty() member ### 2025.05.22 @@ -17,6 +18,7 @@ Features: Bugfixes: - Fixed crash when opening raw files with large number of data files +- Fixed reading RawFiles with ROI fully excluding some sub files. diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index c693f0e..322662c 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -45,12 +45,3 @@ add_custom_target( COMMENT "Generating documentation with Sphinx" ) -add_custom_target( - rst - COMMAND ${SPHINX_EXECUTABLE} -a -b html - -Dbreathe_projects.aare=${CMAKE_CURRENT_BINARY_DIR}/xml - -c "${SPHINX_BUILD}" - ${SPHINX_BUILD}/src - ${SPHINX_BUILD}/html - COMMENT "Generating documentation with Sphinx" -) \ No newline at end of file diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 23dc88a..bc9ebea 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -886,7 +886,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = */docs/* */tests/* */python/* */manual */slsDetectorServers/* */libs/* */integrationTests *README* */slsDetectorGui/* */ctbGui/* */slsDetectorCalibration/* *TobiSchluter* +EXCLUDE_PATTERNS = *build* */docs/* */tests/* *.test.cpp* */python/* */manual */slsDetectorServers/* */libs/* */integrationTests *README* *_deps* *TobiSchluter* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/docs/src/ClusterVector.rst b/docs/src/ClusterVector.rst index bb2a0d8..93d2c7b 100644 --- a/docs/src/ClusterVector.rst +++ b/docs/src/ClusterVector.rst @@ -3,4 +3,13 @@ ClusterVector .. doxygenclass:: aare::ClusterVector :members: - :undoc-members: \ No newline at end of file + :undoc-members: + :private-members: + + + +.. doxygenclass:: aare::ClusterVector< Cluster< T, ClusterSizeX, ClusterSizeY, CoordType > > + :members: + :undoc-members: + :private-members: + \ No newline at end of file diff --git a/docs/src/Workflow.rst b/docs/src/Workflow.rst index 9b41e74..0fb486d 100644 --- a/docs/src/Workflow.rst +++ b/docs/src/Workflow.rst @@ -37,7 +37,7 @@ unfamiliar steps. Checklists for deployment -~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ **Feature:** diff --git a/include/aare/ClusterFile.hpp b/include/aare/ClusterFile.hpp index c0eca33..1f6961a 100644 --- a/include/aare/ClusterFile.hpp +++ b/include/aare/ClusterFile.hpp @@ -14,7 +14,7 @@ namespace aare { /* -Binary cluster file. Expects data to be layed out as: +Binary cluster file. Expects data to be laid out as: int32_t frame_number uint32_t number_of_clusters int16_t x, int16_t y, int32_t data[9] x number_of_clusters diff --git a/include/aare/ClusterVector.hpp b/include/aare/ClusterVector.hpp index 9d575d9..0c81330 100644 --- a/include/aare/ClusterVector.hpp +++ b/include/aare/ClusterVector.hpp @@ -32,7 +32,8 @@ class ClusterVector; // Forward declaration */ template -class ClusterVector> { +class ClusterVector> +{ std::vector> m_data{}; int32_t m_frame_number{0}; // TODO! Check frame number size and type @@ -122,6 +123,11 @@ class ClusterVector> { */ size_t size() const { return m_data.size(); } + /** + * @brief Check if the vector is empty + */ + bool empty() const { return m_data.empty(); } + uint8_t cluster_size_x() const { return ClusterSizeX; } uint8_t cluster_size_y() const { return ClusterSizeY; } diff --git a/src/ClusterVector.test.cpp b/src/ClusterVector.test.cpp index 1214b6b..0ec1c55 100644 --- a/src/ClusterVector.test.cpp +++ b/src/ClusterVector.test.cpp @@ -7,9 +7,21 @@ using aare::Cluster; using aare::ClusterVector; +using C1 = Cluster; + + +TEST_CASE("A newly created ClusterVector is empty") { + ClusterVector cv(4); + REQUIRE(cv.empty()); +} + +TEST_CASE("After pushing back one element the ClusterVector is not empty") { + ClusterVector cv(4); + cv.push_back(C1{1, 2, {3, 4}}); + REQUIRE(!cv.empty()); +} TEST_CASE("item_size return the size of the cluster stored") { - using C1 = Cluster; ClusterVector cv(4); CHECK(cv.item_size() == sizeof(C1)); @@ -43,8 +55,7 @@ TEST_CASE("item_size return the size of the cluster stored") { CHECK(cv7.item_size() == sizeof(C7)); } -TEST_CASE("ClusterVector 2x2 int32_t capacity 4, push back then read", - "[.ClusterVector]") { +TEST_CASE("ClusterVector 2x2 int32_t capacity 4, push back then read") { ClusterVector> cv(4); REQUIRE(cv.capacity() == 4); @@ -70,7 +81,7 @@ TEST_CASE("ClusterVector 2x2 int32_t capacity 4, push back then read", } } -TEST_CASE("Summing 3x1 clusters of int64", "[.ClusterVector]") { +TEST_CASE("Summing 3x1 clusters of int64") { ClusterVector> cv(2); REQUIRE(cv.capacity() == 2); REQUIRE(cv.size() == 0); @@ -102,7 +113,7 @@ TEST_CASE("Summing 3x1 clusters of int64", "[.ClusterVector]") { */ } -TEST_CASE("Storing floats", "[.ClusterVector]") { +TEST_CASE("Storing floats") { ClusterVector> cv(10); REQUIRE(cv.capacity() == 10); REQUIRE(cv.size() == 0); @@ -129,7 +140,7 @@ TEST_CASE("Storing floats", "[.ClusterVector]") { */ } -TEST_CASE("Push back more than initial capacity", "[.ClusterVector]") { +TEST_CASE("Push back more than initial capacity") { ClusterVector> cv(2); auto initial_data = cv.data(); @@ -162,8 +173,7 @@ TEST_CASE("Push back more than initial capacity", "[.ClusterVector]") { REQUIRE(initial_data != cv.data()); } -TEST_CASE("Concatenate two cluster vectors where the first has enough capacity", - "[.ClusterVector]") { +TEST_CASE("Concatenate two cluster vectors where the first has enough capacity") { ClusterVector> cv1(12); Cluster c1 = {1, 2, {3, 4, 5, 6}}; cv1.push_back(c1); @@ -192,8 +202,7 @@ TEST_CASE("Concatenate two cluster vectors where the first has enough capacity", REQUIRE(ptr[3].y == 17); } -TEST_CASE("Concatenate two cluster vectors where we need to allocate", - "[.ClusterVector]") { +TEST_CASE("Concatenate two cluster vectors where we need to allocate") { ClusterVector> cv1(2); Cluster c1 = {1, 2, {3, 4, 5, 6}}; cv1.push_back(c1); @@ -229,7 +238,7 @@ struct ClusterTestData { std::vector index_map_y; }; -TEST_CASE("Gain Map Calculation Index Map", "[.ClusterVector][.gain_map]") { +TEST_CASE("Gain Map Calculation Index Map") { auto clustertestdata = GENERATE( ClusterTestData{3,