Skip to content

Commit

Permalink
remove .rna and .rns system calls
Browse files Browse the repository at this point in the history
  • Loading branch information
briangu committed Dec 21, 2023
1 parent f08334e commit 40dcb87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
4 changes: 2 additions & 2 deletions examples/faiss/1-flat.kg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
:" KlongPy varaint of 1-flat.py "

.pyf("faiss";"IndexFlatL2")
.pyf("numpy";"random");rna::.pya(random;"random")
.pyf("numpy";"random");rns::.pya(random;"seed");rna::.pya(random;"random")

d::64 :" dimension "
nb::100000 :" database size "
nq::10000 :" nb of queries "
.rns(1234) :" make reproducible "
rns(1234) :" make reproducible "

xb::rna(nb,d)
xq::rna(nq,d)
Expand Down
28 changes: 0 additions & 28 deletions klongpy/sys_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,34 +590,6 @@ def eval_sys_random_number():
return np.random.random()


def eval_sys_random_array(x):
"""
.rna(x) [Random-Array]
Return a random array with shape specified by x.
x may be a number (shape of size 1) or a shape array.
"""
if not is_number(x) and not is_list(x):
raise KlongException("array length x must be a number or a shape array")
if is_number(x):
x = np.asarray([x])
return np.random.random(x)


def eval_sys_random_seed(x):
"""
.rns(x) [Random-Seed]
Set the random seed to x.
"""
return np.random.seed(x)


def eval_sys_read(klong):
"""
Expand Down

0 comments on commit 40dcb87

Please sign in to comment.