Skip to content

Commit

Permalink
Volume as process udf to calculate amount (#577)
Browse files Browse the repository at this point in the history
### Added

- The option to calculate the amount with the volume as a process udf in the step
  • Loading branch information
idalindegaard authored Jan 16, 2025
1 parent 7c12a17 commit e6c8813
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cg_lims/EPPs/udf/calculate/calculate_amount_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@options.concentration_udf()
@options.amount_udf_option()
@options.volume_udf()
@options.total_volume_process_udf()
@options.subtract_volume()
@options.preset_volume()
@options.measurement()
Expand All @@ -24,6 +25,7 @@ def calculate_amount_ng(
ctx: click.Context,
amount_udf: str,
volume_udf: str,
total_volume_pudf: str,
concentration_udf: str,
subtract_volume: str,
preset_volume: float,
Expand All @@ -47,9 +49,11 @@ def calculate_amount_ng(
artifacts_with_missing_udf: List = []
for artifact in artifacts:
if preset_volume:
vol = float(preset_volume)
vol: float = float(preset_volume)
elif total_volume_pudf:
vol: float = process.udf.get(total_volume_pudf)
elif volume_udf:
vol = artifact.udf.get(volume_udf)
vol: float = artifact.udf.get(volume_udf)
conc: float = artifact.udf.get(concentration_udf)
if None in [conc, vol]:
missing_udfs_count += 1
Expand Down

0 comments on commit e6c8813

Please sign in to comment.