@@ -567,7 +567,7 @@ def __init__(
567
567
f"are supported for 'data': shape { data .shape } " )
568
568
569
569
dimensions , = data .shape
570
- data_dict = {(i ,): cast (CoeffT , xi ) for i , xi in enumerate (data )}
570
+ data_dict = {(i ,): cast (" CoeffT" , xi ) for i , xi in enumerate (data )}
571
571
572
572
if space is None :
573
573
space = get_euclidean_space (dimensions )
@@ -579,7 +579,7 @@ def __init__(
579
579
elif isinstance (data , Mapping ):
580
580
data_dict = data
581
581
else :
582
- data_dict = {0 : cast (CoeffT , data )}
582
+ data_dict = {0 : cast (" CoeffT" , data )}
583
583
584
584
if space is None :
585
585
raise ValueError ("No 'space' provided" )
@@ -595,16 +595,16 @@ def __init__(
595
595
assert isinstance (basis_indices , tuple )
596
596
597
597
bits , sign = space .bits_and_sign (basis_indices )
598
- new_coeff = cast (CoeffT ,
599
- new_data .setdefault (bits , cast (CoeffT , 0 )) # type: ignore[operator]
598
+ new_coeff = cast (" CoeffT" ,
599
+ new_data .setdefault (bits , cast (" CoeffT" , 0 )) # type: ignore[operator]
600
600
+ sign * coeff )
601
601
602
602
if is_zero (new_coeff ):
603
603
del new_data [bits ]
604
604
else :
605
605
new_data [bits ] = new_coeff
606
606
else :
607
- new_data = cast (dict [int , CoeffT ], data_dict )
607
+ new_data = cast (" dict[int, CoeffT]" , data_dict )
608
608
609
609
# }}}
610
610
@@ -691,8 +691,8 @@ def __add__(self, other) -> MultiVector:
691
691
from pymbolic .primitives import is_zero
692
692
new_data = {}
693
693
for bits in all_bits :
694
- new_coeff = (self .data .get (bits , cast (CoeffT , 0 ))
695
- + other .data .get (bits , cast (CoeffT , 0 )))
694
+ new_coeff = (self .data .get (bits , cast (" CoeffT" , 0 ))
695
+ + other .data .get (bits , cast (" CoeffT" , 0 )))
696
696
697
697
if not is_zero (new_coeff ):
698
698
new_data [bits ] = new_coeff
@@ -741,7 +741,7 @@ def _generic_product(self,
741
741
coeff = (weight
742
742
* canonical_reordering_sign (sbits , obits )
743
743
* scoeff * ocoeff )
744
- new_coeff = new_data .setdefault (new_bits , cast (CoeffT , 0 )) + coeff
744
+ new_coeff = new_data .setdefault (new_bits , cast (" CoeffT" , 0 )) + coeff
745
745
if is_zero (new_coeff ):
746
746
del new_data [new_bits ]
747
747
else :
@@ -1134,7 +1134,7 @@ def componentwise(f: Callable[[CoeffT], CoeffT], expr: T) -> T:
1134
1134
"""
1135
1135
1136
1136
if isinstance (expr , MultiVector ):
1137
- return cast (T , expr .map (f ))
1137
+ return cast ("T" , expr .map (f ))
1138
1138
1139
1139
from pytools .obj_array import obj_array_vectorize
1140
1140
return obj_array_vectorize (f , expr )
0 commit comments