mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-07-04 08:44:48 +02:00
added empty() to ClusterVector and fixed docs (#209)
- added ClusterVector::empty() to check if the vector is empty - Fixed generation of missing docs for ClusterVector
This commit is contained in:
@ -6,6 +6,7 @@
|
|||||||
Features:
|
Features:
|
||||||
|
|
||||||
- Cluster finder now works with 5x5, 7x7 and 9x9 clusters
|
- Cluster finder now works with 5x5, 7x7 and 9x9 clusters
|
||||||
|
- Added ClusterVector::empty() member
|
||||||
|
|
||||||
|
|
||||||
### 2025.05.22
|
### 2025.05.22
|
||||||
@ -17,6 +18,7 @@ Features:
|
|||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
||||||
- Fixed crash when opening raw files with large number of data files
|
- Fixed crash when opening raw files with large number of data files
|
||||||
|
- Fixed reading RawFiles with ROI fully excluding some sub files.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,12 +45,3 @@ add_custom_target(
|
|||||||
COMMENT "Generating documentation with Sphinx"
|
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"
|
|
||||||
)
|
|
@ -886,7 +886,7 @@ EXCLUDE_SYMLINKS = NO
|
|||||||
# Note that the wildcards are matched against the file with absolute path, so to
|
# 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 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
|
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||||
|
@ -4,3 +4,12 @@ ClusterVector
|
|||||||
.. doxygenclass:: aare::ClusterVector
|
.. doxygenclass:: aare::ClusterVector
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
|
:private-members:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.. doxygenclass:: aare::ClusterVector< Cluster< T, ClusterSizeX, ClusterSizeY, CoordType > >
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:private-members:
|
||||||
|
|
@ -37,7 +37,7 @@ unfamiliar steps.
|
|||||||
|
|
||||||
|
|
||||||
Checklists for deployment
|
Checklists for deployment
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
**Feature:**
|
**Feature:**
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
namespace aare {
|
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
|
int32_t frame_number
|
||||||
uint32_t number_of_clusters
|
uint32_t number_of_clusters
|
||||||
int16_t x, int16_t y, int32_t data[9] x number_of_clusters
|
int16_t x, int16_t y, int32_t data[9] x number_of_clusters
|
||||||
|
@ -32,7 +32,8 @@ class ClusterVector; // Forward declaration
|
|||||||
*/
|
*/
|
||||||
template <typename T, uint8_t ClusterSizeX, uint8_t ClusterSizeY,
|
template <typename T, uint8_t ClusterSizeX, uint8_t ClusterSizeY,
|
||||||
typename CoordType>
|
typename CoordType>
|
||||||
class ClusterVector<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> {
|
class ClusterVector<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>>
|
||||||
|
{
|
||||||
|
|
||||||
std::vector<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> m_data{};
|
std::vector<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> m_data{};
|
||||||
int32_t m_frame_number{0}; // TODO! Check frame number size and type
|
int32_t m_frame_number{0}; // TODO! Check frame number size and type
|
||||||
@ -122,6 +123,11 @@ class ClusterVector<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> {
|
|||||||
*/
|
*/
|
||||||
size_t size() const { return m_data.size(); }
|
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_x() const { return ClusterSizeX; }
|
||||||
|
|
||||||
uint8_t cluster_size_y() const { return ClusterSizeY; }
|
uint8_t cluster_size_y() const { return ClusterSizeY; }
|
||||||
|
@ -7,9 +7,21 @@
|
|||||||
|
|
||||||
using aare::Cluster;
|
using aare::Cluster;
|
||||||
using aare::ClusterVector;
|
using aare::ClusterVector;
|
||||||
|
using C1 = Cluster<int32_t, 2, 2>;
|
||||||
|
|
||||||
|
|
||||||
|
TEST_CASE("A newly created ClusterVector is empty") {
|
||||||
|
ClusterVector<C1> cv(4);
|
||||||
|
REQUIRE(cv.empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("After pushing back one element the ClusterVector is not empty") {
|
||||||
|
ClusterVector<C1> cv(4);
|
||||||
|
cv.push_back(C1{1, 2, {3, 4}});
|
||||||
|
REQUIRE(!cv.empty());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("item_size return the size of the cluster stored") {
|
TEST_CASE("item_size return the size of the cluster stored") {
|
||||||
using C1 = Cluster<int32_t, 2, 2>;
|
|
||||||
ClusterVector<C1> cv(4);
|
ClusterVector<C1> cv(4);
|
||||||
CHECK(cv.item_size() == sizeof(C1));
|
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));
|
CHECK(cv7.item_size() == sizeof(C7));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("ClusterVector 2x2 int32_t capacity 4, push back then read",
|
TEST_CASE("ClusterVector 2x2 int32_t capacity 4, push back then read") {
|
||||||
"[.ClusterVector]") {
|
|
||||||
|
|
||||||
ClusterVector<Cluster<int32_t, 2, 2>> cv(4);
|
ClusterVector<Cluster<int32_t, 2, 2>> cv(4);
|
||||||
REQUIRE(cv.capacity() == 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<Cluster<int32_t, 3, 1>> cv(2);
|
ClusterVector<Cluster<int32_t, 3, 1>> cv(2);
|
||||||
REQUIRE(cv.capacity() == 2);
|
REQUIRE(cv.capacity() == 2);
|
||||||
REQUIRE(cv.size() == 0);
|
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<Cluster<float, 2, 4>> cv(10);
|
ClusterVector<Cluster<float, 2, 4>> cv(10);
|
||||||
REQUIRE(cv.capacity() == 10);
|
REQUIRE(cv.capacity() == 10);
|
||||||
REQUIRE(cv.size() == 0);
|
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<Cluster<int32_t, 2, 2>> cv(2);
|
ClusterVector<Cluster<int32_t, 2, 2>> cv(2);
|
||||||
auto initial_data = cv.data();
|
auto initial_data = cv.data();
|
||||||
@ -162,8 +173,7 @@ TEST_CASE("Push back more than initial capacity", "[.ClusterVector]") {
|
|||||||
REQUIRE(initial_data != cv.data());
|
REQUIRE(initial_data != cv.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Concatenate two cluster vectors where the first has enough capacity",
|
TEST_CASE("Concatenate two cluster vectors where the first has enough capacity") {
|
||||||
"[.ClusterVector]") {
|
|
||||||
ClusterVector<Cluster<int32_t, 2, 2>> cv1(12);
|
ClusterVector<Cluster<int32_t, 2, 2>> cv1(12);
|
||||||
Cluster<int32_t, 2, 2> c1 = {1, 2, {3, 4, 5, 6}};
|
Cluster<int32_t, 2, 2> c1 = {1, 2, {3, 4, 5, 6}};
|
||||||
cv1.push_back(c1);
|
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);
|
REQUIRE(ptr[3].y == 17);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Concatenate two cluster vectors where we need to allocate",
|
TEST_CASE("Concatenate two cluster vectors where we need to allocate") {
|
||||||
"[.ClusterVector]") {
|
|
||||||
ClusterVector<Cluster<int32_t, 2, 2>> cv1(2);
|
ClusterVector<Cluster<int32_t, 2, 2>> cv1(2);
|
||||||
Cluster<int32_t, 2, 2> c1 = {1, 2, {3, 4, 5, 6}};
|
Cluster<int32_t, 2, 2> c1 = {1, 2, {3, 4, 5, 6}};
|
||||||
cv1.push_back(c1);
|
cv1.push_back(c1);
|
||||||
@ -229,7 +238,7 @@ struct ClusterTestData {
|
|||||||
std::vector<int64_t> index_map_y;
|
std::vector<int64_t> index_map_y;
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_CASE("Gain Map Calculation Index Map", "[.ClusterVector][.gain_map]") {
|
TEST_CASE("Gain Map Calculation Index Map") {
|
||||||
|
|
||||||
auto clustertestdata = GENERATE(
|
auto clustertestdata = GENERATE(
|
||||||
ClusterTestData{3,
|
ClusterTestData{3,
|
||||||
|
Reference in New Issue
Block a user