v1.0.0-rc.146 (#56)
Build Packages / Unit tests (push) Skipped
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m34s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 10m0s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 10m23s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m23s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 11m16s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m49s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m32s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m15s
Build Packages / XDS test (durin plugin) (push) Successful in 7m16s
Build Packages / Generate python client (push) Successful in 16s
Build Packages / build:rpm (rocky9) (push) Successful in 10m12s
Build Packages / Create release (push) Skipped
Build Packages / Build documentation (push) Successful in 47s
Build Packages / DIALS test (push) Successful in 10m18s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 5m46s
Build Packages / build:rpm (rocky8) (push) Successful in 1h41m2s
Build Packages / XDS test (neggia plugin) (push) Successful in 1h59m18s
Build Packages / Unit tests (push) Skipped
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m34s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 10m0s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 10m23s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 10m23s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 11m16s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 11m49s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m32s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m15s
Build Packages / XDS test (durin plugin) (push) Successful in 7m16s
Build Packages / Generate python client (push) Successful in 16s
Build Packages / build:rpm (rocky9) (push) Successful in 10m12s
Build Packages / Create release (push) Skipped
Build Packages / Build documentation (push) Successful in 47s
Build Packages / DIALS test (push) Successful in 10m18s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 5m46s
Build Packages / build:rpm (rocky8) (push) Successful in 1h41m2s
Build Packages / XDS test (neggia plugin) (push) Successful in 1h59m18s
This is an UNSTABLE release. The release has significant modifications for data processing - in case of troubles go back to 1.0.0-rc.144. jfjoch_process: Generate a dedicated file (_process.h5), which can be used as a replacement for the _master.h5 file for a reanalyzed dataset. jfjoch_process: Improve the performance of scaling and merging, implement on the fly scaling. jfjoch_writer: All final data analysis results are repopulated in the _master.h5 file. jfjoch_scale: Dedicated tool for rescaling/merging existing data. jfjoch_viewer: Fix bugs where pixel labels where displayed on a wrong pixel. WARNING! Scaling and merging are experimental at the moment, and may not provide reasonable results for the time being. Reviewed-on: #56
This commit was merged in pull request #56.
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include <catch2/catch_all.hpp>
|
||||
|
||||
#include "../common/UnitCell.h"
|
||||
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
||||
TEST_CASE("UnitCell_is_finite") {
|
||||
UnitCell cell{50, 60, 70, 90, 90, 120};
|
||||
CHECK(cell.is_finite());
|
||||
|
||||
cell.a = std::numeric_limits<float>::quiet_NaN();
|
||||
CHECK_FALSE(cell.is_finite());
|
||||
|
||||
cell = UnitCell{50, 60, 70, 90, 90, 120};
|
||||
cell.beta = std::numeric_limits<float>::infinity();
|
||||
CHECK_FALSE(cell.is_finite());
|
||||
|
||||
cell = UnitCell{50, 60, 70, 90, -std::numeric_limits<float>::infinity(), 120};
|
||||
CHECK_FALSE(cell.is_finite());
|
||||
}
|
||||
|
||||
TEST_CASE("UnitCell_is_close_accepts_cells_within_tolerance") {
|
||||
const UnitCell ref{100, 120, 150, 90, 95, 120};
|
||||
|
||||
CHECK(UnitCell{100, 120, 150, 90, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
|
||||
CHECK(UnitCell{105, 126, 157.5, 95, 100, 125}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK(UnitCell{95, 114, 142.5, 85, 90, 115}.is_close(ref, 0.05f, 5.0f));
|
||||
}
|
||||
|
||||
TEST_CASE("UnitCell_is_close_rejects_length_outliers") {
|
||||
const UnitCell ref{100, 120, 150, 90, 95, 120};
|
||||
|
||||
CHECK_FALSE(UnitCell{105.1f, 120, 150, 90, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 126.1f, 150, 90, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 120, 157.6f, 90, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
|
||||
CHECK_FALSE(UnitCell{94.9f, 120, 150, 90, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 113.9f, 150, 90, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 120, 142.4f, 90, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
}
|
||||
|
||||
TEST_CASE("UnitCell_is_close_rejects_angle_outliers") {
|
||||
const UnitCell ref{100, 120, 150, 90, 95, 120};
|
||||
|
||||
CHECK_FALSE(UnitCell{100, 120, 150, 95.1f, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 120, 150, 90, 100.1f, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 120, 150, 90, 95, 125.1f}.is_close(ref, 0.05f, 5.0f));
|
||||
|
||||
CHECK_FALSE(UnitCell{100, 120, 150, 84.9f, 95, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 120, 150, 90, 89.9f, 120}.is_close(ref, 0.05f, 5.0f));
|
||||
CHECK_FALSE(UnitCell{100, 120, 150, 90, 95, 114.9f}.is_close(ref, 0.05f, 5.0f));
|
||||
}
|
||||
|
||||
TEST_CASE("UnitCell_is_close_rejects_non_finite_cells") {
|
||||
const UnitCell ref{100, 120, 150, 90, 95, 120};
|
||||
|
||||
UnitCell cell{100, 120, 150, 90, 95, 120};
|
||||
cell.a = std::numeric_limits<float>::quiet_NaN();
|
||||
CHECK_FALSE(cell.is_close(ref, 0.05f, 5.0f));
|
||||
|
||||
UnitCell bad_ref{100, 120, 150, 90, 95, 120};
|
||||
bad_ref.gamma = std::numeric_limits<float>::infinity();
|
||||
CHECK_FALSE(ref.is_close(bad_ref, 0.05f, 5.0f));
|
||||
}
|
||||
|
||||
TEST_CASE("UnitCell_MeanUnitCell") {
|
||||
const std::vector<UnitCell> cells{
|
||||
{100, 120, 150, 90, 95, 120},
|
||||
{102, 122, 152, 92, 97, 122},
|
||||
{98, 118, 148, 88, 93, 118}
|
||||
};
|
||||
|
||||
const auto mean = MeanUnitCell(cells);
|
||||
REQUIRE(mean.has_value());
|
||||
|
||||
CHECK(mean->a == Catch::Approx(100));
|
||||
CHECK(mean->b == Catch::Approx(120));
|
||||
CHECK(mean->c == Catch::Approx(150));
|
||||
CHECK(mean->alpha == Catch::Approx(90));
|
||||
CHECK(mean->beta == Catch::Approx(95));
|
||||
CHECK(mean->gamma == Catch::Approx(120));
|
||||
|
||||
CHECK_FALSE(MeanUnitCell({}).has_value());
|
||||
}
|
||||
Reference in New Issue
Block a user