2
2
3
3
from typing import TYPE_CHECKING , Dict , Tuple , Union , overload
4
4
5
- from medmodels .medrecord .querying import EdgeOperation , NodeOperation
5
+ from medmodels .medrecord .querying import EdgeQuery , NodeQuery
6
6
from medmodels .medrecord .types import (
7
7
Attributes ,
8
8
AttributesInput ,
@@ -48,10 +48,10 @@ def __getitem__(
48
48
self ,
49
49
key : Union [
50
50
NodeIndexInputList ,
51
- NodeOperation ,
51
+ NodeQuery ,
52
52
slice ,
53
53
Tuple [
54
- Union [NodeIndexInputList , NodeOperation , slice ],
54
+ Union [NodeIndexInputList , NodeQuery , slice ],
55
55
Union [MedRecordAttributeInputList , slice ],
56
56
],
57
57
],
@@ -60,18 +60,18 @@ def __getitem__(
60
60
@overload
61
61
def __getitem__ (
62
62
self ,
63
- key : Tuple [Union [NodeIndexInputList , NodeOperation , slice ], MedRecordAttribute ],
63
+ key : Tuple [Union [NodeIndexInputList , NodeQuery , slice ], MedRecordAttribute ],
64
64
) -> Dict [NodeIndex , MedRecordValue ]: ...
65
65
66
66
def __getitem__ (
67
67
self ,
68
68
key : Union [
69
69
NodeIndex ,
70
70
NodeIndexInputList ,
71
- NodeOperation ,
71
+ NodeQuery ,
72
72
slice ,
73
73
Tuple [
74
- Union [NodeIndex , NodeIndexInputList , NodeOperation , slice ],
74
+ Union [NodeIndex , NodeIndexInputList , NodeQuery , slice ],
75
75
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
76
76
],
77
77
],
@@ -87,7 +87,7 @@ def __getitem__(
87
87
if isinstance (key , list ):
88
88
return self ._medrecord ._medrecord .node (key )
89
89
90
- if isinstance (key , NodeOperation ):
90
+ if isinstance (key , NodeQuery ):
91
91
return self ._medrecord ._medrecord .node (self ._medrecord .select_nodes (key ))
92
92
93
93
if isinstance (key , slice ):
@@ -112,7 +112,7 @@ def __getitem__(
112
112
113
113
return {x : attributes [x ][attribute_selection ] for x in attributes .keys ()}
114
114
115
- if isinstance (index_selection , NodeOperation ) and is_medrecord_attribute (
115
+ if isinstance (index_selection , NodeQuery ) and is_medrecord_attribute (
116
116
attribute_selection
117
117
):
118
118
attributes = self ._medrecord ._medrecord .node (
@@ -151,7 +151,7 @@ def __getitem__(
151
151
for x in attributes .keys ()
152
152
}
153
153
154
- if isinstance (index_selection , NodeOperation ) and isinstance (
154
+ if isinstance (index_selection , NodeQuery ) and isinstance (
155
155
attribute_selection , list
156
156
):
157
157
attributes = self ._medrecord ._medrecord .node (
@@ -198,7 +198,7 @@ def __getitem__(
198
198
199
199
return self ._medrecord ._medrecord .node (index_selection )
200
200
201
- if isinstance (index_selection , NodeOperation ) and isinstance (
201
+ if isinstance (index_selection , NodeQuery ) and isinstance (
202
202
attribute_selection , slice
203
203
):
204
204
if (
@@ -230,15 +230,15 @@ def __getitem__(
230
230
@overload
231
231
def __setitem__ (
232
232
self ,
233
- key : Union [NodeIndex , NodeIndexInputList , NodeOperation , slice ],
233
+ key : Union [NodeIndex , NodeIndexInputList , NodeQuery , slice ],
234
234
value : AttributesInput ,
235
235
) -> None : ...
236
236
237
237
@overload
238
238
def __setitem__ (
239
239
self ,
240
240
key : Tuple [
241
- Union [NodeIndex , NodeIndexInputList , NodeOperation , slice ],
241
+ Union [NodeIndex , NodeIndexInputList , NodeQuery , slice ],
242
242
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
243
243
],
244
244
value : MedRecordValue ,
@@ -249,10 +249,10 @@ def __setitem__(
249
249
key : Union [
250
250
NodeIndex ,
251
251
NodeIndexInputList ,
252
- NodeOperation ,
252
+ NodeQuery ,
253
253
slice ,
254
254
Tuple [
255
- Union [NodeIndex , NodeIndexInputList , NodeOperation , slice ],
255
+ Union [NodeIndex , NodeIndexInputList , NodeQuery , slice ],
256
256
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
257
257
],
258
258
],
@@ -270,7 +270,7 @@ def __setitem__(
270
270
271
271
return self ._medrecord ._medrecord .replace_node_attributes (key , value )
272
272
273
- if isinstance (key , NodeOperation ):
273
+ if isinstance (key , NodeQuery ):
274
274
if not is_attributes (value ):
275
275
raise ValueError ("Invalid value type. Expected Attributes" )
276
276
@@ -311,7 +311,7 @@ def __setitem__(
311
311
index_selection , attribute_selection , value
312
312
)
313
313
314
- if isinstance (index_selection , NodeOperation ) and is_medrecord_attribute (
314
+ if isinstance (index_selection , NodeQuery ) and is_medrecord_attribute (
315
315
attribute_selection
316
316
):
317
317
if not is_medrecord_value (value ):
@@ -364,7 +364,7 @@ def __setitem__(
364
364
365
365
return
366
366
367
- if isinstance (index_selection , NodeOperation ) and isinstance (
367
+ if isinstance (index_selection , NodeQuery ) and isinstance (
368
368
attribute_selection , list
369
369
):
370
370
if not is_medrecord_value (value ):
@@ -440,7 +440,7 @@ def __setitem__(
440
440
441
441
return
442
442
443
- if isinstance (index_selection , NodeOperation ) and isinstance (
443
+ if isinstance (index_selection , NodeQuery ) and isinstance (
444
444
attribute_selection , slice
445
445
):
446
446
if (
@@ -494,7 +494,7 @@ def __setitem__(
494
494
def __delitem__ (
495
495
self ,
496
496
key : Tuple [
497
- Union [NodeIndex , NodeIndexInputList , NodeOperation , slice ],
497
+ Union [NodeIndex , NodeIndexInputList , NodeQuery , slice ],
498
498
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
499
499
],
500
500
) -> None :
@@ -514,7 +514,7 @@ def __delitem__(
514
514
index_selection , attribute_selection
515
515
)
516
516
517
- if isinstance (index_selection , NodeOperation ) and is_medrecord_attribute (
517
+ if isinstance (index_selection , NodeQuery ) and is_medrecord_attribute (
518
518
attribute_selection
519
519
):
520
520
return self ._medrecord ._medrecord .remove_node_attribute (
@@ -553,7 +553,7 @@ def __delitem__(
553
553
554
554
return
555
555
556
- if isinstance (index_selection , NodeOperation ) and isinstance (
556
+ if isinstance (index_selection , NodeQuery ) and isinstance (
557
557
attribute_selection , list
558
558
):
559
559
for attribute in attribute_selection :
@@ -602,7 +602,7 @@ def __delitem__(
602
602
index_selection , {}
603
603
)
604
604
605
- if isinstance (index_selection , NodeOperation ) and isinstance (
605
+ if isinstance (index_selection , NodeQuery ) and isinstance (
606
606
attribute_selection , slice
607
607
):
608
608
if (
@@ -658,10 +658,10 @@ def __getitem__(
658
658
self ,
659
659
key : Union [
660
660
EdgeIndexInputList ,
661
- EdgeOperation ,
661
+ EdgeQuery ,
662
662
slice ,
663
663
Tuple [
664
- Union [EdgeIndexInputList , EdgeOperation , slice ],
664
+ Union [EdgeIndexInputList , EdgeQuery , slice ],
665
665
Union [MedRecordAttributeInputList , slice ],
666
666
],
667
667
],
@@ -670,18 +670,18 @@ def __getitem__(
670
670
@overload
671
671
def __getitem__ (
672
672
self ,
673
- key : Tuple [Union [EdgeIndexInputList , EdgeOperation , slice ], MedRecordAttribute ],
673
+ key : Tuple [Union [EdgeIndexInputList , EdgeQuery , slice ], MedRecordAttribute ],
674
674
) -> Dict [EdgeIndex , MedRecordValue ]: ...
675
675
676
676
def __getitem__ (
677
677
self ,
678
678
key : Union [
679
679
EdgeIndex ,
680
680
EdgeIndexInputList ,
681
- EdgeOperation ,
681
+ EdgeQuery ,
682
682
slice ,
683
683
Tuple [
684
- Union [EdgeIndex , EdgeIndexInputList , EdgeOperation , slice ],
684
+ Union [EdgeIndex , EdgeIndexInputList , EdgeQuery , slice ],
685
685
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
686
686
],
687
687
],
@@ -697,7 +697,7 @@ def __getitem__(
697
697
if isinstance (key , list ):
698
698
return self ._medrecord ._medrecord .edge (key )
699
699
700
- if isinstance (key , EdgeOperation ):
700
+ if isinstance (key , EdgeQuery ):
701
701
return self ._medrecord ._medrecord .edge (self ._medrecord .select_edges (key ))
702
702
703
703
if isinstance (key , slice ):
@@ -722,7 +722,7 @@ def __getitem__(
722
722
723
723
return {x : attributes [x ][attribute_selection ] for x in attributes .keys ()}
724
724
725
- if isinstance (index_selection , EdgeOperation ) and is_medrecord_attribute (
725
+ if isinstance (index_selection , EdgeQuery ) and is_medrecord_attribute (
726
726
attribute_selection
727
727
):
728
728
attributes = self ._medrecord ._medrecord .edge (
@@ -761,7 +761,7 @@ def __getitem__(
761
761
for x in attributes .keys ()
762
762
}
763
763
764
- if isinstance (index_selection , EdgeOperation ) and isinstance (
764
+ if isinstance (index_selection , EdgeQuery ) and isinstance (
765
765
attribute_selection , list
766
766
):
767
767
attributes = self ._medrecord ._medrecord .edge (
@@ -808,7 +808,7 @@ def __getitem__(
808
808
809
809
return self ._medrecord ._medrecord .edge (index_selection )
810
810
811
- if isinstance (index_selection , EdgeOperation ) and isinstance (
811
+ if isinstance (index_selection , EdgeQuery ) and isinstance (
812
812
attribute_selection , slice
813
813
):
814
814
if (
@@ -840,15 +840,15 @@ def __getitem__(
840
840
@overload
841
841
def __setitem__ (
842
842
self ,
843
- key : Union [EdgeIndex , EdgeIndexInputList , EdgeOperation , slice ],
843
+ key : Union [EdgeIndex , EdgeIndexInputList , EdgeQuery , slice ],
844
844
value : AttributesInput ,
845
845
) -> None : ...
846
846
847
847
@overload
848
848
def __setitem__ (
849
849
self ,
850
850
key : Tuple [
851
- Union [EdgeIndex , EdgeIndexInputList , EdgeOperation , slice ],
851
+ Union [EdgeIndex , EdgeIndexInputList , EdgeQuery , slice ],
852
852
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
853
853
],
854
854
value : MedRecordValue ,
@@ -859,10 +859,10 @@ def __setitem__(
859
859
key : Union [
860
860
EdgeIndex ,
861
861
EdgeIndexInputList ,
862
- EdgeOperation ,
862
+ EdgeQuery ,
863
863
slice ,
864
864
Tuple [
865
- Union [EdgeIndex , EdgeIndexInputList , EdgeOperation , slice ],
865
+ Union [EdgeIndex , EdgeIndexInputList , EdgeQuery , slice ],
866
866
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
867
867
],
868
868
],
@@ -880,7 +880,7 @@ def __setitem__(
880
880
881
881
return self ._medrecord ._medrecord .replace_edge_attributes (key , value )
882
882
883
- if isinstance (key , EdgeOperation ):
883
+ if isinstance (key , EdgeQuery ):
884
884
if not is_attributes (value ):
885
885
raise ValueError ("Invalid value type. Expected Attributes" )
886
886
@@ -921,7 +921,7 @@ def __setitem__(
921
921
index_selection , attribute_selection , value
922
922
)
923
923
924
- if isinstance (index_selection , EdgeOperation ) and is_medrecord_attribute (
924
+ if isinstance (index_selection , EdgeQuery ) and is_medrecord_attribute (
925
925
attribute_selection
926
926
):
927
927
if not is_medrecord_value (value ):
@@ -974,7 +974,7 @@ def __setitem__(
974
974
975
975
return
976
976
977
- if isinstance (index_selection , EdgeOperation ) and isinstance (
977
+ if isinstance (index_selection , EdgeQuery ) and isinstance (
978
978
attribute_selection , list
979
979
):
980
980
if not is_medrecord_value (value ):
@@ -1048,7 +1048,7 @@ def __setitem__(
1048
1048
1049
1049
return
1050
1050
1051
- if isinstance (index_selection , EdgeOperation ) and isinstance (
1051
+ if isinstance (index_selection , EdgeQuery ) and isinstance (
1052
1052
attribute_selection , slice
1053
1053
):
1054
1054
if (
@@ -1102,7 +1102,7 @@ def __setitem__(
1102
1102
def __delitem__ (
1103
1103
self ,
1104
1104
key : Tuple [
1105
- Union [EdgeIndex , EdgeIndexInputList , EdgeOperation , slice ],
1105
+ Union [EdgeIndex , EdgeIndexInputList , EdgeQuery , slice ],
1106
1106
Union [MedRecordAttribute , MedRecordAttributeInputList , slice ],
1107
1107
],
1108
1108
) -> None :
@@ -1122,7 +1122,7 @@ def __delitem__(
1122
1122
index_selection , attribute_selection
1123
1123
)
1124
1124
1125
- if isinstance (index_selection , EdgeOperation ) and is_medrecord_attribute (
1125
+ if isinstance (index_selection , EdgeQuery ) and is_medrecord_attribute (
1126
1126
attribute_selection
1127
1127
):
1128
1128
return self ._medrecord ._medrecord .remove_edge_attribute (
@@ -1161,7 +1161,7 @@ def __delitem__(
1161
1161
1162
1162
return
1163
1163
1164
- if isinstance (index_selection , EdgeOperation ) and isinstance (
1164
+ if isinstance (index_selection , EdgeQuery ) and isinstance (
1165
1165
attribute_selection , list
1166
1166
):
1167
1167
for attribute in attribute_selection :
@@ -1210,7 +1210,7 @@ def __delitem__(
1210
1210
index_selection , {}
1211
1211
)
1212
1212
1213
- if isinstance (index_selection , EdgeOperation ) and isinstance (
1213
+ if isinstance (index_selection , EdgeQuery ) and isinstance (
1214
1214
attribute_selection , slice
1215
1215
):
1216
1216
if (
0 commit comments