File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1219,7 +1219,7 @@ impl<T: Element + AsPrimitive<f64>> PyArray<T, Ix1> {
1219
1219
start. as_ ( ) ,
1220
1220
stop. as_ ( ) ,
1221
1221
step. as_ ( ) ,
1222
- T :: get_dtype ( py) . get_typenum ( ) ,
1222
+ T :: get_dtype ( py) . num ( ) ,
1223
1223
) ;
1224
1224
Self :: from_owned_ptr ( py, ptr)
1225
1225
}
Original file line number Diff line number Diff line change @@ -94,10 +94,13 @@ impl PyArrayDescr {
94
94
}
95
95
}
96
96
97
- /// Retrieves the
98
- /// [enumerated type](https://numpy.org/doc/stable/reference/c-api/dtype.html#enumerated-types)
99
- /// for this type descriptor.
100
- pub fn get_typenum ( & self ) -> c_int {
97
+ /// Returns a unique number for each of the 21 different built-in
98
+ /// [enumerated types](https://numpy.org/doc/stable/reference/c-api/dtype.html#enumerated-types).
99
+ ///
100
+ /// These are roughly ordered from least-to-most precision.
101
+ ///
102
+ /// Equivalent to [`np.dtype.num`](https://numpy.org/doc/stable/reference/generated/numpy.dtype.num.html).
103
+ pub fn num ( & self ) -> c_int {
101
104
unsafe { * self . as_dtype_ptr ( ) } . type_num
102
105
}
103
106
}
You can’t perform that action at this time.
0 commit comments