pygeodesy 24.6.24__py2.py3-none-any.whl → 24.7.24__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,8 +28,8 @@ from pygeodesy.named import _name2__, _Pass
28
28
  from pygeodesy.namedTuples import LatLon4Tuple, _NamedTupleTo , Vector3Tuple, \
29
29
  Vector4Tuple, Bearing2Tuple # PYCHOK .sphericalBase
30
30
  # from pygeodesy.nvectorBase import _N_vector # _MODS
31
- from pygeodesy.props import deprecated_method, Property, Property_RO, \
32
- property_doc_, property_RO, _update_all
31
+ from pygeodesy.props import deprecated_method, Property, Property_RO, property_doc_, \
32
+ property_RO, property_ROnce, _update_all
33
33
  # from pygeodesy,resections import cassini, collins5, pierlot, pierlotx, \
34
34
  # tienstra7 # _MODS
35
35
  # from pygeodesy.streprs import Fmt # from .fsums
@@ -43,7 +43,7 @@ from pygeodesy.vector3d import Vector3d, _xyzhdlln4
43
43
  # from math import atan2, degrees, fabs, radians, sqrt # from .fmath, .utily
44
44
 
45
45
  __all__ = _ALL_LAZY.cartesianBase
46
- __version__ = '24.06.11'
46
+ __version__ = '24.07.12'
47
47
 
48
48
  _r_ = 'r'
49
49
  _theta_ = 'theta'
@@ -211,12 +211,11 @@ class CartesianBase(Vector3d):
211
211
  r = Cartesian(*c, **kwds)
212
212
  return r.renamed(n) if n else r
213
213
 
214
- @property_RO
214
+ @property_ROnce
215
215
  def Ecef(self):
216
216
  '''Get the ECEF I{class} (L{EcefKarney}), I{once}.
217
217
  '''
218
- CartesianBase.Ecef = E = _MODS.ecef.EcefKarney # overwrite property_RO
219
- return E
218
+ return _MODS.ecef.EcefKarney
220
219
 
221
220
  @Property_RO
222
221
  def _ecef9(self):
@@ -27,7 +27,7 @@ __all__ = (_ALL_DEPRECATED.deprecated_bases +
27
27
  _ALL_DEPRECATED.deprecated_classes +
28
28
  _ALL_DEPRECATED.deprecated_consterns +
29
29
  _ALL_DEPRECATED.deprecated_functions)
30
- __version__ = '24.06.15'
30
+ __version__ = '24.07.02'
31
31
 
32
32
  if _unLazy0:
33
33
  from pygeodesy.deprecated import bases, datum, nvector, rhumbBase, \
@@ -9,10 +9,10 @@ from pygeodesy.constants import NAN, _float
9
9
  from pygeodesy.interns import NN, _a12_, _area_, _band_, _convergence_, \
10
10
  _distance_, _gamma_, _i_, _lat_, _lon_, _ltp_
11
11
  from pygeodesy.deprecated.consterns import _Deprecated_Str
12
- from pygeodesy.karney import _GTuple, Rhumb8Tuple as _Rhumb8Tuple
12
+ from pygeodesy.karney import _GTuple, Rhumb8Tuple as _Rhumb8Tuple, ADict
13
13
  from pygeodesy.lazily import _ALL_DEPRECATED, _ALL_DOCS, _ALL_MODS as _MODS
14
14
  from pygeodesy.ltpTuples import Ned4Tuple as _Ned4Tuple
15
- # from pygeodesy.named import _NamedTuple # from .namedTuples
15
+ # from pygeodesy.named import ADict, _NamedTuple # from .karney, .namedTuples
16
16
  from pygeodesy.namedTuples import Forward4Tuple as _Forward4Tuple, \
17
17
  Reverse4Tuple as _Reverse4Tuple, \
18
18
  UtmUps5Tuple as _UtmUps5Tuple, _NamedTuple
@@ -22,7 +22,7 @@ from pygeodesy.trf import TRFXform7Tuple as _TRFXform7Tuple
22
22
  from pygeodesy.units import Bearing, Int, Lamd, Lat, Lon, Meter, Phid
23
23
 
24
24
  __all__ = _ALL_DEPRECATED.deprecated_classes
25
- __version__ = '24.06.15'
25
+ __version__ = '24.07.02'
26
26
 
27
27
 
28
28
  class _Deprecated_NamedTuple(_NamedTuple):
@@ -264,6 +264,13 @@ class UtmUps4Tuple(_Deprecated_NamedTuple): # PYCHOK no cover
264
264
  _Units_ = (_Deprecated_Str,) + _UtmUps5Tuple._Units_[1:4]
265
265
 
266
266
 
267
+ class XDist(ADict):
268
+ '''DEPRECATED on 2024.07.02, use class L{XDict}.'''
269
+ def __init__(self, *args, **kwds): # PYCHOK signature
270
+ deprecated_class(self.__class__)
271
+ ADict.__init__(self, *args, **kwds)
272
+
273
+
267
274
  __all__ += _ALL_DOCS(_Deprecated_NamedTuple)
268
275
 
269
276
  # **) MIT License
pygeodesy/ecef.py CHANGED
@@ -76,7 +76,7 @@ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
76
76
  from pygeodesy.named import _name__, _name1__, _NamedBase, _NamedTuple, _Pass, _xnamed
77
77
  from pygeodesy.namedTuples import LatLon2Tuple, LatLon3Tuple, \
78
78
  PhiLam2Tuple, Vector3Tuple, Vector4Tuple
79
- from pygeodesy.props import deprecated_method, Property_RO, property_RO, property_doc_
79
+ from pygeodesy.props import deprecated_method, Property_RO, property_ROver, property_doc_
80
80
  # from pygeodesy.streprs import Fmt, unstr # from .fsums
81
81
  from pygeodesy.units import _isRadius, Degrees, Height, Int, Lam, Lat, Lon, Meter, \
82
82
  Phi, Scalar, Scalar_
@@ -86,7 +86,7 @@ from pygeodesy.utily import atan1, atan1d, atan2d, degrees90, degrees180, \
86
86
  from math import atan2, cos, degrees, fabs, radians, sqrt
87
87
 
88
88
  __all__ = _ALL_LAZY.ecef
89
- __version__ = '24.06.11'
89
+ __version__ = '24.06.12'
90
90
 
91
91
  _Ecef_ = 'Ecef'
92
92
  _prolate_ = 'prolate'
@@ -261,13 +261,12 @@ class _EcefBase(_NamedBase):
261
261
  raise EcefError(phi=phi, lam=lam, height=height, cause=x)
262
262
  return self._forward(*plhn, M=M, _philam=True)
263
263
 
264
- @property_RO
264
+ @property_ROver
265
265
  def _Geocentrics(self):
266
266
  '''(INTERNAL) Get the valid geocentric classes. I{once}.
267
267
  '''
268
- _EcefBase._Geocentrics = t = (Ecef9Tuple, # overwrite property_RO
269
- _MODS.cartesianBase.CartesianBase)
270
- return t
268
+ return (Ecef9Tuple, # overwrite property_ROver
269
+ _MODS.cartesianBase.CartesianBase)
271
270
 
272
271
  @Property_RO
273
272
  def _isYou(self):
@@ -1028,12 +1027,11 @@ class Ecef9Tuple(_NamedTuple):
1028
1027
  _Names_ = (_x_, _y_, _z_, _lat_, _lon_, _height_, _C_, _M_, _datum_)
1029
1028
  _Units_ = ( Meter, Meter, Meter, Lat, Lon, Height, Int, _Pass, _Pass)
1030
1029
 
1031
- @property_RO
1030
+ @property_ROver
1032
1031
  def _CartesianBase(self):
1033
1032
  '''(INTERNAL) Get class C{CartesianBase}, I{once}.
1034
1033
  '''
1035
- Ecef9Tuple._CartesianBase = C = _MODS.cartesianBase.CartesianBase # overwrite property_RO
1036
- return C
1034
+ return _MODS.cartesianBase.CartesianBase # overwrite property_ROver
1037
1035
 
1038
1036
  @deprecated_method
1039
1037
  def convertDatum(self, datum2): # for backward compatibility
pygeodesy/ellipsoids.py CHANGED
@@ -83,7 +83,7 @@ from pygeodesy.named import _lazyNamedEnumItem as _lazy, _name__, _NamedEnum, \
83
83
  _NamedEnumItem, _NamedTuple, _Pass, _ALL_LAZY, _MODS
84
84
  from pygeodesy.namedTuples import Distance2Tuple, Vector3Tuple, Vector4Tuple
85
85
  from pygeodesy.props import deprecated_Property_RO, Property_RO, property_doc_, \
86
- deprecated_property_RO, property_RO
86
+ deprecated_property_RO, property_RO, property_ROver
87
87
  from pygeodesy.streprs import Fmt, fstr, instr, strs, unstr
88
88
  # from pygeodesy.triaxials import _hartzell3 # _MODS
89
89
  from pygeodesy.units import Bearing_, Distance, Float, Float_, Height, Lamd, Lat, Meter, \
@@ -93,7 +93,7 @@ from pygeodesy.utily import atan1, atan1d, atan2b, degrees90, m2radians, radians
93
93
  from math import asinh, atan, atanh, cos, degrees, exp, fabs, radians, sin, sinh, sqrt, tan
94
94
 
95
95
  __all__ = _ALL_LAZY.ellipsoids
96
- __version__ = '24.06.24'
96
+ __version__ = '24.07.16'
97
97
 
98
98
  _f_0_0 = Float(f =_0_0) # zero flattening
99
99
  _f__0_0 = Float(f_=_0_0) # zero inverse flattening
@@ -1029,17 +1029,18 @@ class Ellipsoid(_NamedEnumItem):
1029
1029
  raise _ValueError(exact=g, ellipsoid=E, txt_not_=self.name)
1030
1030
  return g
1031
1031
 
1032
- @property_RO
1032
+ @property_ROver
1033
1033
  def _Geodesics(self):
1034
1034
  '''(INTERNAL) Get all C{Geodesic...} classes, I{once}.
1035
1035
  '''
1036
+ t = (_MODS.geodesicx.GeodesicExact,
1037
+ _MODS.geodsolve.GeodesicSolve)
1036
1038
  try:
1037
- t = _MODS.geodesicw._wrapped.Geodesic,
1039
+ t += (_MODS.geodesicw.Geodesic,
1040
+ _MODS.geodesicw._wrapped.Geodesic)
1038
1041
  except ImportError:
1039
- t = ()
1040
- Ellipsoid._Geodesics = t = (_MODS.geodesicx.GeodesicExact, # overwrite property_RO
1041
- _MODS.geodsolve.GeodesicSolve) + t
1042
- return t
1042
+ pass
1043
+ return t # overwrite propertyROver
1043
1044
 
1044
1045
  @property_RO
1045
1046
  def geodesicw(self):
@@ -1517,14 +1518,13 @@ class Ellipsoid(_NamedEnumItem):
1517
1518
  # raise _IsnotError(_ellipsoidal_, ellipsoid=self)
1518
1519
  return _MODS.rhumb.ekx.Rhumb(self, name=self.name)
1519
1520
 
1520
- @property_RO
1521
+ @property_ROver
1521
1522
  def _Rhumbs(self):
1522
1523
  '''(INTERNAL) Get all C{Rhumb...} classes, I{once}.
1523
1524
  '''
1524
1525
  p = _MODS.rhumb
1525
- Ellipsoid._Rhumbs = t = (p.aux_.RhumbAux, # overwrite property_RO
1526
- p.ekx.Rhumb, p.solve.RhumbSolve)
1527
- return t
1526
+ return (p.aux_.RhumbAux, # overwrite propertyROver
1527
+ p.ekx.Rhumb, p.solve.RhumbSolve)
1528
1528
 
1529
1529
  @property
1530
1530
  def rhumbsolve(self):
pygeodesy/errors.py CHANGED
@@ -27,7 +27,7 @@ from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _getenv, _PYTHON_X_D
27
27
  from copy import copy as _copy
28
28
 
29
29
  __all__ = _ALL_LAZY.errors # _ALL_DOCS('_InvalidError', '_IsnotError') _under
30
- __version__ = '24.06.24'
30
+ __version__ = '24.07.07'
31
31
 
32
32
  _argument_ = 'argument'
33
33
  _box_ = 'box'
@@ -827,6 +827,15 @@ def _xkwds_item2(kwds):
827
827
  raise _xAssertionError(_xkwds_item2, kwds)
828
828
 
829
829
 
830
+ def _xkwds_kwds(kwds, **names_defaults):
831
+ '''(INTERNAL) Return a C{dict} of C{named_defaults} items replaced with C{kwds}.
832
+ '''
833
+ if not isinstance(kwds, dict):
834
+ raise _xAssertionError(_xkwds_get_, kwds)
835
+ _g = kwds.get
836
+ return dict((n, _g(n, v)) for n, v in names_defaults.items())
837
+
838
+
830
839
  def _xkwds_not(*args, **kwds):
831
840
  '''(INTERNAL) Return C{kwds} with a value not in C{args}.
832
841
  '''
pygeodesy/fsums.py CHANGED
@@ -273,11 +273,17 @@ def _stresidual(prefix, residual, R=0, **mod_ratio):
273
273
  def _2sum(a, b): # by .testFmath
274
274
  '''(INTERNAL) Return C{a + b} as 2-tuple (sum, residual).
275
275
  '''
276
+ # Neumaier, A. U{Rundungsfehleranalyse einiger Verfahren zur Summation endlicher
277
+ # Summen<https://OnlineLibrary.Wiley.com/doi/epdf/10.1002/zamm.19740540106>},
278
+ # 1974, Zeitschrift für Angewandte Mathmatik und Mechanik, vol 51, nr 1, p 39-51
279
+ # <https://StackOverflow.com/questions/78633770/can-neumaier-summation-be-sped-up>
276
280
  s = a + b
277
281
  if _isfinite(s):
278
282
  if fabs(a) < fabs(b):
279
- b, a = a, b
280
- return s, (b - (s - a))
283
+ r = (b - s) + a
284
+ else:
285
+ r = (a - s) + b
286
+ return s, r
281
287
  u = unstr(_2sum, a, b)
282
288
  t = Fmt.PARENSPACED(_not_finite_, s)
283
289
  raise _OverflowError(u, txt=t)
@@ -1909,10 +1915,10 @@ class Fsum(_Named): # sync __methods__ with .vector3dBase.Vector3dBase
1909
1915
 
1910
1916
  @raise ResidualError: Invalid B{C{threshold}}.
1911
1917
 
1912
- @note: L{ResidualError}s may be thrown if the non-zero I{ratio}
1913
- C{residual / fsum} exceeds the given B{C{threshold}} and
1914
- if the C{residual} is non-zero and I{significant} vs the
1915
- C{fsum}, i.e. C{(fsum + residual) != fsum} and if optional
1918
+ @note: L{ResidualError}s may be thrown if (1) the non-zero I{ratio}
1919
+ C{residual / fsum} exceeds the given B{C{threshold}} and (2)
1920
+ the C{residual} is non-zero and (3) I{significant} vs the
1921
+ C{fsum}, i.e. C{(fsum + residual) != fsum} and (4) optional
1916
1922
  keyword argument C{raiser=False} is missing. Specify a
1917
1923
  negative B{C{threshold}} for only non-zero C{residual}
1918
1924
  testing without I{significant}.