Skip to content

Commit

Permalink
chore: remove 3.8 lcm check
Browse files Browse the repository at this point in the history
  • Loading branch information
manmartgarc committed Apr 28, 2024
1 parent 93a0d9c commit e0ef24b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/stochatreat/utils.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
import sys
from collections.abc import Iterable
from fractions import Fraction

LCM_VERSION = 9

if sys.version_info.minor < LCM_VERSION:
from functools import reduce
from math import gcd # type: ignore

def lcm(*args):
"""
Helper function to compute the Lowest Common Multiple of a list of
integers
"""
return reduce(lambda a, b: a * b // gcd(a, b), args)

else:
from math import lcm # type: ignore
from math import lcm


def get_lcm_prob_denominators(probs: Iterable[float]) -> int:
Expand Down

0 comments on commit e0ef24b

Please sign in to comment.