Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: Soft-deprecate Transformer.from_proj #1196

Merged
merged 1 commit into from Dec 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions pyproj/transformer.py
Expand Up @@ -319,7 +319,7 @@ def __init__(
ProjError.clear()
raise ProjError(
"Transformer must be initialized using: "
"'from_crs', 'from_pipeline', or 'from_proj'."
"'from_crs' or 'from_pipeline'."
)

self._local = TransformerLocal()
Expand Down Expand Up @@ -500,6 +500,8 @@ def from_proj(
) -> "Transformer":
"""Make a Transformer from a :obj:`pyproj.Proj` or input used to create one.

.. deprecated:: 3.4.1 :meth:`~Transformer.from_crs` is preferred.

.. versionadded:: 2.2.0 always_xy
.. versionadded:: 2.3.0 area_of_interest

Expand Down Expand Up @@ -781,7 +783,7 @@ def transform( # pylint: disable=invalid-name
>>> xpjr, ypjr, zpjr = transprojr.transform(xpj, ypj, zpj, radians=True)
>>> f"{xpjr:.3f} {ypjr:.3f} {zpjr:.3f}"
'-2704026.010 -4253051.810 3895878.820'
>>> transformer = Transformer.from_proj("EPSG:4326", 4326)
>>> transformer = Transformer.from_crs("EPSG:4326", 4326)
>>> xeq, yeq = transformer.transform(33, 98)
>>> f"{xeq:.0f} {yeq:.0f}"
'33 98'
Expand Down Expand Up @@ -897,7 +899,7 @@ def itransform(
... ):
... '{:.3f} {:.3f} {:.3f}'.format(*pt)
'-2704214.394 -4254414.478 3894270.731'
>>> transproj_eq = Transformer.from_proj(
>>> transproj_eq = Transformer.from_crs(
... 'EPSG:4326',
... '+proj=longlat +datum=WGS84 +no_defs +type=crs',
... always_xy=True,
Expand Down