@@ -561,7 +561,7 @@ def merge(self, other: Mapping[Any, Any] | None) -> Dataset:
561
561
variables = coords , coord_names = coord_names , indexes = indexes
562
562
)
563
563
564
- def __or__ (self , other : Self ) -> Self :
564
+ def __or__ (self , other : Mapping [ Any , Any ] | None ) -> Coordinates :
565
565
"""Merge two sets of coordinates to create a new Coordinates object
566
566
567
567
The method implements the logic used for joining coordinates in the
@@ -746,7 +746,12 @@ def copy(
746
746
747
747
def drop_vars (
748
748
self ,
749
- names : str | Iterable [Hashable ] | Callable [[Self ], str | Iterable [Hashable ]],
749
+ names : str
750
+ | Iterable [Hashable ]
751
+ | Callable [
752
+ [Coordinates | Dataset | DataArray | DataTree ],
753
+ str | Iterable [Hashable ],
754
+ ],
750
755
* ,
751
756
errors : ErrorOptions = "raise" ,
752
757
) -> Self :
@@ -767,13 +772,13 @@ def drop_vars(
767
772
- ``'ignore'``: any given names that are in the dataset are dropped and no
768
773
error is raised.
769
774
"""
770
- return self .to_dataset ().drop_vars (names , errors = errors ).coords
775
+ return cast ( Self , self .to_dataset ().drop_vars (names , errors = errors ).coords )
771
776
772
777
def rename_dims (
773
778
self ,
774
779
dims_dict : Mapping [Any , Hashable ] | None = None ,
775
780
** dims : Hashable ,
776
- ) -> Self :
781
+ ) -> Coordinates :
777
782
"""Returns a new object with renamed dimensions only.
778
783
779
784
Parameters
@@ -797,7 +802,7 @@ def rename_vars(
797
802
self ,
798
803
name_dict : Mapping [Any , Hashable ] | None = None ,
799
804
** names : Hashable ,
800
- ) -> Self :
805
+ ) -> Coordinates :
801
806
"""Returns a new object with renamed variables.
802
807
803
808
Parameters
0 commit comments