@@ -80,6 +80,8 @@ class IndexType(IntEnum):
8080
8181
8282class Index :
83+ """Property Index"""
84+
8385 # TODO HNSW isn't a `type` but HASH and HASH64 are, remove type member and make HashIndex and Hash64Index classes?
8486
8587 def __init__ (self , type : IndexType = IndexType .VALUE , uid : int = 0 ):
@@ -136,8 +138,8 @@ class VectorDistanceType(IntEnum):
136138Value range: 0.0 - 2.0 (nonlinear; 0.0: nearest, 1.0: orthogonal, 2.0: farthest)
137139"""
138140
139-
140141class HnswIndex :
142+ """HNSW Index for Vector-Search"""
141143 def __init__ (self ,
142144 dimensions : int ,
143145 neighbors_per_node : Optional [int ] = None ,
@@ -290,16 +292,19 @@ def not_equals(self, value) -> PropertyQueryCondition:
290292
291293# ID property (primary key)
292294class Id (_IntProperty ):
295+ """Id Property"""
293296 def __init__ (self , id : int = 0 , uid : int = 0 , py_type : type = int ):
294297 super (Id , self ).__init__ (py_type , id = id , uid = uid )
295298
296299# Bool property
297300class Bool (_IntProperty ):
301+ """Boolean Property"""
298302 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
299303 super (Bool , self ).__init__ (bool , type = PropertyType .bool , id = id , uid = uid , ** kwargs )
300304
301305# String property with starts/ends_with
302306class String (Property ):
307+ """String Property"""
303308 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
304309 super (String , self ).__init__ (str , type = PropertyType .string , id = id , uid = uid , ** kwargs )
305310
@@ -352,38 +357,47 @@ def less_or_equal(self, value, case_sensitive: bool = True) -> PropertyQueryCond
352357
353358# Signed Integer Numeric Properties
354359class Int8 (_IntProperty ):
360+ """Integer 8-bit Property"""
355361 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
356362 super (Int8 , self ).__init__ (int , type = PropertyType .byte , id = id , uid = uid , ** kwargs )
357363class Int16 (_IntProperty ):
364+ """Integer 16-bit Property"""
358365 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
359366 super (Int16 , self ).__init__ (int , type = PropertyType .short , id = id , uid = uid , ** kwargs )
360367class Int32 (_IntProperty ):
368+ """Integer 32-bit Property"""
361369 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
362370 super (Int32 , self ).__init__ (int , type = PropertyType .int , id = id , uid = uid , ** kwargs )
363371class Int64 (_IntProperty ):
372+ """Integer 64-bit Property"""
364373 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
365374 super (Int64 , self ).__init__ (int , type = PropertyType .long , id = id , uid = uid , ** kwargs )
366375
367376# Floating-Point Numeric Properties
368377class Float32 (_NumericProperty ):
378+ """Floating-point 32-bit Property"""
369379 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
370380 super (Float32 , self ).__init__ (float , type = PropertyType .float , id = id , uid = uid , ** kwargs )
371381
372382class Float64 (_NumericProperty ):
383+ """Floating-point 64-bit Property"""
373384 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
374385 super (Float64 , self ).__init__ (float , type = PropertyType .double , id = id , uid = uid , ** kwargs )
375386
376387# Date Properties
377388class Date (_IntProperty ):
389+ """Date Property"""
378390 def __init__ (self , py_type = datetime , id : int = 0 , uid : int = 0 , ** kwargs ):
379391 super (Date , self ).__init__ (py_type , type = PropertyType .date , id = id , uid = uid , ** kwargs )
380392
381393class DateNano (_IntProperty ):
394+ """Date (nano-second resolution) Property"""
382395 def __init__ (self , py_type = datetime , id : int = 0 , uid : int = 0 , ** kwargs ):
383396 super (DateNano , self ).__init__ (py_type , type = PropertyType .dateNano , id = id , uid = uid , ** kwargs )
384397
385398# Bytes Property
386399class Bytes (_NumericProperty ):
400+ """Bytes blob Property"""
387401 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
388402 super (Bytes , self ).__init__ (bytes , type = PropertyType .byteVector , id = id , uid = uid , ** kwargs )
389403
@@ -414,6 +428,7 @@ def less_or_equal(self, value) -> PropertyQueryCondition:
414428
415429# Flex Property
416430class Flex (Property ):
431+ """Flex dictionary-compatible Property"""
417432 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
418433 super (Flex , self ).__init__ (Generic , type = PropertyType .flex , id = id , uid = uid , ** kwargs )
419434 def contains_key_value (self , key : str , value : str , case_sensitive : bool = True ) -> PropertyQueryCondition :
@@ -426,29 +441,36 @@ def __init__(self, py_type : Type, **kwargs):
426441 super (_VectorProperty , self ).__init__ (py_type , ** kwargs )
427442
428443class BoolVector (_VectorProperty ):
444+ """Boolean Vector Property"""
429445 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
430446 super (BoolVector , self ).__init__ (np .ndarray , type = PropertyType .boolVector , id = id , uid = uid , ** kwargs )
431447class Int8Vector (_VectorProperty ):
448+ """Integer 8-bit Vector Property"""
432449 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
433450 super (Int8Vector , self ).__init__ (bytes , type = PropertyType .byteVector , id = id , uid = uid , ** kwargs )
434451
435452class Int16Vector (_VectorProperty ):
453+ """Integer 16-bit Vector Property"""
436454 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
437455 super (Int16Vector , self ).__init__ (np .ndarray , type = PropertyType .shortVector , id = id , uid = uid , ** kwargs )
438456
439457class CharVector (_VectorProperty ):
458+ """Char 16-bit Vector Property"""
440459 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
441460 super (CharVector , self ).__init__ (np .ndarray , type = PropertyType .charVector , id = id , uid = uid , ** kwargs )
442461
443462class Int32Vector (_VectorProperty ):
463+ """Integer 32-bit Vector Property"""
444464 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
445465 super (Int32Vector , self ).__init__ (np .ndarray , type = PropertyType .intVector , id = id , uid = uid , ** kwargs )
446466
447467class Int64Vector (_VectorProperty ):
468+ """Integer 64-bit Vector Property"""
448469 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
449470 super (Int64Vector , self ).__init__ (np .ndarray , type = PropertyType .longVector , id = id , uid = uid , ** kwargs )
450471
451472class Float32Vector (_VectorProperty ):
473+ """Floating-point 32-bit Vector Property"""
452474 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
453475 super (Float32Vector , self ).__init__ (np .ndarray , type = PropertyType .floatVector , id = id , uid = uid , ** kwargs )
454476 def nearest_neighbor (self , query_vector , element_count : int ) -> PropertyQueryCondition :
@@ -457,6 +479,7 @@ def nearest_neighbor(self, query_vector, element_count: int) -> PropertyQueryCon
457479 return PropertyQueryCondition (self .id , PropertyQueryConditionOp .NEAREST_NEIGHBOR , args )
458480
459481class Float64Vector (_VectorProperty ):
482+ """Floating-point 64-bit Vector Property"""
460483 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
461484 super (Float64Vector , self ).__init__ (np .ndarray , type = PropertyType .doubleVector , id = id , uid = uid , ** kwargs )
462485
@@ -465,33 +488,41 @@ def __init__(self, **kwargs):
465488 super (_ListProperty , self ).__init__ (list , ** kwargs )
466489
467490class BoolList (_ListProperty ):
491+ """Boolean List Property"""
468492 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
469493 super (BoolList , self ).__init__ (type = PropertyType .boolVector , id = id , uid = uid , ** kwargs )
470494
471495class Int8List (_ListProperty ):
496+ """Integer 8-bit List Property"""
472497 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
473498 super (Int8List , self ).__init__ (type = PropertyType .byteVector , id = id , uid = uid , ** kwargs )
474499
475500class Int16List (_ListProperty ):
501+ """Integer 16-bit List Property"""
476502 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
477503 super (Int16List , self ).__init__ (type = PropertyType .shortVector , id = id , uid = uid , ** kwargs )
478504
479505class Int32List (_ListProperty ):
506+ """Integer 32-bit List Property"""
480507 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
481508 super (Int32List , self ).__init__ (type = PropertyType .intVector , id = id , uid = uid , ** kwargs )
482509
483510class Int64List (_ListProperty ):
511+ """Integer 64-bit List Property"""
484512 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
485513 super (Int64List , self ).__init__ (type = PropertyType .longVector , id = id , uid = uid , ** kwargs )
486514
487515class Float32List (_ListProperty ):
516+ """Floating-point 32-bit List Property"""
488517 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
489518 super (Float32List , self ).__init__ (type = PropertyType .floatVector , id = id , uid = uid , ** kwargs )
490519
491520class Float64List (_ListProperty ):
521+ """Floating-point 64-bit List Property"""
492522 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
493523 super (Float64List , self ).__init__ (type = PropertyType .doubleVector , id = id , uid = uid , ** kwargs )
494524
495525class CharList (_ListProperty ):
526+ """Char 16-bit List Property"""
496527 def __init__ (self , id : int = 0 , uid : int = 0 , ** kwargs ):
497528 super (CharList , self ).__init__ (type = PropertyType .charVector , id = id , uid = uid , ** kwargs )
0 commit comments