@@ -483,71 +483,69 @@ def __geo_interface__(self) -> dict[str, object]:
483
483
484
484
def test_generic_getset () -> None :
485
485
# type_id
486
- check (assert_type (shapely .get_type_id (P ), int ), np .integer )
487
- check (assert_type (shapely .get_type_id (None ), int ), np .integer )
488
- check (assert_type (shapely .get_type_id ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
489
- check (assert_type (shapely .get_type_id ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
486
+ check (assert_type (shapely .get_type_id (P ), np . int32 ), np .int32 )
487
+ check (assert_type (shapely .get_type_id (None ), np . int32 ), np .int32 )
488
+ check (assert_type (shapely .get_type_id ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32 )
489
+ check (assert_type (shapely .get_type_id ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32 )
490
490
check (
491
- assert_type (shapely .get_type_id ((P , None )), NDArray [np .int64 ]), np .ndarray , dtype = np .integer
491
+ assert_type (shapely .get_type_id ((P , None )), NDArray [np .int64 ]), np .ndarray , dtype = np .int32
492
492
)
493
493
494
494
# dimensions
495
- check (assert_type (shapely .get_dimensions (P ), int ), np .integer )
496
- check (assert_type (shapely .get_dimensions (None ), int ), np .integer )
497
- check (assert_type (shapely .get_dimensions ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
495
+ check (assert_type (shapely .get_dimensions (P ), np . int32 ), np .int32 )
496
+ check (assert_type (shapely .get_dimensions (None ), np . int32 ), np .int32 )
497
+ check (assert_type (shapely .get_dimensions ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32 )
498
498
check (
499
- assert_type (shapely .get_dimensions ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer
499
+ assert_type (shapely .get_dimensions ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32
500
500
)
501
501
check (
502
502
assert_type (shapely .get_dimensions ((P , None )), NDArray [np .int64 ]),
503
503
np .ndarray ,
504
- dtype = np .integer ,
504
+ dtype = np .int32 ,
505
505
)
506
506
507
507
# coordinate_dimension
508
- check (assert_type (shapely .get_coordinate_dimension (P ), int ), np .integer )
509
- check (assert_type (shapely .get_coordinate_dimension (None ), int ), np .integer )
508
+ check (assert_type (shapely .get_coordinate_dimension (P ), np . int32 ), np .int32 )
509
+ check (assert_type (shapely .get_coordinate_dimension (None ), np . int32 ), np .int32 )
510
510
check (
511
511
assert_type (shapely .get_coordinate_dimension ([P ]), NDArray [np .int64 ]),
512
512
np .ndarray ,
513
- dtype = np .integer ,
513
+ dtype = np .int32 ,
514
514
)
515
515
check (
516
516
assert_type (shapely .get_coordinate_dimension ([None ]), NDArray [np .int64 ]),
517
517
np .ndarray ,
518
- dtype = np .integer ,
518
+ dtype = np .int32 ,
519
519
)
520
520
check (
521
521
assert_type (shapely .get_coordinate_dimension ((P , None )), NDArray [np .int64 ]),
522
522
np .ndarray ,
523
- dtype = np .integer ,
523
+ dtype = np .int32 ,
524
524
)
525
525
526
526
# num_coordinates
527
- check (assert_type (shapely .get_num_coordinates (P ), int ), np .integer )
528
- check (assert_type (shapely .get_num_coordinates (None ), int ), np .integer )
527
+ check (assert_type (shapely .get_num_coordinates (P ), np . int32 ), np .int32 )
528
+ check (assert_type (shapely .get_num_coordinates (None ), np . int32 ), np .int32 )
529
529
check (
530
- assert_type (shapely .get_num_coordinates ([P ]), NDArray [np .int64 ]),
531
- np .ndarray ,
532
- dtype = np .integer ,
530
+ assert_type (shapely .get_num_coordinates ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32
533
531
)
534
532
check (
535
533
assert_type (shapely .get_num_coordinates ([None ]), NDArray [np .int64 ]),
536
534
np .ndarray ,
537
- dtype = np .integer ,
535
+ dtype = np .int32 ,
538
536
)
539
537
check (
540
538
assert_type (shapely .get_num_coordinates ((P , None )), NDArray [np .int64 ]),
541
539
np .ndarray ,
542
- dtype = np .integer ,
540
+ dtype = np .int32 ,
543
541
)
544
542
545
543
# srid
546
- check (assert_type (shapely .get_srid (P ), int ), np .integer )
547
- check (assert_type (shapely .get_srid (None ), int ), np .integer )
548
- check (assert_type (shapely .get_srid ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
549
- check (assert_type (shapely .get_srid ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
550
- check (assert_type (shapely .get_srid ((P , None )), NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
544
+ check (assert_type (shapely .get_srid (P ), np . int32 ), np .int32 )
545
+ check (assert_type (shapely .get_srid (None ), np . int32 ), np .int32 )
546
+ check (assert_type (shapely .get_srid ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32 )
547
+ check (assert_type (shapely .get_srid ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32 )
548
+ check (assert_type (shapely .get_srid ((P , None )), NDArray [np .int64 ]), np .ndarray , dtype = np .int32 )
551
549
552
550
check (assert_type (shapely .set_srid (P , 20 ), Point ), Point )
553
551
check (assert_type (shapely .set_srid (None , 20 ), None ), NoneType )
@@ -560,8 +558,8 @@ def test_generic_getset() -> None:
560
558
)
561
559
562
560
# precision
563
- check (assert_type (shapely .get_precision (None ), float ), float )
564
- check (assert_type (shapely .get_precision (P ), float ), float )
561
+ check (assert_type (shapely .get_precision (None ), np . float64 ), np . float64 )
562
+ check (assert_type (shapely .get_precision (P ), np . float64 ), np . float64 )
565
563
check (assert_type (shapely .get_precision ([P ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
566
564
check (assert_type (shapely .get_precision ([None ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
567
565
check (
@@ -615,23 +613,23 @@ def test_generic_getset() -> None:
615
613
616
614
617
615
def test_point_getset () -> None :
618
- check (assert_type (shapely .get_x (P ), float ), float )
619
- check (assert_type (shapely .get_x (LS ), float ), float )
620
- check (assert_type (shapely .get_x (None ), float ), float )
616
+ check (assert_type (shapely .get_x (P ), np . float64 ), np . float64 )
617
+ check (assert_type (shapely .get_x (LS ), np . float64 ), np . float64 )
618
+ check (assert_type (shapely .get_x (None ), np . float64 ), np . float64 )
621
619
check (assert_type (shapely .get_x ([P ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
622
620
check (assert_type (shapely .get_x ([None ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
623
621
check (assert_type (shapely .get_x ((P , None )), NDArray [np .float64 ]), np .ndarray , dtype = float )
624
622
625
- check (assert_type (shapely .get_y (P ), float ), float )
626
- check (assert_type (shapely .get_y (LS ), float ), float )
627
- check (assert_type (shapely .get_y (None ), float ), float )
623
+ check (assert_type (shapely .get_y (P ), np . float64 ), np . float64 )
624
+ check (assert_type (shapely .get_y (LS ), np . float64 ), np . float64 )
625
+ check (assert_type (shapely .get_y (None ), np . float64 ), np . float64 )
628
626
check (assert_type (shapely .get_y ([P ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
629
627
check (assert_type (shapely .get_y ([None ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
630
628
check (assert_type (shapely .get_y ((P , None )), NDArray [np .float64 ]), np .ndarray , dtype = float )
631
629
632
- check (assert_type (shapely .get_z (P ), float ), float )
633
- check (assert_type (shapely .get_z (LS ), float ), float )
634
- check (assert_type (shapely .get_z (None ), float ), float )
630
+ check (assert_type (shapely .get_z (P ), np . float64 ), np . float64 )
631
+ check (assert_type (shapely .get_z (LS ), np . float64 ), np . float64 )
632
+ check (assert_type (shapely .get_z (None ), np . float64 ), np . float64 )
635
633
check (assert_type (shapely .get_z ([P ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
636
634
check (assert_type (shapely .get_z ([None ]), NDArray [np .float64 ]), np .ndarray , dtype = float )
637
635
check (assert_type (shapely .get_z ((P , None )), NDArray [np .float64 ]), np .ndarray , dtype = float )
@@ -658,17 +656,17 @@ def test_linestring_getset() -> None:
658
656
check (assert_type (shapely .get_point (LS , [0 ]), NDArray [np .object_ ]), np .ndarray , dtype = Point )
659
657
check (assert_type (shapely .get_point ([LS ], [0 ]), NDArray [np .object_ ]), np .ndarray , dtype = Point )
660
658
661
- check (assert_type (shapely .get_num_points (LS ), int ), np .integer )
662
- check (assert_type (shapely .get_num_points (P ), int ), np .integer )
663
- check (assert_type (shapely .get_num_points (None ), int ), np .integer )
664
- check (assert_type (shapely .get_num_points ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
659
+ check (assert_type (shapely .get_num_points (LS ), np . int32 ), np .int32 )
660
+ check (assert_type (shapely .get_num_points (P ), np . int32 ), np .int32 )
661
+ check (assert_type (shapely .get_num_points (None ), np . int32 ), np .int32 )
662
+ check (assert_type (shapely .get_num_points ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32 )
665
663
check (
666
- assert_type (shapely .get_num_points ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .integer
664
+ assert_type (shapely .get_num_points ([None ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32
667
665
)
668
666
check (
669
667
assert_type (shapely .get_num_points ((P , None )), NDArray [np .int64 ]),
670
668
np .ndarray ,
671
- dtype = np .integer ,
669
+ dtype = np .int32 ,
672
670
)
673
671
674
672
@@ -735,23 +733,23 @@ def test_polygon_getset() -> None:
735
733
dtype = LinearRing ,
736
734
)
737
735
738
- check (assert_type (shapely .get_num_interior_rings (PO ), int ), np .integer )
739
- check (assert_type (shapely .get_num_interior_rings (P ), int ), np .integer )
740
- check (assert_type (shapely .get_num_interior_rings (None ), int ), np .integer )
736
+ check (assert_type (shapely .get_num_interior_rings (PO ), np . int32 ), np .int32 )
737
+ check (assert_type (shapely .get_num_interior_rings (P ), np . int32 ), np .int32 )
738
+ check (assert_type (shapely .get_num_interior_rings (None ), np . int32 ), np .int32 )
741
739
check (
742
740
assert_type (shapely .get_num_interior_rings ([P ]), NDArray [np .int64 ]),
743
741
np .ndarray ,
744
- dtype = np .integer ,
742
+ dtype = np .int32 ,
745
743
)
746
744
check (
747
745
assert_type (shapely .get_num_interior_rings ([None ]), NDArray [np .int64 ]),
748
746
np .ndarray ,
749
- dtype = np .integer ,
747
+ dtype = np .int32 ,
750
748
)
751
749
check (
752
750
assert_type (shapely .get_num_interior_rings ((P , None )), NDArray [np .int64 ]),
753
751
np .ndarray ,
754
- dtype = np .integer ,
752
+ dtype = np .int32 ,
755
753
)
756
754
757
755
@@ -787,23 +785,21 @@ def test_collection_getset() -> None:
787
785
assert_type (shapely .get_geometry ([MP ], [0 ]), NDArray [np .object_ ]), np .ndarray , dtype = Point
788
786
)
789
787
790
- check (assert_type (shapely .get_num_geometries (MP ), int ), np .integer )
791
- check (assert_type (shapely .get_num_geometries (P ), int ), np .integer )
792
- check (assert_type (shapely .get_num_geometries (None ), int ), np .integer )
788
+ check (assert_type (shapely .get_num_geometries (MP ), np . int32 ), np .int32 )
789
+ check (assert_type (shapely .get_num_geometries (P ), np . int32 ), np .int32 )
790
+ check (assert_type (shapely .get_num_geometries (None ), np . int32 ), np .int32 )
793
791
check (
794
- assert_type (shapely .get_num_geometries ([P ]), NDArray [np .int64 ]),
795
- np .ndarray ,
796
- dtype = np .integer ,
792
+ assert_type (shapely .get_num_geometries ([P ]), NDArray [np .int64 ]), np .ndarray , dtype = np .int32
797
793
)
798
794
check (
799
795
assert_type (shapely .get_num_geometries ([None ]), NDArray [np .int64 ]),
800
796
np .ndarray ,
801
- dtype = np .integer ,
797
+ dtype = np .int32 ,
802
798
)
803
799
check (
804
800
assert_type (shapely .get_num_geometries ((P , None )), NDArray [np .int64 ]),
805
801
np .ndarray ,
806
- dtype = np .integer ,
802
+ dtype = np .int32 ,
807
803
)
808
804
809
805
check (assert_type (shapely .get_parts (P ), NDArray [np .object_ ]), np .ndarray , dtype = Point )
@@ -825,7 +821,7 @@ def test_collection_getset() -> None:
825
821
dtype = np .ndarray ,
826
822
)
827
823
check (assert_type (parts_with_index [0 ], NDArray [np .object_ ]), np .ndarray , dtype = BaseGeometry )
828
- check (assert_type (parts_with_index [1 ], NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
824
+ check (assert_type (parts_with_index [1 ], NDArray [np .int64 ]), np .ndarray , dtype = np .int64 )
829
825
check (
830
826
assert_type (
831
827
shapely .get_parts (None , return_index = True ),
@@ -871,7 +867,7 @@ def test_collection_getset() -> None:
871
867
dtype = np .ndarray ,
872
868
)
873
869
check (assert_type (parts_with_index [0 ], NDArray [np .object_ ]), np .ndarray , dtype = LinearRing )
874
- check (assert_type (parts_with_index [1 ], NDArray [np .int64 ]), np .ndarray , dtype = np .integer )
870
+ check (assert_type (parts_with_index [1 ], NDArray [np .int64 ]), np .ndarray , dtype = np .int64 )
875
871
check (
876
872
assert_type (
877
873
shapely .get_rings (None , return_index = True ),
0 commit comments