@@ -887,7 +887,6 @@ class NeighborTable(Connectivity, Protocol):
887
887
class CartesianConnectivity (ConnectivityField [DimsT , DimT ]):
888
888
dimension : DimT
889
889
offset : int = 0
890
- _cur_index : Optional [core_defs .IntegralScalar ] = None
891
890
892
891
@classmethod
893
892
def __gt_builtin_func__ (cls , _ : fbuiltins .BuiltInFunction ) -> Never : # type: ignore[override]
@@ -900,20 +899,12 @@ def ndarray(self) -> Never:
900
899
def asnumpy (self ) -> Never :
901
900
raise NotImplementedError ()
902
901
903
- def as_scalar (self ) -> core_defs .IntegralScalar :
904
- if self .domain .ndim != 0 :
905
- raise ValueError (
906
- "'as_scalar' is only valid on 0-dimensional 'Field's, got a {self.domain.ndim}-dimensional 'Field'."
907
- )
908
- assert self ._cur_index is not None
909
- return self ._cur_index
902
+ def as_scalar (self ) -> Never :
903
+ raise NotImplementedError ()
910
904
911
905
@functools .cached_property
912
906
def domain (self ) -> Domain :
913
- if self ._cur_index is None :
914
- return Domain (dims = (self .dimension ,), ranges = (UnitRange .infinite (),))
915
- else :
916
- return Domain ()
907
+ return Domain (dims = (self .dimension ,), ranges = (UnitRange .infinite (),))
917
908
918
909
@property
919
910
def __gt_origin__ (self ) -> Never :
@@ -962,9 +953,7 @@ def remap(self, index_field: ConnectivityField | fbuiltins.FieldOffset) -> Conne
962
953
963
954
__call__ = remap
964
955
965
- def restrict (self , index : AnyIndexSpec ) -> ConnectivityField [DimsT , DimT ]:
966
- if is_int_index (index ):
967
- return dataclasses .replace (self , _cur_index = index + self .offset )
956
+ def restrict (self , index : AnyIndexSpec ) -> Never :
968
957
raise NotImplementedError () # we could possibly implement with a FunctionField, but we don't have a use-case
969
958
970
959
__getitem__ = restrict
0 commit comments