pygeodesy 25.5.5__py2.py3-none-any.whl → 25.5.28__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 (88) hide show
  1. pygeodesy/__init__.py +186 -186
  2. pygeodesy/__main__.py +4 -3
  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/booleans.py +11 -11
  12. pygeodesy/cartesianBase.py +2 -2
  13. pygeodesy/clipy.py +2 -2
  14. pygeodesy/constants.py +7 -7
  15. pygeodesy/css.py +1 -1
  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 +3 -4
  24. pygeodesy/ellipsoidalBase.py +2 -2
  25. pygeodesy/ellipsoidalBaseDI.py +7 -6
  26. pygeodesy/ellipsoidalExact.py +24 -29
  27. pygeodesy/ellipsoidalGeodSolve.py +19 -19
  28. pygeodesy/ellipsoidalKarney.py +22 -27
  29. pygeodesy/ellipsoidalNvector.py +4 -4
  30. pygeodesy/ellipsoidalVincenty.py +17 -15
  31. pygeodesy/ellipsoids.py +4 -4
  32. pygeodesy/elliptic.py +16 -11
  33. pygeodesy/errors.py +1 -1
  34. pygeodesy/etm.py +2 -2
  35. pygeodesy/fmath.py +9 -9
  36. pygeodesy/formy.py +2 -2
  37. pygeodesy/frechet.py +6 -6
  38. pygeodesy/fstats.py +2 -2
  39. pygeodesy/fsums.py +37 -28
  40. pygeodesy/gars.py +2 -3
  41. pygeodesy/geodesici.py +4 -4
  42. pygeodesy/geodesicw.py +27 -8
  43. pygeodesy/geodesicx/__init__.py +3 -3
  44. pygeodesy/geodesicx/gx.py +52 -48
  45. pygeodesy/geodesicx/gxarea.py +54 -65
  46. pygeodesy/geodesicx/gxbases.py +12 -2
  47. pygeodesy/geodesicx/gxline.py +10 -7
  48. pygeodesy/geoids.py +6 -6
  49. pygeodesy/hausdorff.py +5 -5
  50. pygeodesy/heights.py +5 -5
  51. pygeodesy/internals.py +2 -2
  52. pygeodesy/interns.py +5 -5
  53. pygeodesy/iters.py +1 -1
  54. pygeodesy/karney.py +28 -12
  55. pygeodesy/ktm.py +2 -2
  56. pygeodesy/latlonBase.py +3 -4
  57. pygeodesy/lazily.py +1 -1
  58. pygeodesy/lcc.py +3 -3
  59. pygeodesy/ltp.py +5 -5
  60. pygeodesy/mgrs.py +3 -3
  61. pygeodesy/namedTuples.py +3 -3
  62. pygeodesy/nvectorBase.py +2 -2
  63. pygeodesy/osgr.py +2 -2
  64. pygeodesy/points.py +2 -3
  65. pygeodesy/props.py +18 -18
  66. pygeodesy/resections.py +30 -24
  67. pygeodesy/rhumb/aux_.py +2 -2
  68. pygeodesy/rhumb/bases.py +3 -3
  69. pygeodesy/rhumb/ekx.py +3 -4
  70. pygeodesy/rhumb/solve.py +2 -2
  71. pygeodesy/simplify.py +2 -2
  72. pygeodesy/solveBase.py +2 -2
  73. pygeodesy/sphericalBase.py +8 -8
  74. pygeodesy/sphericalNvector.py +19 -16
  75. pygeodesy/sphericalTrigonometry.py +24 -24
  76. pygeodesy/trf.py +4 -4
  77. pygeodesy/triaxials.py +2 -2
  78. pygeodesy/units.py +7 -8
  79. pygeodesy/utily.py +2 -2
  80. pygeodesy/utmupsBase.py +2 -2
  81. pygeodesy/vector2d.py +14 -8
  82. pygeodesy/vector3d.py +3 -3
  83. pygeodesy/webmercator.py +2 -2
  84. {pygeodesy-25.5.5.dist-info → pygeodesy-25.5.28.dist-info}/METADATA +16 -16
  85. pygeodesy-25.5.28.dist-info/RECORD +119 -0
  86. pygeodesy-25.5.5.dist-info/RECORD +0 -119
  87. {pygeodesy-25.5.5.dist-info → pygeodesy-25.5.28.dist-info}/WHEEL +0 -0
  88. {pygeodesy-25.5.5.dist-info → pygeodesy-25.5.28.dist-info}/top_level.txt +0 -0
@@ -42,7 +42,7 @@ from pygeodesy.props import deprecated_method, Property_RO
42
42
  # from math import fabs # from .karney
43
43
 
44
44
  __all__ = _ALL_LAZY.ellipsoidalKarney
45
- __version__ = '24.08.13'
45
+ __version__ = '25.05.27'
46
46
 
47
47
 
48
48
  class Cartesian(CartesianEllipsoidalBase):
@@ -110,13 +110,17 @@ class LatLon(LatLonEllipsoidalBaseDI):
110
110
  return LatLonEllipsoidalBaseDI.toCartesian(self, **kwds)
111
111
 
112
112
 
113
- def areaOf(points, datum=_WGS84, wrap=True):
113
+ def areaOf(points, datum=_WGS84, wrap=True, polar=False):
114
114
  '''Compute the area of an (ellipsoidal) polygon or composite using I{Karney}'s
115
115
  U{geographiclib<https://PyPI.org/project/geographiclib>} package.
116
116
 
117
117
  @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or L{BooleanGH}).
118
118
  @kwarg datum: Optional datum (L{Datum}).
119
119
  @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}} (C{bool}).
120
+ @kwarg polar: Use C{B{polar}=True} if the polygon encloses a pole (C{bool}), see
121
+ function L{ispolar<pygeodesy.points.ispolar>} and U{area of a polygon
122
+ enclosing a pole<https://GeographicLib.SourceForge.io/C++/doc/
123
+ classGeographicLib_1_1GeodesicExact.html#a3d7a9155e838a09a48dc14d0c3fac525>}.
120
124
 
121
125
  @return: Area (C{meter}, same as units of the B{C{datum}}'s ellipsoid axes, I{squared}).
122
126
 
@@ -131,12 +135,8 @@ def areaOf(points, datum=_WGS84, wrap=True):
131
135
 
132
136
  @see: Functions L{pygeodesy.areaOf}, L{ellipsoidalExact.areaOf}, L{ellipsoidalGeodSolve.areaOf},
133
137
  L{sphericalNvector.areaOf} and L{sphericalTrigonometry.areaOf}.
134
-
135
- @note: The U{area of a polygon enclosing a pole<https://GeographicLib.SourceForge.io/
136
- C++/doc/classGeographicLib_1_1GeodesicExact.html#a3d7a9155e838a09a48dc14d0c3fac525>}
137
- can be found by adding half the datum's ellipsoid surface area to the polygon's area.
138
138
  '''
139
- return fabs(_polygon(datum.ellipsoid.geodesic, points, True, False, wrap))
139
+ return fabs(_polygon(datum.ellipsoid.geodesic, points, True, False, wrap, polar))
140
140
 
141
141
 
142
142
  def intersection3(start1, end1, start2, end2, height=None, wrap=False, # was=True
@@ -240,19 +240,19 @@ def intersections2(center1, radius1, center2, radius2, height=None, wrap=False,
240
240
  equidistant=equidistant, tol=tol, LatLon=LatLon, **LatLon_kwds)
241
241
 
242
242
 
243
- def isclockwise(points, datum=_WGS84, wrap=True):
243
+ def isclockwise(points, datum=_WGS84, wrap=True, polar=False):
244
244
  '''Determine the direction of a path or polygon using I{Karney}'s
245
245
  U{geographiclib<https://PyPI.org/project/geographiclib>} package.
246
246
 
247
247
  @arg points: The path or polygon points (C{LatLon}[]).
248
248
  @kwarg datum: Optional datum (L{Datum}).
249
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
250
- B{C{points}} (C{bool}).
249
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}} (C{bool}).
250
+ @kwarg polar: Use C{B{polar}=True} if the C{B{points}} enclose a pole (C{bool}),
251
+ see function U{ispolar<pygeodeys.points.ispolar>}.
251
252
 
252
253
  @return: C{True} if B{C{points}} are clockwise, C{False} otherwise.
253
254
 
254
- @raise ImportError: Package U{geographiclib
255
- <https://PyPI.org/project/geographiclib>}
255
+ @raise ImportError: Package U{geographiclib<https://PyPI.org/project/geographiclib>}
256
256
  not installed or not found.
257
257
 
258
258
  @raise PointsError: Insufficient number of B{C{points}}.
@@ -263,7 +263,7 @@ def isclockwise(points, datum=_WGS84, wrap=True):
263
263
 
264
264
  @see: L{pygeodesy.isclockwise}.
265
265
  '''
266
- a = _polygon(datum.ellipsoid.geodesic, points, True, False, wrap)
266
+ a = _polygon(datum.ellipsoid.geodesic, points, True, False, wrap, polar)
267
267
  if a < 0:
268
268
  return True
269
269
  elif a > 0:
@@ -322,34 +322,29 @@ def perimeterOf(points, closed=False, datum=_WGS84, wrap=True):
322
322
  '''Compute the perimeter of an (ellipsoidal) polygon or composite using I{Karney}'s
323
323
  U{geographiclib<https://PyPI.org/project/geographiclib>} package.
324
324
 
325
- @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or
326
- L{BooleanGH}).
325
+ @arg points: The polygon points (L{LatLon}[], L{BooleanFHP} or L{BooleanGH}).
327
326
  @kwarg closed: Optionally, close the polygon (C{bool}).
328
327
  @kwarg datum: Optional datum (L{Datum}).
329
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
330
- B{C{points}} (C{bool}).
328
+ @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the B{C{points}} (C{bool}).
331
329
 
332
- @return: Perimeter (C{meter}, same as units of the B{C{datum}}'s
333
- ellipsoid axes).
330
+ @return: Perimeter (C{meter}, same as units of the B{C{datum}}'s ellipsoid axes).
334
331
 
335
- @raise ImportError: Package U{geographiclib
336
- <https://PyPI.org/project/geographiclib>}
332
+ @raise ImportError: Package U{geographiclib<https://PyPI.org/project/geographiclib>}
337
333
  not installed or not found.
338
334
 
339
335
  @raise PointsError: Insufficient number of B{C{points}}.
340
336
 
341
- @raise TypeError: Some B{C{points}} are not L{LatLon} or C{B{closed}=False}
342
- with B{C{points}} a composite.
337
+ @raise TypeError: Some B{C{points}} are not L{LatLon} or C{B{closed}=False} with
338
+ B{C{points}} a composite.
343
339
 
344
- @raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled
345
- longitudes not supported or C{B{closed}=False}
346
- with C{B{points}} a composite.
340
+ @raise ValueError: Invalid C{B{wrap}=False}, unwrapped, unrolled longitudes not
341
+ supported or C{B{closed}=False} with C{B{points}} a composite.
347
342
 
348
343
  @see: Functions L{pygeodesy.perimeterOf}, L{ellipsoidalExact.perimeterOf},
349
344
  L{ellipsoidalGeodSolve.perimeterOf}, L{sphericalNvector.perimeterOf}
350
345
  and L{sphericalTrigonometry.perimeterOf}.
351
346
  '''
352
- return _polygon(datum.ellipsoid.geodesic, points, closed, True, wrap)
347
+ return _polygon(datum.ellipsoid.geodesic, points, closed, True, wrap, False)
353
348
 
354
349
 
355
350
  __all__ += _ALL_OTHER(Cartesian, LatLon, # classes
@@ -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.26'
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)
@@ -378,6 +378,14 @@ def _Ecef():
378
378
  return E
379
379
 
380
380
 
381
+ def _ellipsoidalOf(_Of, points, **kwds): # helper for DEPRECATED areaOf and perimeterOf
382
+ try:
383
+ r = getattr(_MODS.ellipsoidalKarney, _Of.__name__)(points, **kwds)
384
+ except ImportError: # no geographiclib
385
+ r = getattr(_MODS.ellipsoidalExact, _Of.__name__)(points, **kwds)
386
+ return r
387
+
388
+
381
389
  def _sincos22(sa):
382
390
  # 2-Tuple C{(sin(a), cos(a)**2)}
383
391
  ca2 = _1_0 - sa**2
@@ -396,13 +404,10 @@ def _sincostan3r(a, f):
396
404
 
397
405
 
398
406
  @deprecated_function
399
- def areaOf(points, **datum_wrap):
407
+ def areaOf(points, **datum_wrap_polar):
400
408
  '''DEPRECATED, use function L{ellipsoidalExact.areaOf} or L{ellipsoidalKarney.areaOf}.
401
409
  '''
402
- try:
403
- return _MODS.ellipsoidalKarney.areaOf(points, **datum_wrap)
404
- except ImportError:
405
- return _MODS.ellipsoidalExact.areaOf(points, **datum_wrap)
410
+ return _ellipsoidalOf(areaOf, points, **datum_wrap_polar)
406
411
 
407
412
 
408
413
  def intersection3(start1, end1, start2, end2, height=None, wrap=False, # was=True
@@ -558,10 +563,7 @@ def nearestOn(point, point1, point2, within=True, height=None, wrap=False,
558
563
  def perimeterOf(points, **closed_datum_wrap):
559
564
  '''DEPRECATED, use function L{ellipsoidalExact.perimeterOf} or L{ellipsoidalKarney.perimeterOf}.
560
565
  '''
561
- try:
562
- return _MODS.ellipsoidalKarney.perimeterOf(points, **closed_datum_wrap)
563
- except ImportError:
564
- return _MODS.ellipsoidalExact.perimeterOf(points, **closed_datum_wrap)
566
+ return _ellipsoidalOf(perimeterOf, points, **closed_datum_wrap)
565
567
 
566
568
 
567
569
  __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.28'
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
@@ -398,7 +398,7 @@ class Ellipsoid(_NamedEnumItem):
398
398
  def AlphaKs(self):
399
399
  '''Get the I{Krüger} U{Alpha series coefficients<https://GeographicLib.SourceForge.io/C++/doc/tmseries30.html>} (C{KsOrder}C{-tuple}).
400
400
  '''
401
- 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 ;
402
402
  # n n**2 n**3 n**4 n**5 n**6 n**7 n**8
403
403
  _T(1/2, -2/3, 5/16, 41/180, -127/288, 7891/37800, 72161/387072, -18975107/50803200),
404
404
  _T(13/48, -3/5, 557/1440, 281/630, -1983433/1935360, 13769/28800, 148003883/174182400), # PYCHOK unaligned
@@ -617,7 +617,7 @@ class Ellipsoid(_NamedEnumItem):
617
617
  def BetaKs(self):
618
618
  '''Get the I{Krüger} U{Beta series coefficients<https://GeographicLib.SourceForge.io/C++/doc/tmseries30.html>} (C{KsOrder}C{-tuple}).
619
619
  '''
620
- 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 ;
621
621
  # n n**2 n**3 n**4 n**5 n**6 n**7 n**8
622
622
  _T(1/2, -2/3, 37/96, -1/360, -81/512, 96199/604800, -5406467/38707200, 7944359/67737600),
623
623
  _T(1/48, 1/15, -437/1440, 46/105, -1118711/3870720, 51841/1209600, 24749483/348364800), # PYCHOK unaligned
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.28'
103
103
 
104
104
  _TolRD = zqrt(EPS * 0.002)
105
105
  _TolRF = zqrt(EPS * 0.030)
@@ -165,9 +165,9 @@ class Elliptic(_Named):
165
165
  that case, we have C{Π(φ, 0, k) = F(φ, k), G(φ, 0, k) =
166
166
  E(φ, k)} and C{H(φ, 0, k) = F(φ, k) - D(φ, k)}.
167
167
  '''
168
- self.reset(k2=k2, alpha2=alpha2, kp2=kp2, alphap2=alphap2)
169
168
  if name:
170
169
  self.name = name
170
+ self.reset(k2=k2, alpha2=alpha2, kp2=kp2, alphap2=alphap2)
171
171
 
172
172
  @Property_RO
173
173
  def alpha2(self):
@@ -760,15 +760,20 @@ class Elliptic(_Named):
760
760
  that these conditions are met to enable accuracy to be
761
761
  maintained, e.g., when C{k} is very close to unity.
762
762
  '''
763
+ def _1p2(kp2, k2):
764
+ return (_1_0 - k2) if kp2 is None else kp2
765
+
766
+ def _S(**kwds):
767
+ return Scalar_(Error=EllipticError, **kwds)
768
+
763
769
  if self.__dict__:
764
770
  _update_all(self, _Named.iteration._uname, Base=Property_RO)
765
771
 
766
- self._k2 = Scalar_(k2=k2, Error=EllipticError, low=None, high=_1_0)
767
- self._kp2 = Scalar_(kp2=((_1_0 - k2) if kp2 is None else kp2), Error=EllipticError)
772
+ self._k2 = _S(k2 = k2, low=None, high=_1_0)
773
+ self._kp2 = _S(kp2=_1p2(kp2, k2)) # low=_0_0
768
774
 
769
- self._alpha2 = Scalar_(alpha2=alpha2, Error=EllipticError, low=None, high=_1_0)
770
- self._alphap2 = Scalar_(alphap2=((_1_0 - alpha2) if alphap2 is None else alphap2),
771
- Error=EllipticError)
775
+ self._alpha2 = _S(alpha2 = alpha2, low=None, high=_1_0)
776
+ self._alphap2 = _S(alphap2=_1p2(alphap2, alpha2)) # low=_0_0
772
777
 
773
778
  # Values of complete elliptic integrals for k = 0,1 and alpha = 0,1
774
779
  # K E D
@@ -1120,11 +1125,11 @@ def _rC(unused, x, y):
1120
1125
  '''(INTERNAL) Defined only for C{y != 0} and C{x >= 0}.
1121
1126
  '''
1122
1127
  d = x - y
1123
- if d < 0: # catch NaN
1128
+ if x < y: # catch NaN
1124
1129
  # <https://DLMF.NIST.gov/19.2.E18>
1125
- d = -d
1130
+ d = y - x
1126
1131
  r = atan(sqrt(d / x)) if x > 0 else PI_2
1127
- elif d == 0: # XXX d < EPS0? or EPS02 or _EPSmin
1132
+ elif x == y: # XXX d < EPS0? or EPS02 or _EPSmin
1128
1133
  d, r = y, _1_0
1129
1134
  elif y > 0: # <https://DLMF.NIST.gov/19.2.E19>
1130
1135
  r = asinh(sqrt(d / y)) # atanh(sqrt((x - y) / x))
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.30'
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
@@ -70,7 +70,7 @@ class Fdot_(Fdot):
70
70
  '''Precision dot product.
71
71
  '''
72
72
  def __init__(self, *xys, **start_name_f2product_nonfinites_RESIDUAL):
73
- '''New L{Fdot_} precision dot product M{sum(xys[i] * xys[i+1] for i in
73
+ '''New L{Fdot_} precision dot product M{start + sum(xys[i] * xys[i+1] for i in
74
74
  range(0, len(xys), B{2}))}.
75
75
 
76
76
  @arg xys: Pairwise values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}),
@@ -439,7 +439,7 @@ def favg(a, b, f=_0_5, nonfinites=True):
439
439
 
440
440
 
441
441
  def fdot(xs, *ys, **start_f2product_nonfinites):
442
- '''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)))}.
443
443
 
444
444
  @arg xs: Iterable of values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}).
445
445
  @arg ys: Other values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}), all positional.
@@ -460,7 +460,7 @@ def fdot(xs, *ys, **start_f2product_nonfinites):
460
460
 
461
461
 
462
462
  def fdot_(*xys, **start_f2product_nonfinites):
463
- '''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}))}.
464
464
 
465
465
  @arg xys: Pairwise values (each C{scalar}, an L{Fsum} or L{Fsum2Tuple}), all positional.
466
466
 
@@ -987,7 +987,7 @@ def _powers(x, n):
987
987
 
988
988
 
989
989
  def _root(x, p, where):
990
- '''(INTERNAL) Raise C{x} to power C{0 < p < 1}.
990
+ '''(INTERNAL) Raise C{x} to power C{0 <= p < 1}.
991
991
  '''
992
992
  try:
993
993
  if x > 0:
@@ -997,7 +997,7 @@ def _root(x, p, where):
997
997
  raise ValueError(_negative_)
998
998
  except Exception as X:
999
999
  raise _xError(X, unstr(where, x))
1000
- return _0_0 if p else _1_0
1000
+ return _0_0 if p else _1_0 # x == 0
1001
1001
 
1002
1002
 
1003
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.26'
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
@@ -153,7 +153,7 @@ class Frechet(_Named):
153
153
  @raise FrechetError: Insufficient number of B{C{point1s}} or an invalid
154
154
  B{C{point1}}, B{C{fraction}} or B{C{units}}.
155
155
  '''
156
- name, kwds = _name2__(**name__kwds) # name__=self.__class__
156
+ name, kwds = _name2__(**name__kwds) # name__=type(self)
157
157
  if name:
158
158
  self.name = name
159
159
 
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):