pygeodesy 24.6.1__py2.py3-none-any.whl → 24.6.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.
Files changed (89) hide show
  1. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.6.24.dist-info/RECORD +117 -0
  3. pygeodesy/__init__.py +33 -32
  4. pygeodesy/albers.py +2 -2
  5. pygeodesy/auxilats/__init__.py +1 -1
  6. pygeodesy/auxilats/auxAngle.py +40 -39
  7. pygeodesy/auxilats/auxDLat.py +3 -2
  8. pygeodesy/auxilats/auxLat.py +16 -18
  9. pygeodesy/auxilats/auxily.py +1 -1
  10. pygeodesy/azimuthal.py +10 -10
  11. pygeodesy/basics.py +9 -1
  12. pygeodesy/booleans.py +53 -66
  13. pygeodesy/cartesianBase.py +143 -155
  14. pygeodesy/css.py +14 -18
  15. pygeodesy/datums.py +6 -6
  16. pygeodesy/deprecated/__init__.py +1 -1
  17. pygeodesy/deprecated/classes.py +16 -2
  18. pygeodesy/deprecated/datum.py +3 -3
  19. pygeodesy/deprecated/functions.py +6 -8
  20. pygeodesy/dms.py +23 -27
  21. pygeodesy/ecef.py +49 -55
  22. pygeodesy/elevations.py +4 -4
  23. pygeodesy/ellipsoidalBase.py +28 -70
  24. pygeodesy/ellipsoidalBaseDI.py +19 -23
  25. pygeodesy/ellipsoidalExact.py +3 -3
  26. pygeodesy/ellipsoidalGeodSolve.py +15 -23
  27. pygeodesy/ellipsoidalKarney.py +37 -60
  28. pygeodesy/ellipsoidalNvector.py +44 -50
  29. pygeodesy/ellipsoidalVincenty.py +11 -14
  30. pygeodesy/ellipsoids.py +107 -101
  31. pygeodesy/errors.py +101 -49
  32. pygeodesy/etm.py +32 -44
  33. pygeodesy/formy.py +55 -58
  34. pygeodesy/frechet.py +20 -23
  35. pygeodesy/fsums.py +4 -4
  36. pygeodesy/gars.py +3 -4
  37. pygeodesy/geodesici.py +909 -0
  38. pygeodesy/geodesicw.py +11 -13
  39. pygeodesy/geodesicx/__init__.py +4 -4
  40. pygeodesy/geodesicx/gx.py +18 -28
  41. pygeodesy/geodesicx/gxbases.py +20 -8
  42. pygeodesy/geodesicx/gxline.py +16 -22
  43. pygeodesy/geodsolve.py +102 -34
  44. pygeodesy/geohash.py +39 -60
  45. pygeodesy/geoids.py +28 -37
  46. pygeodesy/hausdorff.py +21 -23
  47. pygeodesy/heights.py +15 -28
  48. pygeodesy/internals.py +19 -12
  49. pygeodesy/interns.py +4 -10
  50. pygeodesy/iters.py +2 -2
  51. pygeodesy/karney.py +20 -4
  52. pygeodesy/ktm.py +13 -16
  53. pygeodesy/latlonBase.py +202 -191
  54. pygeodesy/lazily.py +96 -59
  55. pygeodesy/lcc.py +29 -32
  56. pygeodesy/ltp.py +43 -24
  57. pygeodesy/ltpTuples.py +190 -183
  58. pygeodesy/mgrs.py +35 -9
  59. pygeodesy/named.py +106 -72
  60. pygeodesy/namedTuples.py +43 -14
  61. pygeodesy/nvectorBase.py +23 -27
  62. pygeodesy/osgr.py +9 -9
  63. pygeodesy/points.py +7 -7
  64. pygeodesy/rhumb/__init__.py +1 -1
  65. pygeodesy/rhumb/aux_.py +5 -5
  66. pygeodesy/rhumb/bases.py +30 -31
  67. pygeodesy/rhumb/ekx.py +3 -4
  68. pygeodesy/rhumb/solve.py +8 -61
  69. pygeodesy/solveBase.py +22 -19
  70. pygeodesy/sphericalBase.py +26 -21
  71. pygeodesy/sphericalNvector.py +13 -13
  72. pygeodesy/sphericalTrigonometry.py +86 -97
  73. pygeodesy/streprs.py +8 -36
  74. pygeodesy/trf.py +3 -3
  75. pygeodesy/triaxials.py +117 -91
  76. pygeodesy/units.py +229 -321
  77. pygeodesy/unitsBase.py +116 -108
  78. pygeodesy/ups.py +26 -31
  79. pygeodesy/utily.py +12 -11
  80. pygeodesy/utm.py +35 -40
  81. pygeodesy/utmups.py +43 -46
  82. pygeodesy/utmupsBase.py +9 -10
  83. pygeodesy/vector3d.py +59 -62
  84. pygeodesy/vector3dBase.py +17 -15
  85. pygeodesy/webmercator.py +19 -21
  86. pygeodesy/wgrs.py +18 -20
  87. PyGeodesy-24.6.1.dist-info/RECORD +0 -116
  88. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/WHEEL +0 -0
  89. {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.24.dist-info}/top_level.txt +0 -0
pygeodesy/basics.py CHANGED
@@ -30,13 +30,14 @@ from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _FOR_DOCS, _getenv,
30
30
  # from pygeodesy.nvectorBase import NvectorBase # _MODS
31
31
  # from pygeodesy.props import _update_all # _MODS
32
32
  # from pygeodesy.streprs import Fmt # _MODS
33
+ # from pygeodesy.unitsBase import _NamedUnit, Str # _MODS
33
34
 
34
35
  from copy import copy as _copy, deepcopy as _deepcopy
35
36
  from math import copysign as _copysign
36
37
  import inspect as _inspect
37
38
 
38
39
  __all__ = _ALL_LAZY.basics
39
- __version__ = '24.05.29'
40
+ __version__ = '24.06.15'
40
41
 
41
42
  _below_ = 'below'
42
43
  _list_tuple_types = (list, tuple)
@@ -194,6 +195,13 @@ def copytype(x, y):
194
195
  return type(y)(x if x else _0_0)
195
196
 
196
197
 
198
+ def _enumereverse(iterable):
199
+ '''(INTERNAL) Reversed C{enumberate}.
200
+ '''
201
+ for j in _reverange(len(iterable)):
202
+ yield j, iterable[j]
203
+
204
+
197
205
  def halfs2(str2):
198
206
  '''Split a string in 2 halfs.
199
207
 
pygeodesy/booleans.py CHANGED
@@ -20,7 +20,7 @@ from __future__ import division as _; del _ # PYCHOK semicolon
20
20
  from pygeodesy.basics import isodd, issubclassof, map2, _xscalar
21
21
  from pygeodesy.constants import EPS, EPS2, INT0, _0_0, _0_5, _1_0
22
22
  from pygeodesy.errors import ClipError, _IsnotError, _TypeError, \
23
- _ValueError, _xattr, _xkwds_get
23
+ _ValueError, _xattr, _xkwds_get, _xkwds_pop2
24
24
  from pygeodesy.fmath import favg, hypot, hypot2
25
25
  # from pygeodesy.fsums import fsum1 # _MODS
26
26
  from pygeodesy.interns import NN, _BANG_, _clip_, _clipid_, _COMMASPACE_, \
@@ -43,7 +43,7 @@ from pygeodesy.utily import fabs, _unrollon, _Wrap
43
43
  # from math import fabs # from .utily
44
44
 
45
45
  __all__ = _ALL_LAZY.booleans
46
- __version__ = '24.05.29'
46
+ __version__ = '24.06.15'
47
47
 
48
48
  _0_EPS = EPS # near-zero, positive
49
49
  _EPS_0 = -EPS # near-zero, negative
@@ -124,30 +124,28 @@ class _LatLonBool(_Named):
124
124
  _next = None # link to the next vertex
125
125
  _prev = None # link to the previous vertex
126
126
 
127
- def __init__(self, lat_ll, lon=None, height=0, clipid=INT0,
128
- wrap=False, **name):
129
- '''New C{LatLon[FHP|GH]} from separate C{lat}, C{lon}, C{height}
130
- and C{clipid} scalars or from a previous C{LatLon[FHP|GH]},
131
- a C{Clip[FHP|GH]4Tuple} or some other C{LatLon} instance.
132
-
133
- @arg lat_ll: Latitude (C{scalar}) or a lat/longitude
134
- (C{LatLon[FHP|GH]}, aC{Clip[FHP|GH]4Tuple}
135
- or some other C{LatLon}).
136
- @kwarg lon: Longitude (C{scalar}), iff B{C{lat_ll}} is
137
- scalar, ignored otherwise.
127
+ def __init__(self, lat_ll, lon=None, height=0, clipid=INT0, wrap=False, **name):
128
+ '''New C{LatLon[FHP|GH]} from separate C{lat}, C{lon}, C{height} and C{clipid}
129
+ scalars or from a previous C{LatLon[FHP|GH]}, C{Clip[FHP|GH]4Tuple} or some
130
+ other C{LatLon} instance.
131
+
132
+ @arg lat_ll: Latitude (C{scalar}) or a lat-/longitude (C{LatLon[FHP|GH]},
133
+ C{Clip[FHP|GH]4Tuple} or some other C{LatLon}).
134
+ @kwarg lon: Longitude (C{scalar}), required B{C{lat_ll}} is scalar,
135
+ ignored otherwise.
138
136
  @kwarg height: Height (C{scalar}), conventionally C{meter}.
139
137
  @kwarg clipid: Clip identifier (C{int}).
140
- @kwarg wrap: If C{True}, wrap or I{normalize} B{C{lat}}
141
- and B{C{lon}} (C{bool}).
142
- @kwarg name: Optional name (C{str}).
138
+ @kwarg wrap: If C{True}, wrap or I{normalize} B{C{lat}} and B{C{lon}} (C{bool}).
139
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
143
140
  '''
141
+ h, name = _xkwds_pop2(name, h=height) if name else (height, name)
142
+
144
143
  if lon is None:
145
144
  y, x = lat_ll.lat, lat_ll.lon
146
- h = _xattr(lat_ll, height=height)
145
+ h = _xattr(lat_ll, height=h)
147
146
  c = _xattr(lat_ll, clipid=clipid)
148
147
  else:
149
- y, x = lat_ll, lon
150
- h, c = height, clipid
148
+ y, x, c = lat_ll, lon, clipid
151
149
  self.y, self.x = _Wrap.latlon(y, x) if wrap else (y, x)
152
150
  # don't duplicate defaults
153
151
  if self._height != h:
@@ -301,22 +299,17 @@ class LatLonFHP(_LatLonBool):
301
299
  _2split = None # or C{._Clip}
302
300
  _2xing = False
303
301
 
304
- def __init__(self, lat_ll, *lon_h_clipid, **wrap_name):
305
- '''New C{LatLonFHP} from separate C{lat}, C{lon}, C{h}eight
306
- and C{clipid} scalars, or from a previous L{LatLonFHP},
307
- a L{ClipFHP4Tuple} or some other C{LatLon} instance.
308
-
309
- @arg lat_ll: Latitude (C{scalar}) or a lat/longitude
310
- (L{LatLonFHP}, C{LatLon} or L{ClipFHP4Tuple}).
311
- @arg lon_h_clipid: Longitude (C{scalar}), C{h}eight and
312
- C{clipid} iff B{C{lat_ll}} is scalar,
313
- ignored otherwise.
314
- @kwarg wrap_name: Keyword arguments C{B{wrap}=False} and
315
- C{B{name}=NN}. If C{B{wrap} is True}, wrap
316
- or I{normalize} the lat- and longitude
317
- (C{bool}). Optional B{C{name}} (C{str}).
318
- '''
319
- _LatLonBool.__init__(self, lat_ll, *lon_h_clipid, **wrap_name)
302
+ def __init__(self, lat_ll, lon=None, height=0, clipid=INT0, **wrap_name):
303
+ '''New C{LatLonFHP} from separate C{lat}, C{lon}, C{h}eight and C{clipid}
304
+ scalars, or from a previous L{LatLonFHP}, L{ClipFHP4Tuple} or some other
305
+ C{LatLon} instance.
306
+
307
+ @arg lat_ll: Latitude (C{scalar}) or a lat-/longitude (L{LatLonFHP},
308
+ L{ClipFHP4Tuple} or some other C{LatLon}).
309
+
310
+ @see: L{Here<_LatLonBool.__init__>} for further details.
311
+ '''
312
+ _LatLonBool.__init__(self, lat_ll, lon, height, clipid, **wrap_name)
320
313
 
321
314
  def __add__(self, other):
322
315
  _other(self, other)
@@ -364,15 +357,15 @@ class LatLonFHP(_LatLonBool):
364
357
  # return d
365
358
 
366
359
  def isenclosedBy(self, *composites_points, **wrap):
367
- '''Is this point inside one or more composites or polygons based
368
- the U{winding number<https://www.ScienceDirect.com/science/
369
- article/pii/S0925772101000128>}?
360
+ '''Is this point inside one or more composites or polygons based on
361
+ the U{winding number<https://www.ScienceDirect.com/science/article/
362
+ pii/S0925772101000128>}?
370
363
 
371
364
  @arg composites_points: Composites and/or iterables of points
372
365
  (L{ClipFHP4Tuple}, L{ClipGH4Tuple}, L{LatLonFHP},
373
366
  L{LatLonGH} or any C{LatLon}).
374
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
375
- C{points} (C{bool}).
367
+ @kwarg wrap: Optional keyword argument C{B{wrap}=False}, if C{True},
368
+ wrap or I{normalize} and unroll all C{points} (C{bool}).
376
369
 
377
370
  @raise ValueError: Some C{points} invalid.
378
371
 
@@ -462,22 +455,17 @@ class LatLonGH(_LatLonBool):
462
455
  '''
463
456
  _entry = None # entry or exit iff intersection
464
457
 
465
- def __init__(self, lat_ll, *lon_h_clipid, **wrap_name):
466
- '''New C{LatLonGH} from separate C{lat}, C{lon}, C{h}eight
467
- and C{clipid} scalars, or from a previous L{LatLonGH},
468
- L{ClipGH4Tuple} or some other C{LatLon} instance.
469
-
470
- @arg lat_ll: Latitude (C{scalar}) or a lat/longitude
471
- (L{LatLonGH}, C{LatLon} or L{ClipGH4Tuple}).
472
- @arg lon_h_clipid: Longitude (C{scalar}), C{h}eight and
473
- C{clipid} iff B{C{lat_ll}} is scalar,
474
- ignored otherwise.
475
- @kwarg wrap_name: Keyword arguments C{B{wrap}=False} and
476
- C{B{name}=NN}. If C{B{wrap} is True}, wrap
477
- or I{normalize} the lat- and longitude
478
- (C{bool}). Optional B{C{name}} (C{str}).
458
+ def __init__(self, lat_ll, lon=None, height=0, clipid=INT0, **wrap_name):
459
+ '''New C{LatLonGH} from separate C{lat}, C{lon}, C{h}eight and C{clipid}
460
+ scalars, or from a previous L{LatLonGH}, L{ClipGH4Tuple} or some other
461
+ C{LatLon} instance.
462
+
463
+ @arg lat_ll: Latitude (C{scalar}) or a lat-/longitude (L{LatLonGH},
464
+ L{ClipGH4Tuple} or some other C{LatLon}).
465
+
466
+ @see: L{Here<_LatLonBool.__init__>} for further details.
479
467
  '''
480
- _LatLonBool.__init__(self, lat_ll, *lon_h_clipid, **wrap_name)
468
+ _LatLonBool.__init__(self, lat_ll, lon, height, clipid, **wrap_name)
481
469
 
482
470
  def _check(self):
483
471
  # Check-mark this vertex and its link.
@@ -498,8 +486,8 @@ class LatLonGH(_LatLonBool):
498
486
  @arg composites_points: Composites and/or iterables of points
499
487
  (L{ClipFHP4Tuple}, L{ClipGH4Tuple}, L{LatLonFHP},
500
488
  L{LatLonGH} or any C{LatLon}).
501
- @kwarg wrap: If C{True}, wrap or I{normalize} and unroll the
502
- C{points} (C{bool}).
489
+ @kwarg wrap: Optional keyword argument C{B{wrap}=False}, if C{True},
490
+ wrap or I{normalize} and unroll all C{points} (C{bool}).
503
491
 
504
492
  @raise ValueError: Some B{C{points}} invalid.
505
493
  '''
@@ -667,7 +655,7 @@ class _Clip(_Named):
667
655
  return map2(float, _MODS.points.boundsOf(self, wrap=False))
668
656
 
669
657
  def _bltr4eps(self, eps):
670
- # Get the ._bltr4 bounds tuple, oversized.
658
+ # Get the ._bltr4 bounds tuple, slightly oversized.
671
659
  if eps > 0: # > EPS
672
660
  yb, xl, yt, xr = self._bltr4
673
661
  yb, yt = _low_high_eps2(yb, yt, eps)
@@ -806,8 +794,8 @@ class _Clip(_Named):
806
794
 
807
795
  def _noXings(self, Union):
808
796
  # Are all intersections non-CROSSINGs, -BOUNCINGs?
809
- Ls = _L.BOUNCINGs if Union else _L.CROSSINGs
810
- return all(v._label not in Ls for v in self._intersections())
797
+ Xings = _L.BOUNCINGs if Union else _L.CROSSINGs
798
+ return all(v._label not in Xings for v in self._intersections())
811
799
 
812
800
  def _OpenClipError(self, s, e): # PYCHOK no cover
813
801
  # Return a C{CloseError} instance
@@ -1810,7 +1798,7 @@ class BooleanFHP(_CompositeFHP, _BooleanBase):
1810
1798
  @kwarg raiser: If C{True}, throw L{ClipError} exceptions (C{bool}).
1811
1799
  @kwarg esp: Tolerance for eliminating null edges (C{degrees}, same
1812
1800
  units as the B{C{lls}} coordinates).
1813
- @kwarg name: Optional name (C{str}).
1801
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
1814
1802
  '''
1815
1803
  _CompositeFHP.__init__(self, lls, raiser=raiser, eps=eps, **name)
1816
1804
 
@@ -1874,7 +1862,7 @@ class BooleanGH(_CompositeGH, _BooleanBase):
1874
1862
  attempt to handle the latter (C{bool}).
1875
1863
  @kwarg esp: Tolerance for eliminating null edges (C{degrees}, same
1876
1864
  units as the B{C{lls}} coordinates).
1877
- @kwarg name: Optional name (C{str}).
1865
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
1878
1866
  '''
1879
1867
  _CompositeGH.__init__(self, lls, raiser=raiser, xtend=xtend, eps=eps, **name)
1880
1868
 
@@ -1937,9 +1925,8 @@ def isBoolean(obj):
1937
1925
 
1938
1926
  @arg obj: The object (any C{type}).
1939
1927
 
1940
- @return: C{True} if B{C{obj}} is L{BooleanFHP},
1941
- L{BooleanGH} oe some other composite,
1942
- C{False} otherwise.
1928
+ @return: C{True} if B{C{obj}} is L{BooleanFHP}, L{BooleanGH}
1929
+ or some other composite, C{False} otherwise.
1943
1930
  '''
1944
1931
  return isinstance(obj, _CompositeBase)
1945
1932
 
@@ -1974,7 +1961,7 @@ def _other(this, other):
1974
1961
  C = this.__class__
1975
1962
  if isinstance(other, C):
1976
1963
  return other
1977
- raise _IsnotError(C.__name__, other=other)
1964
+ raise _IsnotError(C, other=other)
1978
1965
 
1979
1966
 
1980
1967
  def _outside(x1, x2, lo, hi):