Skip to content

Commit c5f478e

Browse files
committed
Deprecated some coordinate transformation usage
1 parent 56227fd commit c5f478e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

pde/grids/base.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,13 @@ def point_to_cartesian(
697697
Returns:
698698
:class:`~numpy.ndarray`: The Cartesian coordinates of the point
699699
"""
700-
if not full:
700+
if full:
701+
# Deprecated on 2024-01-31
702+
warnings.warn(
703+
"`full=True` is deprecated. Use `grid.c.pos_to_cart` instead",
704+
DeprecationWarning,
705+
)
706+
else:
701707
points = self._coords_full(points)
702708
return self.c.pos_to_cart(points)
703709

@@ -717,6 +723,11 @@ def point_from_cartesian(
717723
"""
718724
points_sph = self.c.pos_from_cart(points)
719725
if full:
726+
# Deprecated since 2024-01-31
727+
warnings.warn(
728+
"`full=True` is deprecated. Use `grid.c.pos_from_cart` instead",
729+
DeprecationWarning,
730+
)
720731
return points_sph
721732
else:
722733
return self._coords_symmetric(points_sph)
@@ -916,6 +927,13 @@ def transform(
916927
Returns:
917928
:class:`~numpy.ndarray`: The transformed coordinates
918929
"""
930+
if full:
931+
# Deprecated since 2024-01-31
932+
warnings.warn(
933+
"`full=True` is deprecated. Use `grid.c` methods instead",
934+
DeprecationWarning,
935+
)
936+
919937
if source == "cartesian":
920938
# Cartesian coordinates given
921939
cartesian = np.atleast_1d(coordinates)

0 commit comments

Comments
 (0)