Skip to content

Commit

Permalink
Removed numpy as a dependency with math.lcm from stdlib (#59)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Lanahan <[email protected]>
  • Loading branch information
daidoji authored Apr 1, 2024
1 parent 917dab4 commit 4653c14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
'http_sfv>=0.9.8',
'cryptography>=39.0.2',
'requests>=2.28',
'numpy>=1.26.0',
'pytest>=6.2.5',
'pytest-timeout>=2.3.1'
],
Expand Down
6 changes: 3 additions & 3 deletions src/dkr/core/didding.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from datetime import datetime
import json
import math
import re
import numpy as np

from base64 import urlsafe_b64encode

Expand Down Expand Up @@ -112,7 +112,7 @@ def generateDIDDoc(hby: habbing.Habery, did, aid, oobi=None, metadata=None, reg_
conditionThreshold=conditions
))
elif isinstance(kever.tholder.thold, list):
lcd = int(np.lcm.reduce([fr.denominator for fr in kever.tholder.thold[0]]))
lcd = int(math.lcm(*[fr.denominator for fr in kever.tholder.thold[0]]))
threshold = float(lcd/2)
numerators = [int(fr.numerator * lcd / fr.denominator) for fr in kever.tholder.thold[0]]
conditions = []
Expand Down Expand Up @@ -265,4 +265,4 @@ def addEnds(ends):
)
if v not in sEnds:
sEnds.append(v)
return sEnds
return sEnds

0 comments on commit 4653c14

Please sign in to comment.