Skip to content

Commit 3681b65

Browse files
committed
minor tweaks
1 parent f67211f commit 3681b65

File tree

3 files changed

+71
-71
lines changed

3 files changed

+71
-71
lines changed

xarray/core/_typed_ops.pyi

+59-60
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
This file was generated using xarray.util.stubgen_ops. Do not edit manually."""
44

5-
import numbers
65
from typing import NoReturn, TypeVar, Union, overload
76

87
import numpy as np
@@ -22,13 +21,13 @@ T_DataArray = TypeVar("T_DataArray", bound=DataArray)
2221
T_Variable = TypeVar("T_Variable", bound=Variable)
2322
T_Self = TypeVar("T_Self")
2423

25-
# Note: T_Compatible (and types involving T_Compatible) is to be used last in
26-
# overloads, since nd.ndarray is typed as Any for older versions of numpy.
27-
T_Compatible = Union[complex, bytes, str, np.ndarray, np.generic, DaskArray]
28-
T_DsOther = Union[Dataset, DataArray, Variable, T_Compatible, GroupBy]
29-
T_DaOther = Union[DataArray, Variable, T_Compatible]
30-
T_VarOther = Union[Variable, T_Compatible]
31-
T_GroupbybIncompatible = Union[Variable, T_Compatible, GroupBy]
24+
# Note: T_Other (and types involving T_Other) is to be used last in overloads,
25+
# since nd.ndarray is typed as Any for older versions of numpy.
26+
T_Other = Union[complex, bytes, str, np.ndarray, np.generic, DaskArray]
27+
T_DsOther = Union[Dataset, DataArray, Variable, T_Other, GroupBy]
28+
T_DaOther = Union[DataArray, Variable, T_Other]
29+
T_VarOther = Union[Variable, T_Other]
30+
T_GroupByIncompatible = Union[Variable, GroupBy, T_Other]
3231

3332
class TypedDatasetOps:
3433
def __neg__(self: T_Self) -> T_Self: ...
@@ -444,312 +443,312 @@ class TypedDatasetGroupByOps:
444443
@overload
445444
def __eq__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
446445
@overload
447-
def __eq__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
446+
def __eq__(self, other: T_GroupByIncompatible) -> NoReturn: ...
448447
@overload # type: ignore[override]
449448
def __ne__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
450449
@overload
451450
def __ne__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
452451
@overload
453-
def __ne__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
452+
def __ne__(self, other: T_GroupByIncompatible) -> NoReturn: ...
454453
@overload
455454
def __lt__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
456455
@overload
457456
def __lt__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
458457
@overload
459-
def __lt__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
458+
def __lt__(self, other: T_GroupByIncompatible) -> NoReturn: ...
460459
@overload
461460
def __le__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
462461
@overload
463462
def __le__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
464463
@overload
465-
def __le__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
464+
def __le__(self, other: T_GroupByIncompatible) -> NoReturn: ...
466465
@overload
467466
def __gt__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
468467
@overload
469468
def __gt__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
470469
@overload
471-
def __gt__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
470+
def __gt__(self, other: T_GroupByIncompatible) -> NoReturn: ...
472471
@overload
473472
def __ge__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
474473
@overload
475474
def __ge__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
476475
@overload
477-
def __ge__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
476+
def __ge__(self, other: T_GroupByIncompatible) -> NoReturn: ...
478477
@overload
479478
def __add__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
480479
@overload
481480
def __add__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
482481
@overload
483-
def __add__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
482+
def __add__(self, other: T_GroupByIncompatible) -> NoReturn: ...
484483
@overload
485484
def __sub__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
486485
@overload
487486
def __sub__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
488487
@overload
489-
def __sub__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
488+
def __sub__(self, other: T_GroupByIncompatible) -> NoReturn: ...
490489
@overload
491490
def __mul__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
492491
@overload
493492
def __mul__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
494493
@overload
495-
def __mul__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
494+
def __mul__(self, other: T_GroupByIncompatible) -> NoReturn: ...
496495
@overload
497496
def __pow__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
498497
@overload
499498
def __pow__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
500499
@overload
501-
def __pow__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
500+
def __pow__(self, other: T_GroupByIncompatible) -> NoReturn: ...
502501
@overload
503502
def __truediv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
504503
@overload
505504
def __truediv__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
506505
@overload
507-
def __truediv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
506+
def __truediv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
508507
@overload
509508
def __floordiv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
510509
@overload
511510
def __floordiv__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
512511
@overload
513-
def __floordiv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
512+
def __floordiv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
514513
@overload
515514
def __mod__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
516515
@overload
517516
def __mod__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
518517
@overload
519-
def __mod__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
518+
def __mod__(self, other: T_GroupByIncompatible) -> NoReturn: ...
520519
@overload
521520
def __radd__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
522521
@overload
523522
def __radd__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
524523
@overload
525-
def __radd__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
524+
def __radd__(self, other: T_GroupByIncompatible) -> NoReturn: ...
526525
@overload
527526
def __rsub__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
528527
@overload
529528
def __rsub__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
530529
@overload
531-
def __rsub__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
530+
def __rsub__(self, other: T_GroupByIncompatible) -> NoReturn: ...
532531
@overload
533532
def __rmul__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
534533
@overload
535534
def __rmul__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
536535
@overload
537-
def __rmul__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
536+
def __rmul__(self, other: T_GroupByIncompatible) -> NoReturn: ...
538537
@overload
539538
def __rpow__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
540539
@overload
541540
def __rpow__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
542541
@overload
543-
def __rpow__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
542+
def __rpow__(self, other: T_GroupByIncompatible) -> NoReturn: ...
544543
@overload
545544
def __rtruediv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
546545
@overload
547546
def __rtruediv__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
548547
@overload
549-
def __rtruediv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
548+
def __rtruediv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
550549
@overload
551550
def __rfloordiv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
552551
@overload
553552
def __rfloordiv__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
554553
@overload
555-
def __rfloordiv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
554+
def __rfloordiv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
556555
@overload
557556
def __rmod__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
558557
@overload
559558
def __rmod__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
560559
@overload
561-
def __rmod__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
560+
def __rmod__(self, other: T_GroupByIncompatible) -> NoReturn: ...
562561
@overload
563562
def __and__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
564563
@overload
565564
def __and__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
566565
@overload
567-
def __and__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
566+
def __and__(self, other: T_GroupByIncompatible) -> NoReturn: ...
568567
@overload
569568
def __xor__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
570569
@overload
571570
def __xor__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
572571
@overload
573-
def __xor__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
572+
def __xor__(self, other: T_GroupByIncompatible) -> NoReturn: ...
574573
@overload
575574
def __or__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
576575
@overload
577576
def __or__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
578577
@overload
579-
def __or__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
578+
def __or__(self, other: T_GroupByIncompatible) -> NoReturn: ...
580579
@overload
581580
def __rand__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
582581
@overload
583582
def __rand__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
584583
@overload
585-
def __rand__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
584+
def __rand__(self, other: T_GroupByIncompatible) -> NoReturn: ...
586585
@overload
587586
def __rxor__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
588587
@overload
589588
def __rxor__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
590589
@overload
591-
def __rxor__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
590+
def __rxor__(self, other: T_GroupByIncompatible) -> NoReturn: ...
592591
@overload
593592
def __ror__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
594593
@overload
595594
def __ror__(self, other: DataArray) -> Dataset: ... # type: ignore[misc]
596595
@overload
597-
def __ror__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
596+
def __ror__(self, other: T_GroupByIncompatible) -> NoReturn: ...
598597

599598
class TypedDataArrayGroupByOps:
600599
@overload # type: ignore[override]
601600
def __eq__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
602601
@overload
603602
def __eq__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
604603
@overload
605-
def __eq__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
604+
def __eq__(self, other: T_GroupByIncompatible) -> NoReturn: ...
606605
@overload # type: ignore[override]
607606
def __ne__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
608607
@overload
609608
def __ne__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
610609
@overload
611-
def __ne__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
610+
def __ne__(self, other: T_GroupByIncompatible) -> NoReturn: ...
612611
@overload
613612
def __lt__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
614613
@overload
615614
def __lt__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
616615
@overload
617-
def __lt__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
616+
def __lt__(self, other: T_GroupByIncompatible) -> NoReturn: ...
618617
@overload
619618
def __le__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
620619
@overload
621620
def __le__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
622621
@overload
623-
def __le__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
622+
def __le__(self, other: T_GroupByIncompatible) -> NoReturn: ...
624623
@overload
625624
def __gt__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
626625
@overload
627626
def __gt__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
628627
@overload
629-
def __gt__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
628+
def __gt__(self, other: T_GroupByIncompatible) -> NoReturn: ...
630629
@overload
631630
def __ge__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
632631
@overload
633632
def __ge__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
634633
@overload
635-
def __ge__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
634+
def __ge__(self, other: T_GroupByIncompatible) -> NoReturn: ...
636635
@overload
637636
def __add__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
638637
@overload
639638
def __add__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
640639
@overload
641-
def __add__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
640+
def __add__(self, other: T_GroupByIncompatible) -> NoReturn: ...
642641
@overload
643642
def __sub__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
644643
@overload
645644
def __sub__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
646645
@overload
647-
def __sub__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
646+
def __sub__(self, other: T_GroupByIncompatible) -> NoReturn: ...
648647
@overload
649648
def __mul__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
650649
@overload
651650
def __mul__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
652651
@overload
653-
def __mul__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
652+
def __mul__(self, other: T_GroupByIncompatible) -> NoReturn: ...
654653
@overload
655654
def __pow__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
656655
@overload
657656
def __pow__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
658657
@overload
659-
def __pow__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
658+
def __pow__(self, other: T_GroupByIncompatible) -> NoReturn: ...
660659
@overload
661660
def __truediv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
662661
@overload
663662
def __truediv__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
664663
@overload
665-
def __truediv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
664+
def __truediv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
666665
@overload
667666
def __floordiv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
668667
@overload
669668
def __floordiv__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
670669
@overload
671-
def __floordiv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
670+
def __floordiv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
672671
@overload
673672
def __mod__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
674673
@overload
675674
def __mod__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
676675
@overload
677-
def __mod__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
676+
def __mod__(self, other: T_GroupByIncompatible) -> NoReturn: ...
678677
@overload
679678
def __radd__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
680679
@overload
681680
def __radd__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
682681
@overload
683-
def __radd__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
682+
def __radd__(self, other: T_GroupByIncompatible) -> NoReturn: ...
684683
@overload
685684
def __rsub__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
686685
@overload
687686
def __rsub__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
688687
@overload
689-
def __rsub__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
688+
def __rsub__(self, other: T_GroupByIncompatible) -> NoReturn: ...
690689
@overload
691690
def __rmul__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
692691
@overload
693692
def __rmul__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
694693
@overload
695-
def __rmul__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
694+
def __rmul__(self, other: T_GroupByIncompatible) -> NoReturn: ...
696695
@overload
697696
def __rpow__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
698697
@overload
699698
def __rpow__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
700699
@overload
701-
def __rpow__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
700+
def __rpow__(self, other: T_GroupByIncompatible) -> NoReturn: ...
702701
@overload
703702
def __rtruediv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
704703
@overload
705704
def __rtruediv__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
706705
@overload
707-
def __rtruediv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
706+
def __rtruediv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
708707
@overload
709708
def __rfloordiv__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
710709
@overload
711710
def __rfloordiv__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
712711
@overload
713-
def __rfloordiv__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
712+
def __rfloordiv__(self, other: T_GroupByIncompatible) -> NoReturn: ...
714713
@overload
715714
def __rmod__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
716715
@overload
717716
def __rmod__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
718717
@overload
719-
def __rmod__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
718+
def __rmod__(self, other: T_GroupByIncompatible) -> NoReturn: ...
720719
@overload
721720
def __and__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
722721
@overload
723722
def __and__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
724723
@overload
725-
def __and__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
724+
def __and__(self, other: T_GroupByIncompatible) -> NoReturn: ...
726725
@overload
727726
def __xor__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
728727
@overload
729728
def __xor__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
730729
@overload
731-
def __xor__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
730+
def __xor__(self, other: T_GroupByIncompatible) -> NoReturn: ...
732731
@overload
733732
def __or__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
734733
@overload
735734
def __or__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
736735
@overload
737-
def __or__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
736+
def __or__(self, other: T_GroupByIncompatible) -> NoReturn: ...
738737
@overload
739738
def __rand__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
740739
@overload
741740
def __rand__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
742741
@overload
743-
def __rand__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
742+
def __rand__(self, other: T_GroupByIncompatible) -> NoReturn: ...
744743
@overload
745744
def __rxor__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
746745
@overload
747746
def __rxor__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
748747
@overload
749-
def __rxor__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
748+
def __rxor__(self, other: T_GroupByIncompatible) -> NoReturn: ...
750749
@overload
751750
def __ror__(self, other: T_Dataset) -> T_Dataset: ... # type: ignore[misc]
752751
@overload
753752
def __ror__(self, other: T_DataArray) -> T_DataArray: ... # type: ignore[misc]
754753
@overload
755-
def __ror__(self, other: T_GroupbybIncompatible) -> NoReturn: ...
754+
def __ror__(self, other: T_GroupByIncompatible) -> NoReturn: ...

0 commit comments

Comments
 (0)