Skip to content

Commit

Permalink
fix(api): truncate plate reader floating point results to third decim…
Browse files Browse the repository at this point in the history
…al place (#16919)

Covers EXEC-1019
Ensure the plate reader values are truncated to the third decimal place after being read during a protocol.
  • Loading branch information
CaseyBatten authored Nov 20, 2024
1 parent bb0cf23 commit d1d9b87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/src/opentrons/protocol_engine/state/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,10 @@ def convert_absorbance_reader_data_points(
row = chr(ord("A") + i // 12) # Convert index to row (A-H)
col = (i % 12) + 1 # Convert index to column (1-12)
well_key = f"{row}{col}"
well_map[well_key] = value
truncated_value = float(
"{:.5}".format(str(value))
) # Truncate the returned value to the third decimal place
well_map[well_key] = truncated_value
return well_map
else:
raise ValueError(
Expand Down

0 comments on commit d1d9b87

Please sign in to comment.