pygeodesy 25.4.25__py2.py3-none-any.whl → 25.5.25__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.
Files changed (85) hide show
  1. pygeodesy/__init__.py +191 -189
  2. pygeodesy/__main__.py +2 -2
  3. pygeodesy/albers.py +4 -4
  4. pygeodesy/auxilats/_CX_Rs.py +3 -3
  5. pygeodesy/auxilats/auxAngle.py +2 -2
  6. pygeodesy/auxilats/auxDLat.py +2 -2
  7. pygeodesy/auxilats/auxDST.py +2 -2
  8. pygeodesy/auxilats/auxLat.py +2 -2
  9. pygeodesy/auxilats/auxily.py +2 -2
  10. pygeodesy/azimuthal.py +2 -2
  11. pygeodesy/basics.py +1 -1
  12. pygeodesy/booleans.py +8 -8
  13. pygeodesy/cartesianBase.py +7 -6
  14. pygeodesy/clipy.py +2 -2
  15. pygeodesy/constants.py +2 -2
  16. pygeodesy/datums.py +2 -2
  17. pygeodesy/deprecated/__init__.py +8 -8
  18. pygeodesy/deprecated/bases.py +2 -2
  19. pygeodesy/deprecated/rhumbBase.py +2 -2
  20. pygeodesy/deprecated/rhumbaux.py +2 -2
  21. pygeodesy/deprecated/rhumbsolve.py +2 -2
  22. pygeodesy/deprecated/rhumbx.py +2 -2
  23. pygeodesy/ecef.py +15 -26
  24. pygeodesy/ecefLocals.py +186 -0
  25. pygeodesy/ellipsoidalBase.py +2 -2
  26. pygeodesy/ellipsoidalBaseDI.py +7 -6
  27. pygeodesy/ellipsoidalExact.py +3 -3
  28. pygeodesy/ellipsoidalNvector.py +4 -4
  29. pygeodesy/ellipsoidalVincenty.py +15 -14
  30. pygeodesy/ellipsoids.py +23 -30
  31. pygeodesy/elliptic.py +2 -2
  32. pygeodesy/errors.py +1 -1
  33. pygeodesy/etm.py +2 -2
  34. pygeodesy/fmath.py +28 -13
  35. pygeodesy/formy.py +2 -2
  36. pygeodesy/frechet.py +5 -5
  37. pygeodesy/fstats.py +2 -2
  38. pygeodesy/fsums.py +38 -29
  39. pygeodesy/gars.py +2 -3
  40. pygeodesy/geodesici.py +4 -4
  41. pygeodesy/geodesicx/__init__.py +3 -3
  42. pygeodesy/geodesicx/gx.py +2 -2
  43. pygeodesy/geodesicx/gxarea.py +2 -2
  44. pygeodesy/geodesicx/gxline.py +2 -2
  45. pygeodesy/geoids.py +5 -5
  46. pygeodesy/hausdorff.py +4 -4
  47. pygeodesy/heights.py +2 -2
  48. pygeodesy/iters.py +1 -1
  49. pygeodesy/karney.py +2 -2
  50. pygeodesy/ktm.py +2 -2
  51. pygeodesy/latlonBase.py +10 -8
  52. pygeodesy/lazily.py +46 -22
  53. pygeodesy/lcc.py +2 -2
  54. pygeodesy/ltp.py +54 -57
  55. pygeodesy/ltpTuples.py +34 -35
  56. pygeodesy/mgrs.py +3 -3
  57. pygeodesy/named.py +2 -147
  58. pygeodesy/namedTuples.py +3 -3
  59. pygeodesy/nvectorBase.py +2 -2
  60. pygeodesy/osgr.py +2 -2
  61. pygeodesy/points.py +2 -3
  62. pygeodesy/props.py +16 -16
  63. pygeodesy/resections.py +90 -82
  64. pygeodesy/rhumb/aux_.py +2 -2
  65. pygeodesy/rhumb/bases.py +3 -3
  66. pygeodesy/rhumb/ekx.py +3 -4
  67. pygeodesy/rhumb/solve.py +2 -2
  68. pygeodesy/simplify.py +2 -2
  69. pygeodesy/solveBase.py +2 -2
  70. pygeodesy/sphericalBase.py +6 -6
  71. pygeodesy/sphericalNvector.py +2 -2
  72. pygeodesy/sphericalTrigonometry.py +6 -5
  73. pygeodesy/trf.py +4 -4
  74. pygeodesy/triaxials.py +2 -2
  75. pygeodesy/units.py +7 -8
  76. pygeodesy/utily.py +2 -2
  77. pygeodesy/utmupsBase.py +55 -33
  78. pygeodesy/vector2d.py +16 -10
  79. pygeodesy/vector3d.py +3 -3
  80. pygeodesy/webmercator.py +2 -2
  81. {pygeodesy-25.4.25.dist-info → pygeodesy-25.5.25.dist-info}/METADATA +20 -19
  82. pygeodesy-25.5.25.dist-info/RECORD +119 -0
  83. pygeodesy-25.4.25.dist-info/RECORD +0 -118
  84. {pygeodesy-25.4.25.dist-info → pygeodesy-25.5.25.dist-info}/WHEEL +0 -0
  85. {pygeodesy-25.4.25.dist-info → pygeodesy-25.5.25.dist-info}/top_level.txt +0 -0
@@ -5,7 +5,7 @@ u'''(INTERNAL) Private, ellipsoidal Direct/Inverse geodesy base
5
5
  class C{LatLonEllipsoidalBaseDI} and functions.
6
6
  '''
7
7
  # make sure int/int division yields float quotient, see .basics
8
- from __future__ import division as _; del _ # PYCHOK semicolon
8
+ from __future__ import division as _; del _ # noqa: E702 ;
9
9
 
10
10
  # from pygeodesy.azimuthal import _Equidistants # _MODS
11
11
  from pygeodesy.basics import isLatLon, _xsubclassof, typename
@@ -36,7 +36,7 @@ from pygeodesy.utily import m2km, unroll180, _unrollon, _unrollon3, _Wrap, wrap3
36
36
  from math import degrees, radians
37
37
 
38
38
  __all__ = _ALL_LAZY.ellipsoidalBaseDI
39
- __version__ = '25.04.21'
39
+ __version__ = '25.05.23'
40
40
 
41
41
  _polar__ = 'polar?'
42
42
  _TRIPS = 33 # _intersect3, _intersects2, _nearestOn interations, 6..9 sufficient?
@@ -115,14 +115,15 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
115
115
  r = self._Direct2Tuple(LL, height, r)
116
116
  return r
117
117
 
118
- def _Direct2Tuple(self, LL, height, r):
118
+ def _Direct2Tuple(self, LL, height, r): # in .ellipsoidalVincenty.py
119
119
  '''(INTERNAL) Helper for C{._Direct} result L{Destination2Tuple}.
120
120
  '''
121
121
  h = self._heigHt(height)
122
- d = _xkwds_not(None, datum=self.datum, name=self.name,
122
+ n = self.name
123
+ d = _xkwds_not(None, datum=self.datum, height=h, name=n,
123
124
  epoch=self.epoch, reframe=self.reframe)
124
- d = LL(*_Wrap.latlon(r.lat, r.lon), height=h, **d)
125
- return Destination2Tuple(d, wrap360(r.final), name=self.name)
125
+ d = LL(*_Wrap.latlon(r.lat, r.lon), **d)
126
+ return Destination2Tuple(d, wrap360(r.final), name=n)
126
127
 
127
128
  def distanceTo(self, other, wrap=False, **unused): # radius=R_M
128
129
  '''Compute the distance between this and an other point along
@@ -11,12 +11,12 @@ L{GeodesicExact}, L{GeodesicAreaExact} and L{GeodesicLineExact}.
11
11
 
12
12
  # from pygeodesy.datums import _WGS84 # from .ellipsoidalBase
13
13
  from pygeodesy.ellipsoidalBase import CartesianEllipsoidalBase, \
14
- _nearestOn, _WGS84
14
+ _nearestOn, _WGS84
15
15
  from pygeodesy.ellipsoidalBaseDI import LatLonEllipsoidalBaseDI, \
16
16
  _intersection3, _intersections2, \
17
17
  _TOL_M, intersecant2
18
18
  # from pygeodesy.errors import _xkwds # from .karney
19
- from pygeodesy.karney import fabs, _polygon, Property_RO, _xkwds
19
+ from pygeodesy.karney import _polygon, fabs, Property_RO, _xkwds
20
20
  from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _ALL_OTHER
21
21
  from pygeodesy.points import _areaError, ispolar # PYCHOK exported
22
22
  # from pygeodesy.props import Property_RO # from .karney
@@ -24,7 +24,7 @@ from pygeodesy.points import _areaError, ispolar # PYCHOK exported
24
24
  # from math import fabs # from .karney
25
25
 
26
26
  __all__ = _ALL_LAZY.ellipsoidalExact
27
- __version__ = '24.11.06'
27
+ __version__ = '25.05.12'
28
28
 
29
29
 
30
30
  class Cartesian(CartesianEllipsoidalBase):
@@ -21,7 +21,7 @@ See also I{Kenneth Gade} U{'A Non-singular Horizontal Position Representation'
21
21
  The Journal of Navigation (2010), vol 63, nr 3, pp 395-417.
22
22
  '''
23
23
  # make sure int/int division yields float quotient, see .basics
24
- from __future__ import division as _; del _ # PYCHOK semicolon
24
+ from __future__ import division as _; del _ # noqa: E702 ;
25
25
 
26
26
  from pygeodesy.basics import _isin, issubclassof, map2, _xinstanceof, \
27
27
  _xsubclassof
@@ -32,7 +32,7 @@ from pygeodesy.ellipsoidalBase import CartesianEllipsoidalBase, \
32
32
  _nearestOn, LatLonEllipsoidalBase, \
33
33
  _TOL_M, _Wrap
34
34
  from pygeodesy.errors import _xkwds, _xkwds_pop2
35
- # from pygeodesy.fmath import fdot # from .nvectorBase
35
+ from pygeodesy.fmath import fdot, fabs
36
36
  # from pygeodesy.formy import _isequalTo # _MODS
37
37
  from pygeodesy.interns import _Nv00_, _COMMASPACE_, _pole_ # PYCHOK used!
38
38
  from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _ALL_OTHER
@@ -41,7 +41,7 @@ from pygeodesy.ltpTuples import Aer as _Aer, Ned as _Ned, Ned4Tuple, \
41
41
  sincos2d_, _xnamed
42
42
  # from pygeodesy.named import _xnamed # from .ltpTuples
43
43
  from pygeodesy.nvectorBase import LatLonNvectorBase, NorthPole, NvectorBase, \
44
- sumOf as _sumOf, fabs, fdot
44
+ sumOf as _sumOf
45
45
  from pygeodesy.props import deprecated_class, deprecated_function, \
46
46
  deprecated_method, Property_RO, property_RO
47
47
  from pygeodesy.streprs import Fmt, fstr, _xzipairs
@@ -51,7 +51,7 @@ from pygeodesy.units import Bearing, Distance, Height, Scalar
51
51
  # from math import fabs # from .nvectorBase
52
52
 
53
53
  __all__ = _ALL_LAZY.ellipsoidalNvector
54
- __version__ = '25.04.21'
54
+ __version__ = '25.05.12'
55
55
 
56
56
 
57
57
  class Ned(_Ned):
@@ -48,7 +48,7 @@ or by converting to anothor datum:
48
48
  >>> p = p.toDatum(Datums.OSGB36)
49
49
  '''
50
50
  # make sure int/int division yields float quotient, see .basics
51
- from __future__ import division as _; del _ # PYCHOK semicolon
51
+ from __future__ import division as _; del _ # noqa: E702 ;
52
52
 
53
53
  from pygeodesy.constants import EPS, EPS0, _0_0, _1_0, _2_0, _3_0, _4_0, _6_0
54
54
  # from pygeodesy.ecef import EcefVeness # _MODS
@@ -59,7 +59,7 @@ from pygeodesy.ellipsoidalBaseDI import LatLonEllipsoidalBaseDI, \
59
59
  # from pygeodesy.ellipsoidalExact import areaOf, perimeterOf # _MODS
60
60
  # from pygeodesy.ellipsoidalKarney import areaOf, perimeterOf # _MODS
61
61
  from pygeodesy.errors import _and, _ValueError, _xkwds
62
- from pygeodesy.fmath import Fpolynomial, hypot, hypot1
62
+ from pygeodesy.fmath import fdot_, Fpolynomial, hypot, hypot1
63
63
  from pygeodesy.interns import _ambiguous_, _antipodal_, _COLONSPACE_, \
64
64
  _to_, _SPACE_, _limit_ # PYCHOK used!
65
65
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
@@ -76,7 +76,7 @@ from pygeodesy.utily import atan2, atan2b, atan2d, sincos2, sincos2d, \
76
76
  from math import cos, degrees, fabs, radians, tan as _tan
77
77
 
78
78
  __all__ = _ALL_LAZY.ellipsoidalVincenty
79
- __version__ = '25.04.21'
79
+ __version__ = '25.05.23'
80
80
 
81
81
  _antipodal_to_ = _SPACE_(_antipodal_, _to_)
82
82
 
@@ -230,13 +230,13 @@ class LatLon(LatLonEllipsoidalBaseDI):
230
230
  t = self._no_convergence(e)
231
231
  raise VincentyError(t, txt=repr(self)) # self.toRepr()
232
232
 
233
- t = s1 * ss - c1 * cs * cb
233
+ t = fdot_(s1, ss, -c1, cs * cb)
234
234
  # final bearing (reverse azimuth +/- 180)
235
235
  d = atan2b(sa, -t)
236
236
  if llr:
237
237
  b = cb * ss
238
- a = atan2d(s1 * cs + c1 * b, hypot(sa, t) * E.b_a)
239
- b = atan2d(sb * ss, -s1 * b + c1 * cs) + self.lon \
238
+ a = atan2d(fdot_(s1, cs, c1, b), hypot(sa, t) * E.b_a)
239
+ b = atan2d(sb * ss, fdot_(-s1, b, c1, cs)) + self.lon \
240
240
  - degrees(_Dl(f, ca2, sa, s, cs, ss, c2sm))
241
241
  t = Destination3Tuple(a, wrap180(b), d)
242
242
  r = self._Direct2Tuple(self.classof, height, t)
@@ -349,6 +349,13 @@ def _c2sm2(c2sm):
349
349
  return c2sm**2 * _2_0 - _1_0
350
350
 
351
351
 
352
+ def _ellipsoidal(): # helper for areaOf and perimeterOf
353
+ try:
354
+ return _MODS.ellipsoidalKarney
355
+ except ImportError:
356
+ return _MODS.ellipsoidalExact
357
+
358
+
352
359
  def _Dl(f, ca2, sa, s, cs, ss, c2sm, dl=_0_0):
353
360
  # C{Dl}
354
361
  if f and sa:
@@ -399,10 +406,7 @@ def _sincostan3r(a, f):
399
406
  def areaOf(points, **datum_wrap):
400
407
  '''DEPRECATED, use function L{ellipsoidalExact.areaOf} or L{ellipsoidalKarney.areaOf}.
401
408
  '''
402
- try:
403
- return _MODS.ellipsoidalKarney.areaOf(points, **datum_wrap)
404
- except ImportError:
405
- return _MODS.ellipsoidalExact.areaOf(points, **datum_wrap)
409
+ return _ellipsoidal().areaOf(points, **datum_wrap)
406
410
 
407
411
 
408
412
  def intersection3(start1, end1, start2, end2, height=None, wrap=False, # was=True
@@ -558,10 +562,7 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
558
562
  def perimeterOf(points, **closed_datum_wrap):
559
563
  '''DEPRECATED, use function L{ellipsoidalExact.perimeterOf} or L{ellipsoidalKarney.perimeterOf}.
560
564
  '''
561
- try:
562
- return _MODS.ellipsoidalKarney.perimeterOf(points, **closed_datum_wrap)
563
- except ImportError:
564
- return _MODS.ellipsoidalExact.perimeterOf(points, **closed_datum_wrap)
565
+ return _ellipsoidal().perimeterOf(points, **closed_datum_wrap)
565
566
 
566
567
 
567
568
  __all__ += _ALL_DOCS(Cartesian, LatLon, intersecant2, # from .ellipsoidalBaseDI
pygeodesy/ellipsoids.py CHANGED
@@ -62,7 +62,7 @@ Following is the list of predefined L{Ellipsoid}s, all instantiated lazily.
62
62
  @var Ellipsoids.WGS84_NGS: Ellipsoid(name='WGS84_NGS', a=6378137, f=0.00335281, f_=298.2572221, b=6356752.31414035)
63
63
  '''
64
64
  # make sure int/int division yields float quotient, see .basics
65
- from __future__ import division as _; del _ # PYCHOK semicolon
65
+ from __future__ import division as _; del _ # noqa: E702 ;
66
66
 
67
67
  # from pygeodesy.albers import AlbersEqualAreaCylindrical # _MODS
68
68
  from pygeodesy.basics import copysign0, isbool, _isin, isint, typename
@@ -95,7 +95,7 @@ from pygeodesy.utily import atan1, atan1d, atan2b, degrees90, m2radians, radians
95
95
  from math import asinh, atan, atanh, cos, degrees, exp, fabs, radians, sin, sinh, sqrt, tan # as _tan
96
96
 
97
97
  __all__ = _ALL_LAZY.ellipsoids
98
- __version__ = '25.04.23'
98
+ __version__ = '25.05.12'
99
99
 
100
100
  _f_0_0 = Float(f =_0_0) # zero flattening
101
101
  _f__0_0 = Float(f_=_0_0) # zero inverse flattening
@@ -140,12 +140,14 @@ class a_f2Tuple(_NamedTuple):
140
140
  @arg f: Flattening (C{scalar} < 1, negative for I{prolate}).
141
141
  @kwarg name: Optional C{B{name}=NN} (C{str}).
142
142
 
143
- @return: An L{a_f2Tuple}C{(a, f)} instance.
143
+ @return: An L{a_f2Tuple}C{(a, f)}.
144
144
 
145
145
  @raise UnitError: Invalid B{C{a}} or B{C{f}}.
146
146
 
147
- @note: C{abs(B{f}) < EPS} is forced to C{B{f}=0}, I{spherical}.
148
- Negative C{B{f}} produces a I{prolate} ellipsoid.
147
+ @note: C{abs(B{f}) < }L{EPS<pygeodesy.constants.EPS>} is
148
+ forced to C{B{f}=0}, I{spherical}.
149
+
150
+ @note: Negative C{B{f}} produces a I{prolate} ellipsoid.
149
151
  '''
150
152
  a = Radius_(a=a) # low=EPS, high=None
151
153
  f = Float_( f=f, low=None, high=EPS1)
@@ -359,11 +361,16 @@ class Ellipsoid(_NamedEnumItem):
359
361
  '''
360
362
  return a_f2Tuple(self.a, self.f, name=self.name)
361
363
 
364
+ a_f2 = a_f # synonym
365
+
362
366
  @Property_RO
363
367
  def A(self):
364
368
  '''Get the UTM I{meridional (or rectifying)} radius (C{meter}).
365
369
 
366
- @see: I{Meridian arc unit} U{Q<https://StudyLib.net/doc/7443565/>}.
370
+ @note: C{A * PI / 2} ≈= L{L<Ellipsoid.L>}, the I{quarter meridian}.
371
+
372
+ @see: I{Meridian arc unit} U{Q<https://StudyLib.net/doc/7443565/>},
373
+ the mean, meridional length I{per radian}.
367
374
  '''
368
375
  A, n = self.a, self.n
369
376
  if n:
@@ -375,6 +382,11 @@ class Ellipsoid(_NamedEnumItem):
375
382
  # A *= fhorner(n**2, 1048576, 262144, 16384, 4096, 1600, 784, 441) / 1048576) / (1 + n)
376
383
  A = Radius(A=Fhorner(n**2, 1048576, 262144, 16384, 4096, 1600, 784, 441).fover(d))
377
384
  return A
385
+ # # Moritz, H. <https://Geodesy.Geology.Ohio-State.EDU/course/refpapers/00740128.pdf>
386
+ # # q = 4 / self.rocPolar
387
+ # # Q = (1 - 3 / 4 * e'2 + 45 / 64 * e'4 - 175 / 256 * e'6 + 11025 / 16384 * e'8) * rocPolar
388
+ # # = (4 + e'2 * (-3 + e'2 * (45 / 16 + e'2 * (-175 / 64 + e'2 * 11025 / 4096)))) / q
389
+ # return Radius(Q=Fhorner(self.e22, 4, -3, 45 / 16, -175 / 64, 11025 / 4096).fover(q))
378
390
 
379
391
  @Property_RO
380
392
  def _albersCyl(self):
@@ -386,7 +398,7 @@ class Ellipsoid(_NamedEnumItem):
386
398
  def AlphaKs(self):
387
399
  '''Get the I{Krüger} U{Alpha series coefficients<https://GeographicLib.SourceForge.io/C++/doc/tmseries30.html>} (C{KsOrder}C{-tuple}).
388
400
  '''
389
- return self._Kseries( # XXX int/int quotients may require from __future__ import division as _; del _ # PYCHOK semicolon
401
+ return self._Kseries( # XXX int/int quotients may require from __future__ import division as _; del _ # noqa: E702 ;
390
402
  # n n**2 n**3 n**4 n**5 n**6 n**7 n**8
391
403
  _T(1/2, -2/3, 5/16, 41/180, -127/288, 7891/37800, 72161/387072, -18975107/50803200),
392
404
  _T(13/48, -3/5, 557/1440, 281/630, -1983433/1935360, 13769/28800, 148003883/174182400), # PYCHOK unaligned
@@ -605,7 +617,7 @@ class Ellipsoid(_NamedEnumItem):
605
617
  def BetaKs(self):
606
618
  '''Get the I{Krüger} U{Beta series coefficients<https://GeographicLib.SourceForge.io/C++/doc/tmseries30.html>} (C{KsOrder}C{-tuple}).
607
619
  '''
608
- return self._Kseries( # XXX int/int quotients may require from __future__ import division as _; del _ # PYCHOK semicolon
620
+ return self._Kseries( # XXX int/int quotients may require from __future__ import division as _; del _ # noqa: E702 ;
609
621
  # n n**2 n**3 n**4 n**5 n**6 n**7 n**8
610
622
  _T(1/2, -2/3, 37/96, -1/360, -81/512, 96199/604800, -5406467/38707200, 7944359/67737600),
611
623
  _T(1/48, 1/15, -437/1440, 46/105, -1118711/3870720, 51841/1209600, 24749483/348364800), # PYCHOK unaligned
@@ -1339,23 +1351,7 @@ class Ellipsoid(_NamedEnumItem):
1339
1351
 
1340
1352
  polaradius = b # Rpolar
1341
1353
 
1342
- # @Property_RO
1343
- # def Q(self):
1344
- # '''Get the I{meridian arc unit} C{Q}, the mean, meridional length I{per radian} C({float}).
1345
- #
1346
- # @note: C{Q * PI / 2} ≈ C{L}, the I{quarter meridian}.
1347
- #
1348
- # @see: Property C{A} and U{Engsager, K., Poder, K.<https://StudyLib.net/doc/7443565/
1349
- # a-highly-accurate-world-wide-algorithm-for-the-transverse...>}.
1350
- # '''
1351
- # n = self.n
1352
- # d = (n + _1_0) / self.a
1353
- # return Float(Q=Fhorner(n**2, _1_0, _0_25, _1_16th, _0_25).fover(d) if d else self.b)
1354
-
1355
- # # Moritz, H. <https://Geodesy.Geology.Ohio-State.EDU/course/refpapers/00740128.pdf>
1356
- # # Q = (1 - 3/4 * e'2 + 45/64 * e'4 - 175/256 * e'6 + 11025/16384 * e'8) * rocPolar
1357
- # # = (4 + e'2 * (-3 + e'2 * (45/16 + e'2 * (-175/64 + e'2 * 11025/4096)))) * rocPolar / 4
1358
- # return Fhorner(self.e22, 4, -3, 45 / 16, -175 / 64, 11025 / 4096).fover(4 / self.rocPolar)
1354
+ # Q = A # I{meridian arc unit} C{Q}, the mean, meridional length I{per radian}
1359
1355
 
1360
1356
  @deprecated_Property_RO
1361
1357
  def quarteradius(self): # PYCHOK no cover
@@ -1382,16 +1378,13 @@ class Ellipsoid(_NamedEnumItem):
1382
1378
  <https://WikiPedia.org/wiki/Earth_radius>}.
1383
1379
  '''
1384
1380
  return Radius(R2=sqrt(self.c2) if self.f else self.a)
1385
-
1386
- Rauthalic = R2
1387
-
1388
- # @Property_RO
1389
- # def R2(self):
1390
1381
  # # Moritz, H. <https://Geodesy.Geology.Ohio-State.EDU/course/refpapers/00740128.pdf>
1391
1382
  # # R2 = (1 - 2/3 * e'2 + 26/45 * e'4 - 100/189 * e'6 + 7034/14175 * e'8) * rocPolar
1392
1383
  # # = (3 + e'2 * (-2 + e'2 * (26/15 + e'2 * (-100/63 + e'2 * 7034/4725)))) * rocPolar / 3
1393
1384
  # return Fhorner(self.e22, 3, -2, 26 / 15, -100 / 63, 7034 / 4725).fover(3 / self.rocPolar)
1394
1385
 
1386
+ Rauthalic = R2
1387
+
1395
1388
  @Property_RO
1396
1389
  def R2x(self):
1397
1390
  '''Get the I{authalic} earth radius (C{meter}), M{sqrt(c2x)}.
pygeodesy/elliptic.py CHANGED
@@ -73,7 +73,7 @@ The notation follows U{NIST Digital Library of Mathematical Functions
73
73
  U{22<https://DLMF.NIST.gov/22>}.
74
74
  '''
75
75
  # make sure int/int division yields float quotient, see .basics
76
- from __future__ import division as _; del _ # PYCHOK semicolon
76
+ from __future__ import division as _; del _ # noqa: E702 ;
77
77
 
78
78
  from pygeodesy.basics import copysign0, map2, neg, neg_, typename
79
79
  from pygeodesy.constants import EPS, INF, NAN, PI, PI_2, PI_4, _0_0, \
@@ -99,7 +99,7 @@ from math import asin, asinh, atan, ceil, cosh, fabs, floor, radians, \
99
99
  sin, sinh, sqrt, tan, tanh # tan as _tan
100
100
 
101
101
  __all__ = _ALL_LAZY.elliptic
102
- __version__ = '25.04.14'
102
+ __version__ = '25.05.12'
103
103
 
104
104
  _TolRD = zqrt(EPS * 0.002)
105
105
  _TolRF = zqrt(EPS * 0.030)
pygeodesy/errors.py CHANGED
@@ -27,7 +27,7 @@ from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _PYTHON_X_DEV
27
27
  from copy import copy as _copy
28
28
 
29
29
  __all__ = _ALL_LAZY.errors # _ALL_DOCS('_InvalidError', '_IsnotError') _under
30
- __version__ = '25.04.21'
30
+ __version__ = '25.05.19'
31
31
 
32
32
  _argument_ = 'argument'
33
33
  _basics = _MODS.into(basics=__name__)
pygeodesy/etm.py CHANGED
@@ -61,7 +61,7 @@ control round-off. For example, C{atanh(sin(phi))} is replaced by C{asinh(tan(p
61
61
  which maintains accuracy near C{phi = pi/2}. Such changes are noted in the code.
62
62
  '''
63
63
  # make sure int/int division yields float quotient, see .basics
64
- from __future__ import division as _; del _ # PYCHOK semicolon
64
+ from __future__ import division as _; del _ # noqa: E702 ;
65
65
 
66
66
  from pygeodesy.basics import _isin, map1, neg, neg_, _xinstanceof
67
67
  from pygeodesy.constants import EPS, EPS02, PI_2, PI_4, _K0_UTM, \
@@ -93,7 +93,7 @@ from pygeodesy.utm import _cmlon, _LLEB, _parseUTM5, _toBand, _toXtm8, \
93
93
  from math import asinh, degrees, radians, sinh, sqrt
94
94
 
95
95
  __all__ = _ALL_LAZY.etm
96
- __version__ = '25.04.14'
96
+ __version__ = '25.05.12'
97
97
 
98
98
  _OVERFLOW = _1_EPS**2 # ~2e+31
99
99
  _TAYTOL = pow(EPS, 0.6)
pygeodesy/fmath.py CHANGED
@@ -5,7 +5,7 @@ u'''Utilities for precision floating point summation, multiplication,
5
5
  C{fused-multiply-add}, polynomials, roots, etc.
6
6
  '''
7
7
  # make sure int/int division yields float quotient, see .basics
8
- from __future__ import division as _; del _ # PYCHOK semicolon
8
+ from __future__ import division as _; del _ # noqa: E702 ;
9
9
 
10
10
  from pygeodesy.basics import _copysign, copysign0, isbool, isint, isscalar, \
11
11
  len2, map1, _xiterable, typename
@@ -19,13 +19,13 @@ from pygeodesy.fsums import _2float, Fsum, fsum, _isFsum_2Tuple, Fmt, unstr
19
19
  from pygeodesy.interns import MISSING, _negative_, _not_scalar_
20
20
  from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS
21
21
  # from pygeodesy.streprs import Fmt, unstr # from .fsums
22
- from pygeodesy.units import Int_, _isHeight, _isRadius, Float_ # PYCHOK for .heights
22
+ from pygeodesy.units import Int_, _isHeight, _isRadius
23
23
 
24
24
  from math import fabs, sqrt # pow
25
25
  import operator as _operator # in .datums, .trf, .utm
26
26
 
27
27
  __all__ = _ALL_LAZY.fmath
28
- __version__ = '25.04.18'
28
+ __version__ = '25.05.12'
29
29
 
30
30
  # sqrt(2) - 1 <https://WikiPedia.org/wiki/Square_root_of_2>
31
31
  _0_4142 = 0.41421356237309504880 # ~ 3_730_904_090_310_553 / 9_007_199_254_740_992
@@ -37,7 +37,7 @@ class Fdot(Fsum):
37
37
  '''Precision dot product.
38
38
  '''
39
39
  def __init__(self, a, *b, **start_name_f2product_nonfinites_RESIDUAL):
40
- '''New L{Fdot} precision dot product M{sum(a[i] * b[i] for i=0..len(a)-1)}.
40
+ '''New L{Fdot} precision dot product M{start + sum(a[i] * b[i] for i=0..len(a)-1)}.
41
41
 
42
42
  @arg a: Iterable of values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}).
43
43
  @arg b: Other values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}), all
@@ -66,13 +66,27 @@ class Fdot(Fsum):
66
66
  self._facc_dot(n, a, b, **kwds)
67
67
 
68
68
 
69
+ class Fdot_(Fdot):
70
+ '''Precision dot product.
71
+ '''
72
+ def __init__(self, *xys, **start_name_f2product_nonfinites_RESIDUAL):
73
+ '''New L{Fdot_} precision dot product M{start + sum(xys[i] * xys[i+1] for i in
74
+ range(0, len(xys), B{2}))}.
75
+
76
+ @arg xys: Pairwise values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}),
77
+ all positional.
78
+
79
+ @see: Class L{Fdot<Fdot.__init__>} for further details.
80
+ '''
81
+ Fdot.__init__(self, xys[0::2], *xys[1::2], **start_name_f2product_nonfinites_RESIDUAL)
82
+
83
+
69
84
  class Fhorner(Fsum):
70
85
  '''Precision polynomial evaluation using the Horner form.
71
86
  '''
72
87
  def __init__(self, x, *cs, **incx_name_f2product_nonfinites_RESIDUAL):
73
- '''New L{Fhorner} form evaluation of polynomial M{sum(cs[i] * x**i for
74
- i=0..n)} with in- or decreasing exponent M{sum(... i=n..0)}, where C{n
75
- = len(cs) - 1}.
88
+ '''New L{Fhorner} form evaluation of polynomial M{sum(cs[i] * x**i for i=0..n)}
89
+ with in- or decreasing exponent M{sum(... i=n..0)}, where C{n = len(cs) - 1}.
76
90
 
77
91
  @arg x: Polynomial argument (C{scalar}, an L{Fsum} or L{Fsum2Tuple}).
78
92
  @arg cs: Polynomial coeffients (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}),
@@ -425,7 +439,7 @@ def favg(a, b, f=_0_5, nonfinites=True):
425
439
 
426
440
 
427
441
  def fdot(xs, *ys, **start_f2product_nonfinites):
428
- '''Return the precision dot product M{sum(xs[i] * ys[i] for i in range(len(xs)))}.
442
+ '''Return the precision dot product M{start + sum(xs[i] * ys[i] for i in range(len(xs)))}.
429
443
 
430
444
  @arg xs: Iterable of values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}).
431
445
  @arg ys: Other values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}), all positional.
@@ -446,7 +460,7 @@ def fdot(xs, *ys, **start_f2product_nonfinites):
446
460
 
447
461
 
448
462
  def fdot_(*xys, **start_f2product_nonfinites):
449
- '''Return the (precision) dot product M{sum(xys[i] * xys[i+1] for i in range(0, len(xys), B{2}))}.
463
+ '''Return the (precision) dot product M{start + sum(xys[i] * xys[i+1] for i in range(0, len(xys), B{2}))}.
450
464
 
451
465
  @arg xys: Pairwise values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}), all positional.
452
466
 
@@ -454,7 +468,8 @@ def fdot_(*xys, **start_f2product_nonfinites):
454
468
 
455
469
  @return: Dot product (C{float}).
456
470
  '''
457
- return fdot(xys[0::2], *xys[1::2], **start_f2product_nonfinites)
471
+ D = Fdot_(*xys, **_xkwds(start_f2product_nonfinites, nonfinites=True))
472
+ return float(D)
458
473
 
459
474
 
460
475
  def fdot3(xs, ys, zs, **start_f2product_nonfinites):
@@ -555,7 +570,7 @@ def fidw(xs, ds, beta=2):
555
570
 
556
571
 
557
572
  try:
558
- from math import fma as _fma
573
+ from math import fma as _fma # in .resections
559
574
  except ImportError: # PYCHOK DSPACE!
560
575
 
561
576
  def _fma(x, y, z): # no need for accuracy
@@ -972,7 +987,7 @@ def _powers(x, n):
972
987
 
973
988
 
974
989
  def _root(x, p, where):
975
- '''(INTERNAL) Raise C{x} to power C{0 < p < 1}.
990
+ '''(INTERNAL) Raise C{x} to power C{0 <= p < 1}.
976
991
  '''
977
992
  try:
978
993
  if x > 0:
@@ -982,7 +997,7 @@ def _root(x, p, where):
982
997
  raise ValueError(_negative_)
983
998
  except Exception as X:
984
999
  raise _xError(X, unstr(where, x))
985
- return _0_0 if p else _1_0
1000
+ return _0_0 if p else _1_0 # x == 0
986
1001
 
987
1002
 
988
1003
  def sqrt0(x, Error=None):
pygeodesy/formy.py CHANGED
@@ -4,7 +4,7 @@
4
4
  u'''Formulary of basic geodesy functions and approximations.
5
5
  '''
6
6
  # make sure int/int division yields float quotient, see .basics
7
- from __future__ import division as _; del _ # PYCHOK semicolon
7
+ from __future__ import division as _; del _ # noqa: E702 ;
8
8
 
9
9
  from pygeodesy.basics import _copysign, _isin # _args_kwds_count2
10
10
  # from pygeodesy.cartesianBase import CartesianBase # _MODS
@@ -42,7 +42,7 @@ from contextlib import contextmanager
42
42
  from math import atan, cos, degrees, fabs, radians, sin, sqrt # pow
43
43
 
44
44
  __all__ = _ALL_LAZY.formy
45
- __version__ = '25.04.14'
45
+ __version__ = '25.05.12'
46
46
 
47
47
  _RADIANS2 = radians(_1_0)**2 # degree to radians-squared
48
48
  _ratio_ = 'ratio'
pygeodesy/frechet.py CHANGED
@@ -90,9 +90,9 @@ from pygeodesy.interns import _DMAIN_, _DOT_, _n_, NN, _units_
90
90
  # from pygeodesy.iters import points2 as _points2 # from .points
91
91
  from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _FOR_DOCS
92
92
  from pygeodesy.named import _name2__, _Named, _NamedTuple, _Pass
93
- # from pygeodesy.namedTuples import PhiLam2Tuple # from .points
94
- from pygeodesy.points import _distanceTo, _fractional, PhiLam2Tuple, \
95
- points2 as _points2, radians
93
+ from pygeodesy.namedTuples import PhiLam2Tuple
94
+ from pygeodesy.points import _distanceTo, _fractional, \
95
+ points2 as _points2, radians
96
96
  from pygeodesy.props import Property, property_doc_, property_RO
97
97
  from pygeodesy.units import FIx, Float, Number_
98
98
  from pygeodesy import unitsBase as _unitsBase # _Str_..., _xUnit, _xUnits
@@ -101,7 +101,7 @@ from collections import defaultdict as _defaultdict
101
101
  # from math import radians # from .points
102
102
 
103
103
  __all__ = _ALL_LAZY.frechet
104
- __version__ = '25.04.21'
104
+ __version__ = '25.05.21'
105
105
 
106
106
  _formy = _MODS.into(formy=__name__)
107
107
 
@@ -129,7 +129,7 @@ class Frechet(_Named):
129
129
  be overloaded.
130
130
  '''
131
131
  _datum = _WGS84
132
- _func = None # formy function/property
132
+ # _func = None # formy function/property
133
133
  _f1 = 1
134
134
  _kwds = {} # func_ options
135
135
  _n1 = 0
pygeodesy/fstats.py CHANGED
@@ -6,7 +6,7 @@ L{pygeodesy.Fsum}, precision floating point summation and accurate
6
6
  multiplication.
7
7
  '''
8
8
  # make sure int/int division yields float quotient, see .basics
9
- from __future__ import division as _; del _ # PYCHOK semicolon
9
+ from __future__ import division as _; del _ # noqa: E702 ;
10
10
 
11
11
  from pygeodesy.basics import isscalar, isodd, _xinstanceof, \
12
12
  _xiterable, _xsubclassof, _zip, typename
@@ -24,7 +24,7 @@ from pygeodesy.named import _name__, _Named, _NotImplemented, \
24
24
  # from pygeodesy.streprs import Fmt # from .fmath
25
25
 
26
26
  __all__ = _ALL_LAZY.fstats
27
- __version__ = '25.04.14'
27
+ __version__ = '25.05.12'
28
28
 
29
29
 
30
30
  def _sampled(n, sample):