Coverage for pygeodesy/deprecated/classes.py: 97%
70 statements
« prev ^ index » next coverage.py v7.10.7, created at 2026-03-25 15:01 -0400
« prev ^ index » next coverage.py v7.10.7, created at 2026-03-25 15:01 -0400
2# -*- coding: utf-8 -*-
4u'''DEPRECATED classes kept for backward compatibility.
5'''
7from pygeodesy.clipy import ClipCS4Tuple as _ClipCS4Tuple
8from pygeodesy.constants import NAN, _float
9from pygeodesy.interns import NN, _a12_, _area_, _band_, _convergence_, \
10 _distance_, _gamma_, _i_, _lat_, _lon_, _ltp_
11from pygeodesy.deprecated.consterns import _Deprecated_Str
12from pygeodesy.karney import _GTuple, Rhumb8Tuple as _Rhumb8Tuple, ADict
13from pygeodesy.lazily import _ALL_DEPRECATED, _ALL_DOCS, _ALL_MODS as _MODS
14from pygeodesy.ltpTuples import Ned4Tuple as _Ned4Tuple
15# from pygeodesy.named import ADict, _NamedTuple # from .karney, .namedTuples
16from pygeodesy.namedTuples import Forward4Tuple as _Forward4Tuple, \
17 Reverse4Tuple as _Reverse4Tuple, \
18 UtmUps5Tuple as _UtmUps5Tuple, _NamedTuple
19from pygeodesy.props import deprecated_class, deprecated_method
20from pygeodesy.resections import TriAngle5Tuple as _TriAngle5Tuple
21from pygeodesy.triaxials import Conformal, ConformalSphere, Conformal2Tuple
22from pygeodesy.trf import TRFXform7Tuple as _TRFXform7Tuple
23from pygeodesy.units import Bearing, Int, Lamd, Lat, Lon, Meter, Phid
25__all__ = _ALL_DEPRECATED.deprecated_classes
26__version__ = '25.11.11'
29class _Deprecated_NamedTuple(_NamedTuple):
30 '''DEPRECATED, C{_NamedTuple} base.
31 '''
32 def __new__(cls, *args, **kwds):
33 deprecated_class(cls)
34 return _NamedTuple.__new__(cls, *args, **kwds)
37def _reNames(names, old, *new):
38 # replace item C{old} with C{new} name
39 i = names.index(old)
40 return names[:i] + new + names[i + 1:]
43class ClipCS3Tuple(_Deprecated_NamedTuple): # PYCHOK no cover
44 '''DEPRECATED, see I{DEPRECATED} function L{pygeodesy.deprecated.clipCS3}.'''
45 assert _ClipCS4Tuple._Names_.index(_i_) == 2
46 _Names_ = _reNames(_ClipCS4Tuple._Names_[:3], _i_, 'index')
47 _Units_ = _ClipCS4Tuple._Units_[:3]
50class ConformalTriaxial(Conformal):
51 '''DEPRECATED on 2025.11.11, use class L{Conformal}.'''
52 def __init__(self, *args, **kwds): # PYCHOK no cover
53 deprecated_class(self.__class__)
54 Conformal.__init__(self, *args, **kwds)
57class EasNorExact4Tuple(_Deprecated_NamedTuple):
58 '''DEPRECATED, use class L{Forward4Tuple}, item C{gamma} for C{convergence}.'''
59 _Names_ = _reNames(_Forward4Tuple._Names_, _gamma_, _convergence_)
60 _Units_ = _Forward4Tuple._Units_
63def EcefCartesian(*args, **kwds):
64 '''DEPRECATED, use class L{LocalCartesian}.'''
65 Ltp = _MODS.ltp.Ltp
67 class EcefCartesian_(Ltp):
68 '''DEPRECATED, use class L{LocalCartesian} or L{Ltp}.
70 @note: This class is named I{incorrectly}, since it provides conversion to
71 and from I{local} cartesian coordinates in a I{local tangent plane}
72 and I{not geocentric} (ECEF) ones, as the name would suggest.
73 '''
74 def __init__(self, latlonh0=0, lon0=0, height0=0, ecef=None, name=NN):
75 deprecated_class(self.__class__)
76 Ltp.__init__(self, latlonh0=latlonh0, lon0=lon0, height0=height0, ecef=ecef, name=name)
78 @deprecated_method
79 def forward(self, latlonh, lon=None, height=0, M=False, name=NN):
80 '''DEPRECATED, use method L{LocalCartesian.forward} or L{Ltp.forward}.
82 @return: I{Incorrectly}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C,
83 M, datum)} with I{local} C{(x, y, z)} coordinates for the given
84 I{geodetic} ones C{(lat, lon, height)}, case C{C=0} always,
85 optionally I{concatenated} L{EcefMatrix} C{M} and C{datum}.
86 '''
87 t = Ltp.forward(self, latlonh, lon=lon, height=height, M=M, name=name)
88 return _MODS.ecef.Ecef9Tuple(t.x, t.y, t.z, t.lat, t.lon, t.height,
89 0, t.M, t.ecef.datum,
90 name=t.name or self.name)
92 @deprecated_method
93 def reverse(self, xyz, y=None, z=None, M=False, name=NN):
94 '''DEPRECATED, use method L{LocalCartesian.reverse} or L{Ltp.reverse}.
96 @return: I{Incorrectly}, an L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C,
97 M, datum)} with I{geodetic} coordinates C{(lat, lon, height)} for
98 the given I{local} ones C{(x, y, z)}, case C{C}, optionally
99 I{concatenated} L{EcefMatrix} C{M} and C{datum}.
100 '''
101 t = Ltp.reverse(self, xyz, y=y, z=z, M=M, name=name)
102 return _MODS.ecef.Ecef9Tuple(t.x, t.y, t.z, t.lat, t.lon, t.height,
103 t.ecef.C, t.M, t.ecef.datum,
104 name=t.name or self.name)
106 return EcefCartesian_(*args, **kwds)
109def Fn_rt(root, *xs, **name_RESIDUAL_raiser): # PYCHOK no cover
110 '''DEPRECATED on 2024.04.17, use class L{Froot}.
111 '''
112 Froot = _MODS.fmath.Froot
114 class Fn_rt(Froot): # PYCHOK no cover
115 '''DEPRECATED on 2024.04.17, use class L{Froot}.
116 '''
117 def __init__(self, root, *xs, **name_RESIDUAL_raiser):
118 deprecated_class(self.__class__)
119 Froot.__init__(self, root, *xs, **name_RESIDUAL_raiser)
122def FrechetCosineAndoyerLambert(point1s, **kwds): # PYCHOK no cover
123 '''DEPRECATED on 2024.12.31, use class L{FrechetCosineLaw} with C{B{corr}=1}.'''
124 FrechetCosineLaw = _MODS.frechet.FrechetCosineLaw
126 class FrechetCosineAndoyerLambert(FrechetCosineLaw):
127 '''DEPRECATED on 2024.12.31, use class L{FrechetCosineLaw} with C{B{corr}=1}.
128 '''
129 def __init__(self, point1s, **seed_name__radius_wrap):
130 deprecated_class(self.__class__)
131 FrechetCosineLaw.__init__(self, point1s, corr=1, **seed_name__radius_wrap)
133 return FrechetCosineAndoyerLambert(point1s, **kwds)
136def FrechetCosineForsytheAndoyerLambert(point1s, **kwds): # PYCHOK no cover
137 '''DEPRECATED on 2024.12.31, use class L{FrechetCosineLaw} with C{B{corr}=2}.'''
138 FrechetCosineLaw = _MODS.frechet.FrechetCosineLaw
140 class FrechetCosineForsytheAndoyerLambert(FrechetCosineLaw):
141 '''DEPRECATED on 2024.12.31, use class L{FrechetCosineLaw} with C{B{corr}=w}.
142 '''
143 def __init__(self, point1s, **seed_name__radius_wrap):
144 deprecated_class(self.__class__)
145 FrechetCosineLaw.__init__(self, point1s, corr=2, **seed_name__radius_wrap)
147 return FrechetCosineForsytheAndoyerLambert(point1s, **kwds)
150def HausdorffCosineAndoyerLambert(point1s, **kwds): # PYCHOK no cover
151 '''DEPRECATED on 2024.12.31, use class L{HausdorffCosineLaw} with C{B{corr}=1}.'''
152 HausdorffCosineLaw = _MODS.hausdorff.HausdorffCosineLaw
154 class HausdorffCosineAndoyerLambert(HausdorffCosineLaw):
155 '''DEPRECATED on 2024.12.31, use class L{HausdorffCosineLaw} with C{B{corr}=1}.
156 '''
157 def __init__(self, point1s, **seed_name__radius_wrap):
158 deprecated_class(self.__class__)
159 HausdorffCosineLaw.__init__(self, point1s, corr=1, **seed_name__radius_wrap)
161 return HausdorffCosineAndoyerLambert(point1s, **kwds)
164def HausdorffCosineForsytheAndoyerLambert(point1s, **kwds): # PYCHOK no cover
165 '''DEPRECATED on 2024.12.31, use class L{HausdorffCosineLaw} with C{B{corr}=2}.'''
166 HausdorffCosineLaw = _MODS.hausdorff.HausdorffCosineLaw
168 class HausdorffCosineForsytheAndoyerLambert(HausdorffCosineLaw):
169 '''DEPRECATED on 2024.12.31, use class L{HausdorffCosineLaw} with C{B{corr}=2}
170 '''
171 def __init__(self, point1s, **seed_name__radius_wrap):
172 deprecated_class(self.__class__)
173 HausdorffCosineLaw.__init__(self, point1s, corr=2, **seed_name__radius_wrap)
175 return HausdorffCosineForsytheAndoyerLambert(point1s, **kwds)
178def HeightIDW(knots, **kwds): # PYCHOK no cover
179 '''DEPRECATED, use class L{HeightIDWeuclidean}.'''
180 HeightIDWeuclidean = _MODS.heights.HeightIDWeuclidean
182 class HeightIDW(HeightIDWeuclidean):
183 '''DEPRECATED, use class L{HeightIDWeuclidean}.'''
184 def __init__(self, knots, adjust=True, beta=2, name=NN):
185 deprecated_class(self.__class__)
186 HeightIDWeuclidean.__init__(self, knots, adjust=adjust, beta=beta, name=name)
188 return HeightIDW(knots, **kwds)
191def HeightIDW2(knots, **kwds): # PYCHOK no cover
192 '''DEPRECATED, use class L{HeightIDWequirectangular}.'''
193 HeightIDWequirectangular = _MODS.heights.HeightIDWequirectangular
195 class HeightIDW2(HeightIDWequirectangular):
196 '''DEPRECATED, use class L{HeightIDWequirectangular}.'''
197 def __init__(self, knots, adjust=True, wrap=False, name=NN):
198 deprecated_class(self.__class__)
199 HeightIDWequirectangular.__init__(self, knots, adjust=adjust, wrap=wrap, name=name)
201 return HeightIDW2(knots, **kwds)
204def HeightIDW3(knots, **kwds): # PYCHOK no cover
205 '''DEPRECATED, use class L{HeightIDWhaversine}.'''
206 HeightIDWhaversine = _MODS.heights.HeightIDWhaversine
208 class HeightIDW3(HeightIDWhaversine):
209 '''DEPRECATED, use class L{HeightIDWhaversine}.
210 '''
211 def __init__(self, knots, beta=2, wrap=False, name=NN):
212 deprecated_class(self.__class__)
213 HeightIDWhaversine.__init__(self, knots, beta=beta, wrap=wrap, name=name)
215 return HeightIDW3(knots, **kwds)
218def HeightIDWcosineAndoyerLambert(knots, **kwds): # PYCHOK no cover
219 '''DEPRECATED on 2024.12.31, use class L{HeightIDWcosineLaw} with C{B{corr}=1}.'''
220 HeightIDWcosineLaw = _MODS.heights.HeightIDWcosineLaw
222 class HeightIDWcosineAndoyerLambert(HeightIDWcosineLaw):
223 '''DEPRECATED on 2024.12.31, use class L{HeightIDWcosineLaw} with C{B{corr}=1}.
224 '''
225 def __init__(self, knots, **beta_name__datum_wrap):
226 deprecated_class(self.__class__)
227 HeightIDWcosineLaw.__init__(self, knots, corr=1, **beta_name__datum_wrap)
229 return HeightIDWcosineAndoyerLambert(knots, **kwds)
232def HeightIDWcosineForsytheAndoyerLambert(knots, **kwds): # PYCHOK no cover
233 '''DEPRECATED on 2024.12.31, use class L{HeightIDWcosineLaw} with C{B{corr}=2}.'''
234 HeightIDWcosineLaw = _MODS.heights.HeightIDWcosineLaw
236 class HeightIDWcosineForsytheAndoyerLambert(HeightIDWcosineLaw):
237 '''DEPRECATED on 2024.12.31, use class L{HeightIDWcosineLaw} with C{B{corr}=2}.
238 '''
239 def __init__(self, knots, **beta_name__datum_wrap):
240 deprecated_class(self.__class__)
241 HeightIDWcosineLaw.__init__(self, knots, corr=2, **beta_name__datum_wrap)
243 return HeightIDWcosineForsytheAndoyerLambert(knots, **kwds)
246class JacobiConformal(Conformal):
247 '''DEPRECATED on 2025.10.25, use class L{Conformal}.'''
248 def __init__(self, *args, **kwds): # PYCHOK no cover
249 deprecated_class(self.__class__)
250 Conformal.__init__(self, *args, **kwds)
253class JacobiConformalSpherical(ConformalSphere):
254 '''DEPRECATED on 2025.10.25, use class L{ConformalSphere}.'''
255 def __init__(self, *args, **kwds): # PYCHOK no cover
256 deprecated_class(self.__class__)
257 ConformalSphere.__init__(self, *args, **kwds)
260class Jacobi2Tuple(Conformal2Tuple):
261 '''DEPRECATED on 25.11.11, use class L{Conformal2Tuple}.
262 '''
263 def __new__(cls, *args, **kwds):
264 deprecated_class(cls)
265 return Conformal2Tuple.__new__(cls, *args, **kwds)
268class Lam_(Lamd):
269 '''DEPRECATED on 2024.06.15, use class L{Lamd}.'''
270 def __init__(self, *args, **kwds): # PYCHOK no cover
271 deprecated_class(self.__class__)
272 Lamd.__init__(self, *args, **kwds)
275class LatLonExact4Tuple(_Deprecated_NamedTuple):
276 '''DEPRECATED, use class L{Reverse4Tuple}, item C{gamma} for C{convergence}.'''
277 _Names_ = _reNames(_Reverse4Tuple._Names_, _gamma_, _convergence_)
278 _Units_ = _Reverse4Tuple._Units_
281class NearestOn4Tuple(_Deprecated_NamedTuple): # PYCHOK no cover
282 '''DEPRECATED on 2023.10.10, see methods L{RhumbLine.nearestOn4} and L{RhumbLineAux.nearestOn4}.'''
283 _Names_ = (_lat_, _lon_, _distance_, 'normal') # s12, azi02
284 _Units_ = ( Lat, Lon, Meter, Bearing)
287class Phi_(Phid):
288 '''DEPRECATED on 2024.06.15, use class L{Phid}.'''
289 def __init__(self, *args, **kwds): # PYCHOK no cover
290 deprecated_class(self.__class__)
291 Phid.__init__(self, *args, **kwds)
294class Ned3Tuple(_Deprecated_NamedTuple): # was in .ellipsoidalNvector
295 '''DEPRECATED, use class L{Ned4Tuple}, ignoring item C{ltp}.'''
296 assert _Ned4Tuple._Names_.index(_ltp_) == 3
297 _Names_ = _Ned4Tuple._Names_[:3]
298 _Units_ = _Ned4Tuple._Units_[:3]
301def RefFrameError(*args, **kwds): # PYCHOK no cover
302 '''DEPRECATED, use class L{TRFError}.'''
303 TRFError = _MODS.errors.TRFError
305 class RefFrameError(TRFError):
306 '''DEPRECATED, use class L{TRFError}.
307 '''
308 def __init__(self, *name_value, **txt_name_values):
309 deprecated_class(self.__class__)
310 TRFError.__init__(self, *name_value, **txt_name_values)
312 return RefFrameError(*args, **kwds)
315class Rhumb7Tuple(_Deprecated_NamedTuple):
316 '''DEPRECATED, use class L{Rhumb8Tuple}, ignoring item C{a12}.'''
317 assert _Rhumb8Tuple._Names_.index(_a12_) == 7
318 _Names_ = _Rhumb8Tuple._Names_[:7]
319 _Units_ = _Rhumb8Tuple._Units_[:7]
321 @deprecated_method
322 def toDirect9Tuple(self, **kwds): # PYCHOK no cover
323 return self.toRhumb8Tuple().toDirect9Tuple(self, **kwds)
325 @deprecated_method
326 def toGDict(self, **kwds): # PYCHOK no cover
327 return self.toRhumb8Tuple().toGDict(**kwds)
329 @deprecated_method
330 def toInverse10Tuple(self, **kwds): # PYCHOK no cover
331 return self.toRhumb8Tuple().toInverse10Tuple(self, **kwds)
333 @deprecated_method
334 def toRhumb8Tuple(self, dflt=NAN): # PYCHOK no cover
335 return _Rhumb8Tuple(self + (dflt,), name=self.name)
337 def _to7Tuple(self): # PYCHOK no cover
338 '''(INTERNAL) see L{Rhumb8Tuple._to7Tuple}.
339 '''
340 return self
343class RhumbOrder2Tuple(_Deprecated_NamedTuple, _GTuple):
344 '''DEPRECATED, see deprecated method L{Rhumb.orders}.'''
345 # 2-Tuple C{(RAorder, TMorder)} with a I{Rhumb Area} and
346 # I{Transverse Mercator} order, both C{int}.
347 _Names_ = ('RAorder', 'TMorder')
348 _Units_ = ( Int, Int)
351class Transform7Tuple(_Deprecated_NamedTuple): # PYCHOK no cover
352 '''DEPRECATED on 2024.02.02, use class L{TRFXform7Tuple}, I{without} keyword arguments.'''
353 _Names_ = _TRFXform7Tuple._Names_
354 _Units_ = _TRFXform7Tuple._Units_
356 def __new__(cls, tx=0, ty=0, tz=0, s=0,
357 sx=0, sy=0, sz=0, name=NN):
358 t = map(_float, (tx, ty, tz, s, sx, sy, sz))
359 return _Deprecated_NamedTuple.__new__(cls, *t, name=name)
361Helmert7Tuple = Transform7Tuple # PYCHOK likewise
364class TriAngle4Tuple(_Deprecated_NamedTuple):
365 '''DEPRECATED on 2023.09.14, use class L{TriAngle5Tuple}, ignoring item C{area}.'''
366 assert _TriAngle5Tuple._Names_.index(_area_) == 4
367 _Names_ = _TriAngle5Tuple._Names_[:4]
368 _Units_ = _TriAngle5Tuple._Units_[:4]
371class UtmUps4Tuple(_Deprecated_NamedTuple): # PYCHOK no cover
372 '''DEPRECATED and OBSOLETE, expect a L{UtmUps5Tuple} from method C{pygeodesy.Mgrs.toUtm(utm=None)}.
374 4-Tuple C{(zone, hemipole, easting, northing)} with as C{zone} B{C{str}} and no C{band}.
375 '''
376 assert _UtmUps5Tuple._Names_.index(_band_) == 4
377 _Names_ = _UtmUps5Tuple._Names_[ :4] # band
378 _Units_ = (_Deprecated_Str,) + _UtmUps5Tuple._Units_[1:4]
381class XDist(ADict):
382 '''DEPRECATED on 2024.07.02, use class L{ADict}.'''
383 def __init__(self, *args, **kwds): # PYCHOK no cover
384 deprecated_class(self.__class__)
385 ADict.__init__(self, *args, **kwds)
388__all__ += _ALL_DOCS(_Deprecated_NamedTuple)
390# **) MIT License
391#
392# Copyright (C) 2018-2026 -- mrJean1 at Gmail -- All Rights Reserved.
393#
394# Permission is hereby granted, free of charge, to any person obtaining a
395# copy of this software and associated documentation files (the "Software"),
396# to deal in the Software without restriction, including without limitation
397# the rights to use, copy, modify, merge, publish, distribute, sublicense,
398# and/or sell copies of the Software, and to permit persons to whom the
399# Software is furnished to do so, subject to the following conditions:
400#
401# The above copyright notice and this permission notice shall be included
402# in all copies or substantial portions of the Software.
403#
404# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
405# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
406# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
407# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
408# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
409# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
410# OTHER DEALINGS IN THE SOFTWARE.