You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that there are assert statements that are catched wrongly, if an assert statement fails it throws an AssertionError not ValueError nor KeyError.
"Point must be same dimension as existing points in tree.")
# Check for existing index in leaves dict
try:
assert (indexnotinself.leaves)
exceptKeyError:
raiseKeyError("Index already exists in leaves dict.")
Also consider removing all assert statements, because they are ignored if __debug__ is not True. This is the case when you run in production (See Docs).
The lines could be rewritten as:
ifnotpoint.size==self.ndim:
raiseValueError(
"Point must be same dimension as existing points in tree.")
# Check for existing index in leaves dicttry:
self.leaves[index]
exceptKeyError:
raiseKeyError("Index already exists in leaves dict.")
The text was updated successfully, but these errors were encountered:
I noticed that there are assert statements that are catched wrongly, if an assert statement fails it throws an
AssertionError
notValueError
norKeyError
.rrcf/rrcf/rrcf.py
Lines 429 to 438 in 34504c1
Also consider removing all assert statements, because they are ignored if
__debug__
is notTrue
. This is the case when you run in production (See Docs).The lines could be rewritten as:
The text was updated successfully, but these errors were encountered: