v1.0.0-rc.166 (#76)
Build Packages / Unit tests (push) Successful in 1h22m15s
Build Packages / build:windows:nocuda (push) Successful in 18m0s
Build Packages / build:windows:cuda (push) Successful in 20m30s
Build Packages / build:viewer-tgz:cpu (push) Successful in 10m32s
Build Packages / build:viewer-tgz:cuda (push) Successful in 11m39s
Build Packages / build:rugnux-tgz (x86_64) (push) Successful in 8m55s
Build Packages / build:rugnux:windows (push) Successful in 11m25s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 20m6s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 16m27s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 20m19s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 15m34s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 20m25s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m36s
Build Packages / build:rpm (rocky8) (push) Successful in 17m43s
Build Packages / build:rpm (rocky9) (push) Successful in 13m34s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 21m28s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 18m19s
Build Packages / DIALS test (push) Successful in 12m36s
Build Packages / XDS test (durin plugin) (push) Successful in 6m56s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 6m48s
Build Packages / XDS test (neggia plugin) (push) Successful in 6m7s
Build Packages / Generate python client (push) Successful in 11s
Build Packages / Build documentation (push) Successful in 36s
Build Packages / Create release (push) Skipped
Build Packages / build:rugnux:aarch64 (cross) (push) Successful in 5m11s

* `rugnux --mode calibration` writes `<prefix>.json` beside the `.poni`, whose `dataset_settings` member is a `jfjoch_broker` `dataset_settings` body as it stands.
* `rugnux` and `jfjoch_viewer` read PILATUS miniCBF sweeps natively, without conversion.
* Masters written by other facilities open, including Eiger 1.x and third-party NXmx variants.
* `rugnux` measures the beam centre on every run, and indexes with it when the file's value indexes nothing.
* A detector swung out on a 2theta arm is placed where the file says it stands, and the calibration can hold the tilt fixed.
* `rugnux` writes the unmerged MTZ by default, and a P1 merge beside it, so a wrong space group can be re-merged without reprocessing.
* Significant improvements to symmetry handling in `rugnux`: the lattice, the point group, the setting and the systematic absences.
* The `rugnux` report gives the resolution the CC1/2 fit reached, beside the range the reflections were written to.
* The `rugnux` report gives the twinning statistics measured before the space group was decided, beside the ones measured after.
* The `rugnux` report gives the strong-direction diffraction limit, and warns when CC1/2 is not monotone with resolution.
* `rugnux` ranks screw axes on the evidence their absences carry, rather than on how many control reflections a candidate happens to have.
* Twinning is no longer reported when the L-test contradicts it.
* The `rugnux` report gives the detector tilt, the measured tilt and the direct beam beside the beam centre, and a post-refined beam centre is judged against the run's own measurement rather than the file's.
* `--no-refine-tilt` holds the detector tilt at the value in the file, instead of zeroing it, when the calibration starts from the spots.
* The `jfjoch_viewer` grid scan view draws the cells in the proportion of the scan steps, so the map has the shape of the scanned area.

Reviewed-on: #76
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
This commit was merged in pull request #76.
This commit is contained in:
2026-09-02 21:17:31 +02:00
committed by leonarski_f
parent 511be0c366
commit 680c36c20d
383 changed files with 20910 additions and 3936 deletions
+16 -14
View File
@@ -10,6 +10,8 @@
#include "../image_analysis/scale_merge/RfreeFlags.h"
namespace {
const gemmi::SpaceGroup &SG(int number) { return *gemmi::find_spacegroup_by_number(number); }
MergedReflection Refl(int h, int k, int l, float d) {
MergedReflection r;
r.h = h; r.k = k; r.l = l; r.d = d;
@@ -37,8 +39,8 @@ TEST_CASE("R-free flags are deterministic and hit the requested fraction", "[rfr
auto a = Grid(-15, 15);
auto b = a;
// Floor off (min_free = 0) so this isolates the pure-hash fraction on this modest grid.
AssignRfreeFlags(a, 1, 0.05, /*min_free=*/0);
AssignRfreeFlags(b, 1, 0.05, /*min_free=*/0);
AssignRfreeFlags(a, SG(1), 0.05, /*min_free=*/0);
AssignRfreeFlags(b, SG(1), 0.05, /*min_free=*/0);
REQUIRE(a.size() == b.size());
for (size_t i = 0; i < a.size(); ++i)
CHECK(a[i].rfree_flag == b[i].rfree_flag); // pure function of the reflection
@@ -58,7 +60,7 @@ TEST_CASE("R-free flags never split a Friedel/Bijvoet pair", "[rfree]") {
v.push_back(Refl(h, k, l, d));
v.push_back(Refl(-h, -k, -l, d));
}
AssignRfreeFlags(v, 1, 0.10); // P1 -> only Friedel relates the mates
AssignRfreeFlags(v, SG(1), 0.10); // P1 -> only Friedel relates the mates
std::map<std::tuple<int, int, int>, bool> flag;
for (const auto& r : v) flag[{r.h, r.k, r.l}] = r.rfree_flag;
@@ -80,7 +82,7 @@ TEST_CASE("R-free flags are shared across symmetry equivalents", "[rfree]") {
if (h == 0 && k == 0 && l == 0) continue;
v.push_back(Refl(h, k, l, 60.0f / (1 + h * h + k * k + l * l)));
}
AssignRfreeFlags(v, 75, 0.10); // P4
AssignRfreeFlags(v, SG(75), 0.10); // P4
std::map<std::tuple<int, int, int>, bool> flag;
for (const auto& r : v) flag[{r.h, r.k, r.l}] = r.rfree_flag;
@@ -101,7 +103,7 @@ TEST_CASE("R-free flags spread across resolution", "[rfree]") {
v.push_back(Refl(2, 1 + i, 3, 4.0f)); // mid res
v.push_back(Refl(2, 3, 1 + i, 2.0f)); // high res
}
AssignRfreeFlags(v, 1, 0.10);
AssignRfreeFlags(v, SG(1), 0.10);
int lo = 0, mid = 0, hi = 0;
for (const auto& r : v) {
if (!r.rfree_flag) continue;
@@ -124,8 +126,8 @@ TEST_CASE("R-free flags are identical across datasets of one crystal form", "[rf
narrow.push_back(r);
// Floor off so the two different-sized sets share one effective fraction (the floor is the only
// thing that ties the fraction to the dataset; with it off this is the pure per-hkl guarantee).
AssignRfreeFlags(wide, 96, 0.05, /*min_free=*/0);
AssignRfreeFlags(narrow, 96, 0.05, /*min_free=*/0);
AssignRfreeFlags(wide, SG(96), 0.05, /*min_free=*/0);
AssignRfreeFlags(narrow, SG(96), 0.05, /*min_free=*/0);
std::map<std::tuple<int, int, int>, bool> flag;
for (const auto& r : wide) flag[{r.h, r.k, r.l}] = r.rfree_flag;
@@ -143,13 +145,13 @@ TEST_CASE("ApplyReferenceFreeFlags imports the reference test set", "[rfree]") {
// A reference with its own free set; a dataset that starts from the per-hkl hash must, after the
// import, carry exactly the reference's flags on every reflection they share.
auto reference = Grid(-12, 12);
AssignRfreeFlags(reference, 96, 0.07);
AssignRfreeFlags(reference, SG(96), 0.07);
std::map<std::tuple<int, int, int>, bool> ref_flag;
for (const auto& r : reference) ref_flag[{r.h, r.k, r.l}] = r.rfree_flag;
auto data = Grid(-12, 12);
AssignRfreeFlags(data, 96, 0.30); // deliberately a different fraction/hash split
const size_t matched = ApplyReferenceFreeFlags(data, 96, reference);
AssignRfreeFlags(data, SG(96), 0.30); // deliberately a different fraction/hash split
const size_t matched = ApplyReferenceFreeFlags(data, SG(96), reference);
CHECK(matched == data.size());
for (const auto& r : data)
CHECK(r.rfree_flag == ref_flag[{r.h, r.k, r.l}]);
@@ -166,9 +168,9 @@ TEST_CASE("R-free flags floor the test set size on small data", "[rfree]") {
const double n = static_cast<double>(v.size());
auto plain = v, floored = v, capped = v;
AssignRfreeFlags(plain, 1, 0.05, /*min_free=*/0); // pure 5% ~= 37 free
AssignRfreeFlags(floored, 1, 0.05, /*min_free=*/60); // 60/738 = 8.1% (above 5%, under the 10% cap)
AssignRfreeFlags(capped, 1, 0.05, /*min_free=*/100000); // floor wants ~all; capped near 10%
AssignRfreeFlags(plain, SG(1), 0.05, /*min_free=*/0); // pure 5% ~= 37 free
AssignRfreeFlags(floored, SG(1), 0.05, /*min_free=*/60); // 60/738 = 8.1% (above 5%, under the 10% cap)
AssignRfreeFlags(capped, SG(1), 0.05, /*min_free=*/100000); // floor wants ~all; capped near 10%
CHECK(FreeFraction(floored) > FreeFraction(plain)); // the floor lifted the test set
CHECK(FreeFraction(floored) > 0.06); // ~8%, clearly above the bare 5%
@@ -177,6 +179,6 @@ TEST_CASE("R-free flags floor the test set size on small data", "[rfree]") {
TEST_CASE("R-free fraction of zero flags nothing", "[rfree]") {
auto v = Grid(1, 6);
AssignRfreeFlags(v, 1, 0.0);
AssignRfreeFlags(v, SG(1), 0.0);
for (const auto& r : v) CHECK(!r.rfree_flag);
}