From e40767d32a4deaf649f32781d004ade0f79596ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Sv=C3=A4rd?= <60181709+Karl-Svard@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:31:15 +0200 Subject: [PATCH] Patch aliquot volumes EPP for 0 ul volumes (#551)(patch) ### Fixed - No longer count 0 ul volumes as being too low in the volume aliquot EPP --- cg_lims/EPPs/udf/calculate/aliquot_volume.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cg_lims/EPPs/udf/calculate/aliquot_volume.py b/cg_lims/EPPs/udf/calculate/aliquot_volume.py index 909145d3..5650908a 100644 --- a/cg_lims/EPPs/udf/calculate/aliquot_volume.py +++ b/cg_lims/EPPs/udf/calculate/aliquot_volume.py @@ -57,7 +57,9 @@ def volumes_below_threshold( minimum_volume: float, sample_volume: float, buffer_volume: float ) -> bool: """Check if volume aliquots are below the given threshold.""" - return sample_volume < minimum_volume or buffer_volume < minimum_volume + return (sample_volume < minimum_volume) or ( + buffer_volume != 0 and buffer_volume < minimum_volume + ) def calculate_volumes( @@ -90,7 +92,9 @@ def calculate_volumes( max_volume=max_volume, sample_volume=sample_volume ) if volumes_below_threshold( - minimum_volume=minimum_limit, sample_volume=sample_volume, buffer_volume=buffer_volume + minimum_volume=minimum_limit, + sample_volume=round(sample_volume, 2), + buffer_volume=round(buffer_volume, 2), ): samples_below_threshold.append(get_one_sample_from_artifact(artifact=art).id)