Skip to content

Commit

Permalink
Update ndarray deprecation warning to 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo0628 committed Jan 6, 2023
1 parent 77b4878 commit b9c2aac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions python/taichi/types/ndarray_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ def __init__(self,
element_dim=None,
element_shape=None,
field_dim=None):
# TODO(Haidong) Deprecate element shape in 1.4.0. Use dtype to manage element-level arguments.
# TODO(Haidong) Deprecate element shape in 1.5.0. Use dtype to manage element-level arguments.
if element_dim is not None or element_shape is not None:
warnings.warn(
"The element_dim and element_shape arguments for ndarray will be deprecated in v1.4.0, use matrix dtype instead.",
"The element_dim and element_shape arguments for ndarray will be deprecated in v1.5.0, use matrix dtype instead.",
DeprecationWarning)
self.dtype = _make_matrix_dtype_from_element_shape(
element_dim, element_shape, dtype)
Expand All @@ -87,7 +87,7 @@ def __init__(self,

if field_dim is not None:
warnings.warn(
"The field_dim argument for ndarray will be deprecated in v1.4.0, use ndim instead.",
"The field_dim argument for ndarray will be deprecated in v1.5.0, use ndim instead.",
DeprecationWarning)
if ndim is not None:
raise ValueError(
Expand Down
6 changes: 3 additions & 3 deletions tests/python/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_deprecate_element_shape_ndarray_annotation():
with pytest.warns(
DeprecationWarning,
match=
'The element_dim and element_shape arguments for ndarray will be deprecated in v1.4.0, use matrix dtype instead.'
'The element_dim and element_shape arguments for ndarray will be deprecated in v1.5.0, use matrix dtype instead.'
):

@ti.kernel
Expand All @@ -50,7 +50,7 @@ def test_deprecate_element_dim_ndarray_annotation():
with pytest.warns(
DeprecationWarning,
match=
'The element_dim and element_shape arguments for ndarray will be deprecated in v1.4.0, use matrix dtype instead.'
'The element_dim and element_shape arguments for ndarray will be deprecated in v1.5.0, use matrix dtype instead.'
):

@ti.kernel
Expand All @@ -63,7 +63,7 @@ def test_deprecate_field_dim_ndarray_annotation():
with pytest.warns(
DeprecationWarning,
match=
"The field_dim argument for ndarray will be deprecated in v1.4.0, use ndim instead."
"The field_dim argument for ndarray will be deprecated in v1.5.0, use ndim instead."
):

@ti.kernel
Expand Down

0 comments on commit b9c2aac

Please sign in to comment.