Skip to content

Commit b0119f5

Browse files
committed
docstring note on divmod calculation
1 parent 3f51dd2 commit b0119f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cf/read_write/um/umread.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,11 @@ def __init__(
10431043
# Convert the UM version to a string and provide it as a
10441044
# CF property. E.g. 405 -> '4.5', 606.3 -> '6.6.3', 1002
10451045
# -> '10.2'
1046+
#
1047+
# Note: We don't just do `divmod(self.um_version, 100)`
1048+
# because if self.um_version has a fractional part
1049+
# then it would likely get altered in the divmod
1050+
# calculation.
10461051
a, b = divmod(int(self.um_version), 100)
10471052
fraction = str(self.um_version).split(".")[-1]
10481053
um = f"{a}.{b}"

0 commit comments

Comments
 (0)