This pull request addresses an issue in redMasking.py where the conversion of awkres to an integer fails if the value is in scientific notation, resulting in a ValueError.
Details
Issue: When awkres is in scientific notation (e.g., '4.31768e+09'), converting it directly to an integer using int() causes a ValueError.
Fix: The conversion logic has been updated to first convert the string to a float and then to an integer. This ensures that values in scientific notation are correctly handled.
Changes Made
Modified the code to convert awkres to a float before converting it to an integer:
try:
pre_mask_size = int(float(awkres)) if awkres else 0
except ValueError as e:
print(f"Error converting awkres to int: {e}")
pre_mask_size = 0
Description
This pull request addresses an issue in
redMasking.py
where the conversion ofawkres
to an integer fails if the value is in scientific notation, resulting in aValueError
.Details
awkres
is in scientific notation (e.g., '4.31768e+09'), converting it directly to an integer usingint()
causes aValueError
.Changes Made
awkres
to a float before converting it to an integer: