From b6678a60ccb864e0d5f4c741d83209d21267297e Mon Sep 17 00:00:00 2001 From: Dawn Date: Tue, 28 Jul 2026 11:54:12 +0200 Subject: [PATCH 1/4] drop indexing score --- src/aarecommon/math/find_xtal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aarecommon/math/find_xtal.py b/src/aarecommon/math/find_xtal.py index 3c76e5d..efbf5db 100644 --- a/src/aarecommon/math/find_xtal.py +++ b/src/aarecommon/math/find_xtal.py @@ -345,7 +345,7 @@ def has_sufficient_low_res_spots(result_array: np.ndarray, min_spots_low_res: fl def compute_crystal_score_array( - scan_results: List, w_bkg: float = 0.25, w_low_res: float = 0.55, w_indexed: float = 0.20 + scan_results: List, w_bkg: float = 0.25, w_low_res: float = 0.75, w_indexed: float = 0.00 ) -> np.ndarray: """Combine bkg (25%), spots_low_res (55%), and spots_indexed (20%) into a 0–100 score. -- 2.54.0 From 356ce070a815470c930936ff870176169f3fd429 Mon Sep 17 00:00:00 2001 From: duan_j Date: Tue, 28 Jul 2026 11:57:11 +0200 Subject: [PATCH 2/4] Update src/aarecommon/math/find_xtal.py also update the comments --- src/aarecommon/math/find_xtal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aarecommon/math/find_xtal.py b/src/aarecommon/math/find_xtal.py index efbf5db..014cb52 100644 --- a/src/aarecommon/math/find_xtal.py +++ b/src/aarecommon/math/find_xtal.py @@ -347,7 +347,7 @@ def has_sufficient_low_res_spots(result_array: np.ndarray, min_spots_low_res: fl def compute_crystal_score_array( scan_results: List, w_bkg: float = 0.25, w_low_res: float = 0.75, w_indexed: float = 0.00 ) -> np.ndarray: - """Combine bkg (25%), spots_low_res (55%), and spots_indexed (20%) into a 0–100 score. + """Combine bkg (25%), spots_low_res (75%), and spots_indexed (00%) into a 0–100 score. Each field is min-max normalised to [0, 100] within the grid before weighting, so the final score is the probability (0–100) that a pixel belongs to a crystal. -- 2.54.0 From aabc5300ecd1956f7373c798b6e193139357f09c Mon Sep 17 00:00:00 2001 From: Dawn Date: Tue, 28 Jul 2026 12:05:24 +0200 Subject: [PATCH 3/4] update test_find_xtal too after dropping indexed spots --- tests/test_find_xtal.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_find_xtal.py b/tests/test_find_xtal.py index 02f3a56..874911d 100644 --- a/tests/test_find_xtal.py +++ b/tests/test_find_xtal.py @@ -145,8 +145,8 @@ def test_compute_crystal_score_array(mock_score_results): def test_compute_crystal_score_array_weights(): - # Cell A is the sole max in spots_low_res (weight 0.55); cell B is the sole - # max in spots_indexed (weight 0.20). A must outscore B. + # Cell A is the sole max in spots_low_res (weight 0.75); cell B is the sole + # max in spots_indexed (weight 0.00). A must outscore B. def _cell(nx, n, low, idx): r = MagicMock() r.nx, r.ny, r.number = nx, 0, n @@ -155,8 +155,8 @@ def test_compute_crystal_score_array_weights(): score = compute_crystal_score_array([_cell(0, 0, 10.0, 0.0), _cell(1, 1, 0.0, 10.0)]) assert score[0, 0] > score[1, 0] - assert score[0, 0] == pytest.approx(55.0) - assert score[1, 0] == pytest.approx(20.0) + assert score[0, 0] == pytest.approx(75.0) + assert score[1, 0] == pytest.approx(00.0) def test_raster_highest_score(mock_score_results): -- 2.54.0 From ddab5eb854acc559582c704de8c14d74cdd37b15 Mon Sep 17 00:00:00 2001 From: Dawn Date: Tue, 28 Jul 2026 12:06:26 +0200 Subject: [PATCH 4/4] add local dev dependency for running pytest --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 0fb9373..1cf8500 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,3 +58,9 @@ line-length = 100 [tool.ruff.format] skip-magic-trailing-comma = true + +[dependency-groups] +dev = [ + "pytest>=9.1.1", + "pytest-asyncio>=1.4.0", +] -- 2.54.0