Skip to content

Commit e277f9f

Browse files
Remove ndx.promote_nullable and fix docs (#100)
1 parent 86ada1b commit e277f9f

File tree

6 files changed

+9
-17
lines changed

6 files changed

+9
-17
lines changed

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
Changelog
88
=========
99

10+
0.10.0 (unreleased)
11+
-------------------
12+
13+
- Removed the deprecated :func:`ndonnx.promote_nullable` function. Use :func:`ndonnx.additional.make_nullable` instead.
14+
15+
1016
0.9.3 (2024-10-25)
1117
------------------
1218

ndonnx/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
NullableIntegral,
2020
NullableNumerical,
2121
Numerical,
22-
promote_nullable,
2322
from_numpy_dtype,
2423
bool,
2524
float32,

ndonnx/_core/_numericimpl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ def _determine_reduce_op_dtype(
10201020
raise TypeError(f"Cannot reduce {x.dtype} to a smaller unsigned dtype")
10211021
elif isinstance(x.dtype, dtypes.NullableUnsigned):
10221022
if ndx.iinfo(x.dtype).bits <= ndx.iinfo(maximum_unsigned_dtype).bits:
1023-
return dtypes.promote_nullable(maximum_unsigned_dtype)
1023+
return dtypes.into_nullable(maximum_unsigned_dtype)
10241024
else:
10251025
raise TypeError(f"Cannot reduce {x.dtype} to a smaller unsigned dtype")
10261026
elif isinstance(x.dtype, dtypes.Integral):

ndonnx/_data_types/__init__.py

-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# SPDX-License-Identifier: BSD-3-Clause
33

44
from __future__ import annotations
5-
from ndonnx._utility import deprecated
65
from typing import Union
76
from .aliases import (
87
bool,
@@ -102,14 +101,6 @@ def into_nullable(dtype: StructType | CoreType) -> NullableCore:
102101
Dtype = Union[CoreType, StructType]
103102

104103

105-
@deprecated(
106-
"Function 'ndonnx.promote_nullable' will be deprecated in ndonnx 0.7. "
107-
"To create nullable array, use 'ndonnx.additional.make_nullable' instead."
108-
)
109-
def promote_nullable(dtype: StructType | CoreType) -> NullableCore:
110-
return into_nullable(dtype)
111-
112-
113104
__all__ = [
114105
"CoreType",
115106
"StructType",
@@ -150,7 +141,6 @@ def promote_nullable(dtype: StructType | CoreType) -> NullableCore:
150141
"nutf8",
151142
"get_finfo",
152143
"get_iinfo",
153-
"promote_nullable",
154144
"Schema",
155145
"CastMixin",
156146
"CastError",

ndonnx/_funcs.py

+2
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,12 @@ def _unary(func, x):
986986
"trunc",
987987
"matmul",
988988
"matrix_transpose",
989+
"tensordot",
989990
"concat",
990991
"expand_dims",
991992
"flip",
992993
"permute_dims",
994+
"repeat",
993995
"reshape",
994996
"roll",
995997
"squeeze",

tests/test_core.py

-5
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,6 @@ def test_array_creation_with_invalid_fields():
658658
)
659659

660660

661-
def test_promote_nullable():
662-
with pytest.warns(DeprecationWarning):
663-
assert ndx.promote_nullable(np.int64) == ndx.nint64
664-
665-
666661
@pytest.mark.parametrize(
667662
"operation", [ndx.sin, ndx.cos, ndx.tan, ndx.sinh, ndx.mean, ndx.sum, ndx.abs]
668663
)

0 commit comments

Comments
 (0)