Skip to content

Commit

Permalink
adding worded algorithm for unique_values in test_spec_set_functions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ohrechykha committed Jul 4, 2024
1 parent bb298f0 commit e80438f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_spec_set_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

import ragged

#Specific algorithm for unique_values:
#1 take an input array
#2 flatten input_array unless its 1d
#3 {remember the first element, loop through the rest of the list to see if there are copies
# if yes then discard it and repeat the step
# if not then add it to the output and repeat the step}
#4 once the cycle is over return an array of unique elements in the input array (the output must be of the same type as input array)

def test_existence():
assert ragged.unique_all is not None
Expand Down

0 comments on commit e80438f

Please sign in to comment.