From 1a61cb0f42d3606f080333cb023d52ecaf689b3c Mon Sep 17 00:00:00 2001 From: Alison Meynert Date: Tue, 7 Jan 2025 10:00:55 -0800 Subject: [PATCH] feat: added parameter name range for max_mixmatches_in_three_prime_region error message --- prymer/offtarget/offtarget_detector.py | 2 +- tests/offtarget/test_offtarget.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prymer/offtarget/offtarget_detector.py b/prymer/offtarget/offtarget_detector.py index a9d2be3..c9b4932 100644 --- a/prymer/offtarget/offtarget_detector.py +++ b/prymer/offtarget/offtarget_detector.py @@ -257,7 +257,7 @@ def __init__( ): errors.append( "'max_mismatches_in_three_prime_region' must be between 0 and " - f"{three_prime_region_length} inclusive. " + f"'three_prime_region_length'={three_prime_region_length} inclusive. " f"Saw {max_mismatches_in_three_prime_region}" ) if max_mismatches < 0: diff --git a/tests/offtarget/test_offtarget.py b/tests/offtarget/test_offtarget.py index beb8b7e..682b1d6 100644 --- a/tests/offtarget/test_offtarget.py +++ b/tests/offtarget/test_offtarget.py @@ -362,8 +362,8 @@ class CustomPrimer(Oligo): (1, -1, 1, 20, 0, 0, 1, "'max_primer_pair_hits' must be greater than or equal to 0. Saw -1"), # noqa: E501 (1, 1, -1, 20, 0, 0, 1, "'min_primer_pair_hits' must be greater than or equal to 0. Saw -1"), # noqa: E501 (1, 1, 1, 0, 0, 0, 1, "'three_prime_region_length' must be greater than 0. Saw 0"), - (1, 1, 1, 20, -1, 0, 1, "'max_mismatches_in_three_prime_region' must be between 0 and 20 inclusive. Saw -1"), # noqa: E501 - (1, 1, 1, 20, 21, 0, 1, "'max_mismatches_in_three_prime_region' must be between 0 and 20 inclusive. Saw 21"), # noqa: E501 + (1, 1, 1, 20, -1, 0, 1, "'max_mismatches_in_three_prime_region' must be between 0 and 'three_prime_region_length'=20 inclusive. Saw -1"), # noqa: E501 + (1, 1, 1, 20, 21, 0, 1, "'max_mismatches_in_three_prime_region' must be between 0 and 'three_prime_region_length'=20 inclusive. Saw 21"), # noqa: E501 (1, 1, 1, 20, 0, -1, 1, "'max_mismatches' must be greater than or equal to 0. Saw -1"), (1, 1, 1, 20, 0, 0, 0, "'max_amplicon_size' must be greater than 0. Saw 0"), ],