pygeodesy 24.5.15__py2.py3-none-any.whl → 24.5.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 (72) hide show
  1. {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.5.24.dist-info/RECORD +116 -0
  3. pygeodesy/__init__.py +1 -1
  4. pygeodesy/albers.py +41 -41
  5. pygeodesy/auxilats/__init__.py +1 -1
  6. pygeodesy/auxilats/auxAngle.py +32 -31
  7. pygeodesy/auxilats/auxLat.py +80 -51
  8. pygeodesy/azimuthal.py +123 -124
  9. pygeodesy/basics.py +8 -6
  10. pygeodesy/booleans.py +11 -12
  11. pygeodesy/cartesianBase.py +25 -23
  12. pygeodesy/clipy.py +3 -3
  13. pygeodesy/css.py +50 -42
  14. pygeodesy/datums.py +42 -41
  15. pygeodesy/dms.py +6 -6
  16. pygeodesy/ecef.py +23 -24
  17. pygeodesy/ellipsoidalBase.py +28 -27
  18. pygeodesy/ellipsoidalBaseDI.py +3 -4
  19. pygeodesy/ellipsoidalNvector.py +11 -12
  20. pygeodesy/ellipsoids.py +41 -35
  21. pygeodesy/elliptic.py +3 -4
  22. pygeodesy/epsg.py +4 -3
  23. pygeodesy/errors.py +34 -12
  24. pygeodesy/etm.py +62 -54
  25. pygeodesy/fmath.py +36 -30
  26. pygeodesy/formy.py +93 -65
  27. pygeodesy/frechet.py +117 -102
  28. pygeodesy/fstats.py +21 -14
  29. pygeodesy/fsums.py +67 -57
  30. pygeodesy/gars.py +10 -9
  31. pygeodesy/geodesicw.py +19 -17
  32. pygeodesy/geodesicx/__init__.py +1 -1
  33. pygeodesy/geodesicx/gx.py +40 -32
  34. pygeodesy/geodesicx/gxarea.py +12 -9
  35. pygeodesy/geodesicx/gxbases.py +3 -4
  36. pygeodesy/geodesicx/gxline.py +6 -8
  37. pygeodesy/geodsolve.py +28 -27
  38. pygeodesy/geohash.py +47 -44
  39. pygeodesy/geoids.py +34 -32
  40. pygeodesy/hausdorff.py +112 -99
  41. pygeodesy/heights.py +134 -127
  42. pygeodesy/internals.py +14 -9
  43. pygeodesy/interns.py +3 -6
  44. pygeodesy/iters.py +19 -17
  45. pygeodesy/karney.py +15 -12
  46. pygeodesy/ktm.py +25 -18
  47. pygeodesy/latlonBase.py +12 -11
  48. pygeodesy/lazily.py +4 -4
  49. pygeodesy/lcc.py +24 -25
  50. pygeodesy/ltp.py +83 -71
  51. pygeodesy/ltpTuples.py +7 -5
  52. pygeodesy/mgrs.py +3 -3
  53. pygeodesy/named.py +126 -42
  54. pygeodesy/namedTuples.py +33 -25
  55. pygeodesy/nvectorBase.py +7 -7
  56. pygeodesy/points.py +9 -9
  57. pygeodesy/rhumb/__init__.py +1 -1
  58. pygeodesy/solveBase.py +5 -5
  59. pygeodesy/sphericalTrigonometry.py +5 -5
  60. pygeodesy/streprs.py +5 -5
  61. pygeodesy/trf.py +5 -5
  62. pygeodesy/triaxials.py +67 -63
  63. pygeodesy/units.py +35 -35
  64. pygeodesy/unitsBase.py +24 -11
  65. pygeodesy/utm.py +53 -53
  66. pygeodesy/utmupsBase.py +10 -8
  67. pygeodesy/vector2d.py +6 -7
  68. pygeodesy/vector3d.py +16 -17
  69. pygeodesy/vector3dBase.py +4 -5
  70. PyGeodesy-24.5.15.dist-info/RECORD +0 -116
  71. {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/WHEEL +0 -0
  72. {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/top_level.txt +0 -0
pygeodesy/geodesicx/gx.py CHANGED
@@ -43,16 +43,16 @@ from pygeodesy.constants import EPS, EPS0, EPS02, MANT_DIG, NAN, PI, _EPSqrt, \
43
43
  _4_0, _6_0, _8_0, _16_0, _90_0, _180_0, _1000_0
44
44
  from pygeodesy.datums import _earth_datum, _WGS84, _EWGS84
45
45
  # from pygeodesy.ellipsoids import _EWGS84 # from .datums
46
+ from pygeodesy.errors import GeodesicError, _xkwds_pop2
46
47
  from pygeodesy.fmath import hypot as _hypot
47
48
  from pygeodesy.fsums import fsumf_, fsum1f_
48
49
  from pygeodesy.geodesicx.gxbases import _cosSeries, _GeodesicBase, \
49
50
  _sincos12, _sin1cos2, _xnC4
50
51
  from pygeodesy.geodesicx.gxline import _GeodesicLineExact, _TINY, _update_glXs
51
52
  from pygeodesy.interns import NN, _COMMASPACE_, _DOT_, _UNDER_
52
- from pygeodesy.karney import _around, _atan2d, Caps, _cbrt, _diff182, \
53
- _fix90, GDict, GeodesicError, _K_2_0, \
54
- _norm2, _norm180, _polynomial, _signBit, \
55
- _sincos2, _sincos2d, _sincos2de, _unsigned2
53
+ from pygeodesy.karney import GDict, _around, _atan2d, Caps, _cbrt, _diff182, \
54
+ _fix90, _K_2_0, _norm2, _norm180, _polynomial, \
55
+ _signBit, _sincos2, _sincos2d, _sincos2de, _unsigned2
56
56
  from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS
57
57
  from pygeodesy.namedTuples import Destination3Tuple, Distance3Tuple
58
58
  from pygeodesy.props import deprecated_Property, Property, Property_RO, property_RO
@@ -62,7 +62,7 @@ from pygeodesy.utily import atan2d as _atan2d_reverse, _unrollon, _Wrap, wrap360
62
62
  from math import atan2, copysign, cos, degrees, fabs, radians, sqrt
63
63
 
64
64
  __all__ = ()
65
- __version__ = '24.02.21'
65
+ __version__ = '24.05.20'
66
66
 
67
67
  _MAXIT1 = 20
68
68
  _MAXIT2 = 10 + _MAXIT1 + MANT_DIG # MANT_DIG == C++ digits
@@ -134,8 +134,7 @@ class GeodesicExact(_GeodesicBase):
134
134
  _datum = _WGS84
135
135
  _nC4 = 30 # default C4order
136
136
 
137
- def __init__(self, a_ellipsoid=_EWGS84, f=None, name=NN, C4order=None,
138
- C4Order=None): # for backward compatibility
137
+ def __init__(self, a_ellipsoid=_EWGS84, f=None, C4order=None, **name_C4Order): # for backward compatibility
139
138
  '''New L{GeodesicExact} instance.
140
139
 
141
140
  @arg a_ellipsoid: An ellipsoid (L{Ellipsoid}) or datum (L{Datum}) or
@@ -143,20 +142,25 @@ class GeodesicExact(_GeodesicBase):
143
142
  conventionally in C{meter}), see B{C{f}}.
144
143
  @arg f: The flattening of the ellipsoid (C{scalar}) if B{C{a_ellipsoid}}
145
144
  is specified as C{scalar}.
146
- @kwarg name: Optional name (C{str}).
147
145
  @kwarg C4order: Optional series expansion order (C{int}), see property
148
146
  L{C4order}, default C{30}.
149
- @kwarg C4Order: DEPRECATED, use keyword argument B{C{C4order}}.
147
+ @kwarg name_C4Order: Optional C{B{name}=NN} (C{str}) and the DEPRECATED
148
+ keyword argument C{C4Order}, use B{C{C4order}} instead.
150
149
 
151
150
  @raise GeodesicError: Invalid B{C{C4order}}.
152
151
  '''
153
- _earth_datum(self, a_ellipsoid, f=f, name=name)
154
- if name:
155
- self.name = name
152
+ if name_C4Order:
153
+ C4Order, name = _xkwds_pop2(name_C4Order, C4Order=C4order)
154
+ if C4Order: # for backward compatibility
155
+ self.C4order = C4Order
156
+ if name:
157
+ self.name = name
158
+ else:
159
+ name = {} # name_C4Order
160
+
161
+ _earth_datum(self, a_ellipsoid, f=f, **name)
156
162
  if C4order: # XXX private copy, always?
157
163
  self.C4order = C4order
158
- elif C4Order: # for backward compatibility
159
- self.C4Order = C4Order
160
164
 
161
165
  @Property_RO
162
166
  def a(self):
@@ -184,7 +188,7 @@ class GeodesicExact(_GeodesicBase):
184
188
  '''
185
189
  return self._GDictDirect(lat1, lon1, azi1, True, a12, outmask)
186
190
 
187
- def ArcDirectLine(self, lat1, lon1, azi1, a12, caps=Caps.ALL, name=NN):
191
+ def ArcDirectLine(self, lat1, lon1, azi1, a12, caps=Caps.ALL, **name):
188
192
  '''Define a L{GeodesicLineExact} in terms of the I{direct} geodesic problem and as arc length.
189
193
 
190
194
  @arg lat1: Latitude of the first point (C{degrees}).
@@ -196,6 +200,7 @@ class GeodesicExact(_GeodesicBase):
196
200
  should possess, i.e., which quantities can be
197
201
  returned by calls to L{GeodesicLineExact.Position}
198
202
  and L{GeodesicLineExact.ArcPosition}.
203
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
199
204
 
200
205
  @return: A L{GeodesicLineExact} instance.
201
206
 
@@ -208,15 +213,15 @@ class GeodesicExact(_GeodesicBase):
208
213
  <https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>} and
209
214
  Python U{Geodesic.ArcDirectLine<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
210
215
  '''
211
- return self._GenDirectLine(lat1, lon1, azi1, True, a12, caps, name=name)
216
+ return self._GenDirectLine(lat1, lon1, azi1, True, a12, caps, **name)
212
217
 
213
- def Area(self, polyline=False, name=NN):
218
+ def Area(self, polyline=False, **name):
214
219
  '''Set up a L{GeodesicAreaExact} to compute area and
215
220
  perimeter of a polygon.
216
221
 
217
222
  @kwarg polyline: If C{True} perimeter only, otherwise
218
223
  area and perimeter (C{bool}).
219
- @kwarg name: Optional name (C{str}).
224
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
220
225
 
221
226
  @return: A L{GeodesicAreaExact} instance.
222
227
 
@@ -224,7 +229,7 @@ class GeodesicExact(_GeodesicBase):
224
229
  to the returned L{GeodesicAreaExact} instance.
225
230
  '''
226
231
  gaX = _MODS.geodesicx.GeodesicAreaExact(self, polyline=polyline,
227
- name=name or self.name)
232
+ name=self._name__(name))
228
233
  if self.debug:
229
234
  gaX.verbose = True
230
235
  return gaX
@@ -362,7 +367,7 @@ class GeodesicExact(_GeodesicBase):
362
367
  '''
363
368
  return self.DirectLine(ll1.lat, ll1.lon, azi12, s12, **caps_name)
364
369
 
365
- def DirectLine(self, lat1, lon1, azi1, s12, caps=Caps.STANDARD, name=NN):
370
+ def DirectLine(self, lat1, lon1, azi1, s12, caps=Caps.STANDARD, **name):
366
371
  '''Define a L{GeodesicLineExact} in terms of the I{direct} geodesic problem and as distance.
367
372
 
368
373
  @arg lat1: Latitude of the first point (C{degrees}).
@@ -373,6 +378,7 @@ class GeodesicExact(_GeodesicBase):
373
378
  the capabilities the L{GeodesicLineExact} instance
374
379
  should possess, i.e., which quantities can be
375
380
  returned by calls to L{GeodesicLineExact.Position}.
381
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
376
382
 
377
383
  @return: A L{GeodesicLineExact} instance.
378
384
 
@@ -385,7 +391,7 @@ class GeodesicExact(_GeodesicBase):
385
391
  <https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>} and
386
392
  Python U{Geodesic.DirectLine<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
387
393
  '''
388
- return self._GenDirectLine(lat1, lon1, azi1, False, s12, caps, name=name)
394
+ return self._GenDirectLine(lat1, lon1, azi1, False, s12, caps, **name)
389
395
 
390
396
  def _dn(self, sbet, cbet): # in gxline._GeodesicLineExact.__init__
391
397
  '''(INTERNAL) Helper.
@@ -691,7 +697,7 @@ class GeodesicExact(_GeodesicBase):
691
697
  eFk2=eF.k2, eFa2=eF.alpha2)
692
698
  p.update(r) # r overrides p
693
699
  r = p.toGDict()
694
- return self._iter2tion(r, p)
700
+ return self._iter2tion(r, **p)
695
701
 
696
702
  def _GenDirect(self, lat1, lon1, azi1, arcmode, s12_a12, outmask=Caps.STANDARD):
697
703
  '''(INTERNAL) The general I{Inverse} geodesic calculation.
@@ -702,7 +708,7 @@ class GeodesicExact(_GeodesicBase):
702
708
  r = self._GDictDirect(lat1, lon1, azi1, arcmode, s12_a12, outmask)
703
709
  return r.toDirect9Tuple()
704
710
 
705
- def _GenDirectLine(self, lat1, lon1, azi1, arcmode, s12_a12, caps, name=NN):
711
+ def _GenDirectLine(self, lat1, lon1, azi1, arcmode, s12_a12, caps, **name):
706
712
  '''(INTERNAL) Helper for C{ArcDirectLine} and C{DirectLine}.
707
713
 
708
714
  @return: A L{GeodesicLineExact} instance.
@@ -712,7 +718,7 @@ class GeodesicExact(_GeodesicBase):
712
718
  s, c = _sincos2d(_around(azi1))
713
719
  C = caps if arcmode else (caps | Caps.DISTANCE_IN)
714
720
  return _GeodesicLineExact(self, lat1, lon1, azi1, C,
715
- self._debug, s, c, name=name)._GenSet(arcmode, s12_a12)
721
+ self._debug, s, c, **name)._GenSet(arcmode, s12_a12)
716
722
 
717
723
  def _GenInverse(self, lat1, lon1, lat2, lon2, outmask=Caps.STANDARD):
718
724
  '''(INTERNAL) The general I{Inverse} geodesic calculation.
@@ -784,7 +790,7 @@ class GeodesicExact(_GeodesicBase):
784
790
  ll2 = _unrollon(ll1, _Wrap.point(ll2))
785
791
  return self.InverseLine(ll1.lat, ll1.lon, ll2.lat, ll2.lon, **caps_name)
786
792
 
787
- def InverseLine(self, lat1, lon1, lat2, lon2, caps=Caps.STANDARD, name=NN):
793
+ def InverseLine(self, lat1, lon1, lat2, lon2, caps=Caps.STANDARD, **name):
788
794
  '''Define a L{GeodesicLineExact} in terms of the I{Inverse} geodesic problem.
789
795
 
790
796
  @arg lat1: Latitude of the first point (C{degrees}).
@@ -796,6 +802,7 @@ class GeodesicExact(_GeodesicBase):
796
802
  should possess, i.e., which quantities can be
797
803
  returned by calls to L{GeodesicLineExact.Position}
798
804
  and L{GeodesicLineExact.ArcPosition}.
805
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
799
806
 
800
807
  @return: A L{GeodesicLineExact} instance.
801
808
 
@@ -813,7 +820,7 @@ class GeodesicExact(_GeodesicBase):
813
820
  C = (caps | Cs.DISTANCE) if (caps & (Cs.DISTANCE_IN & Cs._OUT_MASK)) else caps
814
821
  azi1 = _atan2d(r.salp1, r.calp1)
815
822
  return _GeodesicLineExact(self, lat1, lon1, azi1, C, # ensure a12 is distance
816
- self._debug, r.salp1, r.calp1, name=name)._GenSet(True, r.a12)
823
+ self._debug, r.salp1, r.calp1, **name)._GenSet(True, r.a12)
817
824
 
818
825
  def _InverseArea(self, _meridian, salp1, calp1, # PYCHOK 9 args
819
826
  salp2, calp2,
@@ -1100,7 +1107,7 @@ class GeodesicExact(_GeodesicBase):
1100
1107
 
1101
1108
  return s12b, m12b, m0, M12, M21
1102
1109
 
1103
- def Line(self, lat1, lon1, azi1, caps=Caps.ALL, name=NN):
1110
+ def Line(self, lat1, lon1, azi1, caps=Caps.ALL, **name):
1104
1111
  '''Set up a L{GeodesicLineExact} to compute several points
1105
1112
  on a single geodesic.
1106
1113
 
@@ -1112,6 +1119,7 @@ class GeodesicExact(_GeodesicBase):
1112
1119
  should possess, i.e., which quantities can be
1113
1120
  returnedby calls to L{GeodesicLineExact.Position}
1114
1121
  and L{GeodesicLineExact.ArcPosition}.
1122
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
1115
1123
 
1116
1124
  @return: A L{GeodesicLineExact} instance.
1117
1125
 
@@ -1123,7 +1131,7 @@ class GeodesicExact(_GeodesicBase):
1123
1131
  <https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>}
1124
1132
  and Python U{Geodesic.Line<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
1125
1133
  '''
1126
- return _GeodesicLineExact(self, lat1, lon1, azi1, caps, self._debug, name=name)
1134
+ return _GeodesicLineExact(self, lat1, lon1, azi1, caps, self._debug, **name)
1127
1135
 
1128
1136
  @Property_RO
1129
1137
  def n(self):
@@ -1265,7 +1273,7 @@ class GeodesicLineExact(_GeodesicLineExact):
1265
1273
  geographiclib/geographiclib-python>}.
1266
1274
  '''
1267
1275
 
1268
- def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.STANDARD, name=NN):
1276
+ def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.STANDARD, **name):
1269
1277
  '''New L{GeodesicLineExact} instance, allowing points to be found along
1270
1278
  a geodesic starting at C{(B{lat1}, B{lon1})} with azimuth B{C{azi1}}.
1271
1279
 
@@ -1278,15 +1286,15 @@ class GeodesicLineExact(_GeodesicLineExact):
1278
1286
  should possess, i.e., which quantities can be
1279
1287
  returned by calls to L{GeodesicLineExact.Position}
1280
1288
  and L{GeodesicLineExact.ArcPosition}.
1281
- @kwarg name: Optional name (C{str}).
1289
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
1282
1290
 
1283
1291
  @raise TypeError: Invalid B{C{geodesic}}.
1284
1292
  '''
1285
1293
  _xinstanceof(GeodesicExact, geodesic=geodesic)
1286
1294
  if (caps & Caps.LINE_OFF): # copy to avoid updates
1287
- geodesic = geodesic.copy(deep=False, name=NN(_UNDER_, geodesic.name))
1295
+ geodesic = geodesic.copy(deep=False, name=_UNDER_(NN, geodesic.name)) # NOT _under!
1288
1296
  # _update_all(geodesic)
1289
- _GeodesicLineExact.__init__(self, geodesic, lat1, lon1, azi1, caps, 0, name=name)
1297
+ _GeodesicLineExact.__init__(self, geodesic, lat1, lon1, azi1, caps, 0, **name)
1290
1298
 
1291
1299
 
1292
1300
  def _Astroid(x, y):
@@ -19,10 +19,10 @@ from __future__ import division as _; del _ # PYCHOK semicolon
19
19
 
20
20
  from pygeodesy.basics import isodd, unsigned0
21
21
  from pygeodesy.constants import NAN, _0_0, _0_5, _720_0
22
- from pygeodesy.interns import NN, _COMMASPACE_
22
+ # from pygeodesy.interns import _COMMASPACE_ # from .lazily
23
23
  from pygeodesy.karney import Area3Tuple, _diff182, GeodesicError, \
24
24
  _norm180, _remainder, _sum2_
25
- from pygeodesy.lazily import _ALL_DOCS, printf
25
+ from pygeodesy.lazily import _ALL_DOCS, printf, _COMMASPACE_
26
26
  from pygeodesy.named import ADict, callername, _NamedBase, pairs
27
27
  from pygeodesy.props import Property, Property_RO, property_RO
28
28
  # from pygeodesy.streprs import pairs # from .named
@@ -30,7 +30,7 @@ from pygeodesy.props import Property, Property_RO, property_RO
30
30
  from math import fmod as _fmod
31
31
 
32
32
  __all__ = ()
33
- __version__ = '24.05.10'
33
+ __version__ = '24.05.19'
34
34
 
35
35
 
36
36
  class GeodesicAreaExact(_NamedBase):
@@ -55,14 +55,14 @@ class GeodesicAreaExact(_NamedBase):
55
55
  _verbose = False
56
56
  _xings = 0
57
57
 
58
- def __init__(self, geodesic, polyline=False, name=NN):
58
+ def __init__(self, geodesic, polyline=False, **name):
59
59
  '''New L{GeodesicAreaExact} instance.
60
60
 
61
61
  @arg geodesic: A geodesic (L{GeodesicExact}, I{wrapped}
62
62
  C{Geodesic} or L{GeodesicSolve}).
63
63
  @kwarg polyline: If C{True}, compute the perimeter only,
64
64
  otherwise area and perimeter (C{bool}).
65
- @kwarg name: Optional name (C{str}).
65
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
66
66
 
67
67
  @raise GeodesicError: Invalid B{C{geodesic}}.
68
68
  '''
@@ -408,18 +408,18 @@ class GeodesicAreaExact(_NamedBase):
408
408
  class PolygonArea(GeodesicAreaExact):
409
409
  '''For C{geographiclib} compatibility, sub-class of L{GeodesicAreaExact}.
410
410
  '''
411
- def __init__(self, earth, polyline=False, name=NN):
411
+ def __init__(self, earth, polyline=False, **name):
412
412
  '''New L{PolygonArea} instance.
413
413
 
414
414
  @arg earth: A geodesic (L{GeodesicExact}, I{wrapped}
415
415
  C{Geodesic} or L{GeodesicSolve}).
416
416
  @kwarg polyline: If C{True} perimeter only, otherwise
417
417
  area and perimeter (C{bool}).
418
- @kwarg name: Optional name (C{str}).
418
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
419
419
 
420
420
  @raise GeodesicError: Invalid B{C{earth}}.
421
421
  '''
422
- GeodesicAreaExact.__init__(self, earth, polyline=polyline, name=name)
422
+ GeodesicAreaExact.__init__(self, earth, polyline=polyline, **name)
423
423
 
424
424
 
425
425
  class _Accumulator(_NamedBase):
@@ -432,8 +432,11 @@ class _Accumulator(_NamedBase):
432
432
  _n = 0 # len()
433
433
  _s = _t = _0_0
434
434
 
435
- def __init__(self, y=0, name=NN):
435
+ def __init__(self, y=0, **name):
436
436
  '''New L{_Accumulator}.
437
+
438
+ @kwarg y: Initial value (C{scalar}).
439
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
437
440
  '''
438
441
  if isinstance(y, _Accumulator):
439
442
  self._s, self._t, self._n = y._s, y._t, 1
@@ -10,16 +10,15 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
10
10
 
11
11
  from pygeodesy.basics import isodd, _MODS
12
12
  from pygeodesy.constants import _0_0, _100_0
13
- from pygeodesy.errors import _or, _xkwds_item2, _not_
13
+ from pygeodesy.errors import _or, _xkwds_item2
14
14
  from pygeodesy.fmath import hypot as _hypot
15
- # from pygeodesy.interns import _not_ # from .errors
16
15
  from pygeodesy.karney import _CapsBase, GeodesicError, _2cos2x, _sum2_
17
16
  # from pygeodesy.lazily import _MODS, printf # .basics, _MODS
18
17
 
19
18
  from math import ldexp as _ldexp
20
19
 
21
20
  __all__ = ()
22
- __version__ = '24.03.15'
21
+ __version__ = '24.05.19'
23
22
 
24
23
  # valid C{nC4}s and C{C4order}s, see _xnC4 below
25
24
  _nC4s = {24: 2900, 27: 4032, 30: 5425}
@@ -127,7 +126,7 @@ def _xnC4(**name_nC4):
127
126
  '''
128
127
  n, nC4 = _xkwds_item2(name_nC4)
129
128
  if nC4 not in _nC4s or not isinstance(nC4, int):
130
- raise GeodesicError(n, nC4, txt=_not_(_or(*map(str, _nC4s))))
129
+ raise GeodesicError(n, nC4, txt_not_=_or(*map(str, _nC4s)))
131
130
  return _nC4s[nC4]
132
131
 
133
132
 
@@ -39,12 +39,12 @@ from __future__ import division as _; del _ # PYCHOK semicolon
39
39
  # from pygeodesy.basics import _xinstanceof # _MODS
40
40
  from pygeodesy.constants import NAN, _EPSmin, _EPSqrt as _TOL, _0_0, \
41
41
  _1_0, _180_0, _2__PI, _copysign_1_0
42
- from pygeodesy.errors import _xError, _xkwds_get
42
+ from pygeodesy.errors import _xError, _COMMASPACE_
43
43
  from pygeodesy.fsums import fsumf_, fsum1f_
44
44
  from pygeodesy.geodesicx.gxbases import _cosSeries, _GeodesicBase, \
45
45
  _sincos12, _sin1cos2
46
46
  # from pygeodesy.geodesicw import _Intersecant2 # _MODS
47
- from pygeodesy.interns import NN, _COMMASPACE_
47
+ # from pygeodesy.interns import _COMMASPACE_ # from .errors
48
48
  from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS
49
49
  from pygeodesy.karney import _around, _atan2d, Caps, GDict, _fix90, \
50
50
  _K_2_0, _norm2, _norm180, _sincos2, _sincos2d
@@ -55,7 +55,7 @@ from pygeodesy.utily import atan2d as _atan2d_reverse, sincos2
55
55
  from math import atan2, cos, degrees, fabs, floor, radians, sin
56
56
 
57
57
  __all__ = ()
58
- __version__ = '24.02.21'
58
+ __version__ = '24.05.19'
59
59
 
60
60
  _glXs = [] # instances of C{[_]GeodesicLineExact} to be updated
61
61
  # underflow guard, we require _TINY * EPS > 0, _TINY + EPS == EPS
@@ -95,7 +95,7 @@ class _GeodesicLineExact(_GeodesicBase):
95
95
  # _somg1 = _comg1 = NAN
96
96
  # _ssig1 = _csig1 = NAN
97
97
 
98
- def __init__(self, gX, lat1, lon1, azi1, caps, _debug, *salp1_calp1, **name): # name=NN
98
+ def __init__(self, gX, lat1, lon1, azi1, caps, _debug, *salp1_calp1, **name):
99
99
  '''(INTERNAL) New C{[_]GeodesicLineExact} instance.
100
100
  '''
101
101
  _xGeodesicExact(gX=gX)
@@ -110,10 +110,8 @@ class _GeodesicLineExact(_GeodesicBase):
110
110
  # guard against salp0 underflow,
111
111
  # also -0 is converted to +0
112
112
  salp1, calp1 = _sincos2d(_around(azi1))
113
- if name: # *args, name=NN): Python3
114
- name = _xkwds_get(name, name=NN)
115
- if name:
116
- self.name = name
113
+ if name:
114
+ self.name = name
117
115
 
118
116
  self._gX = gX # GeodesicExact only
119
117
  self._lat1 = lat1 = _fix90(lat1)
pygeodesy/geodsolve.py CHANGED
@@ -10,24 +10,23 @@ of the C{GeodSolve} executable.
10
10
  '''
11
11
 
12
12
  from pygeodesy.basics import _xinstanceof
13
- # from pygeodesy.errors import _xkwds # from .karney
14
13
  # from pygeodesy.geodesicx import GeodesicAreaExact # _MODS
15
- # from pygeodesy.internals import printf # from .lazily
16
14
  from pygeodesy.interns import NN, _a12_, _azi1_, _azi2_, \
17
15
  _lat1_, _lat2_, _lon1_, _lon2_, _m12_, \
18
16
  _M12_, _M21_, _s12_, _S12_, _UNDER_
19
17
  from pygeodesy.interns import _UNUSED_, _not_ # PYCHOK used!
20
18
  from pygeodesy.karney import _Azi, Caps, _Deg, GeodesicError, _GTuple, \
21
- _Pass, _Lat, _Lon, _M, _M2, _sincos2d, _xkwds
19
+ _Pass, _Lat, _Lon, _M, _M2, _sincos2d
22
20
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, \
23
- _getenv, _PYGEODESY_GEODSOLVE_, printf
21
+ _getenv, _PYGEODESY_GEODSOLVE_
22
+ from pygeodesy.named import _name1__
24
23
  from pygeodesy.namedTuples import Destination3Tuple, Distance3Tuple
25
24
  from pygeodesy.props import Property, Property_RO
26
25
  from pygeodesy.solveBase import _SolveBase, _SolveLineBase
27
26
  from pygeodesy.utily import _unrollon, _Wrap, wrap360
28
27
 
29
28
  __all__ = _ALL_LAZY.geodsolve
30
- __version__ = '24.05.13'
29
+ __version__ = '24.05.23'
31
30
 
32
31
 
33
32
  class GeodSolve12Tuple(_GTuple):
@@ -117,21 +116,20 @@ class GeodesicSolve(_GeodesicSolveBase):
117
116
  executable for I{every} method call.
118
117
  '''
119
118
 
120
- def Area(self, polyline=False, name=NN):
119
+ def Area(self, polyline=False, **name):
121
120
  '''Set up a L{GeodesicAreaExact} to compute area and
122
121
  perimeter of a polygon.
123
122
 
124
123
  @kwarg polyline: If C{True} perimeter only, otherwise
125
124
  area and perimeter (C{bool}).
126
- @kwarg name: Optional name (C{str}).
125
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
127
126
 
128
127
  @return: A L{GeodesicAreaExact} instance.
129
128
 
130
129
  @note: The B{C{debug}} setting is passed as C{verbose}
131
130
  to the returned L{GeodesicAreaExact} instance.
132
131
  '''
133
- gaX = _MODS.geodesicx.GeodesicAreaExact(self, polyline=polyline,
134
- name=name or self.name)
132
+ gaX = _MODS.geodesicx.GeodesicAreaExact(self, polyline=polyline, **name)
135
133
  if self.verbose or self.debug: # PYCHOK no cover
136
134
  gaX.verbose = True
137
135
  return gaX
@@ -160,9 +158,10 @@ class GeodesicSolve(_GeodesicSolveBase):
160
158
  @arg lat1: Latitude of the first point (C{degrees}).
161
159
  @arg lon1: Longitude of the first point (C{degrees}).
162
160
  @arg azi1: Azimuth at the first point (compass C{degrees}).
163
- @kwarg caps_name: Bit-or'ed combination of L{Caps} values specifying
164
- the capabilities the L{GeodesicLineSolve} instance should
165
- possess, C{caps=Caps.ALL} always.
161
+ @kwarg caps_name: Optional C{B{name}=NN} (C{str}) and keyword
162
+ argument C{B{caps}=Caps.ALL}, bit-or'ed combination
163
+ of L{Caps} values specifying the capabilities the
164
+ L{GeodesicLineSolve} instance should possess.
166
165
 
167
166
  @return: A L{GeodesicLineSolve} instance.
168
167
 
@@ -174,7 +173,7 @@ class GeodesicSolve(_GeodesicSolveBase):
174
173
  <https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1GeodesicExact.html>}
175
174
  and Python U{Geodesic.Line<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
176
175
  '''
177
- return GeodesicLineSolve(self, lat1, lon1, azi1, **_xkwds(caps_name, name=self.name))
176
+ return GeodesicLineSolve(self, lat1, lon1, azi1, **_name1__(caps_name, _or_nameof=self))
178
177
 
179
178
  Line = DirectLine
180
179
 
@@ -210,9 +209,10 @@ class GeodesicSolve(_GeodesicSolveBase):
210
209
  @arg lon1: Longitude of the first point (C{degrees}).
211
210
  @arg lat2: Latitude of the second point (C{degrees}).
212
211
  @arg lon2: Longitude of the second point (C{degrees}).
213
- @kwarg caps_name: Bit-or'ed combination of L{Caps} values specifying
214
- the capabilities the L{GeodesicLineSolve} instance should
215
- possess, C{caps=Caps.ALL} always.
212
+ @kwarg caps_name: Optional C{B{name}=NN} (C{str}) and keyword
213
+ argument C{B{caps}=Caps.ALL}, bit-or'ed combination
214
+ of L{Caps} values specifying the capabilities the
215
+ L{GeodesicLineSolve} instance should possess.
216
216
 
217
217
  @return: A L{GeodesicLineSolve} instance.
218
218
 
@@ -223,7 +223,7 @@ class GeodesicSolve(_GeodesicSolveBase):
223
223
  Python U{Geodesic.InverseLine<https://GeographicLib.SourceForge.io/Python/doc/code.html>}.
224
224
  '''
225
225
  r = self.Inverse(lat1, lon1, lat2, lon2)
226
- return GeodesicLineSolve(self, lat1, lon1, r.azi1, **_xkwds(caps_name, name=self.name))
226
+ return GeodesicLineSolve(self, lat1, lon1, r.azi1, **_name1__(caps_name, _or_nameof=self))
227
227
 
228
228
 
229
229
  class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
@@ -238,7 +238,7 @@ class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
238
238
  executable for I{every} method call.
239
239
  '''
240
240
 
241
- def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.ALL, name=NN):
241
+ def __init__(self, geodesic, lat1, lon1, azi1, caps=Caps.ALL, **name):
242
242
  '''New L{GeodesicLineSolve} instance, allowing points to be found along
243
243
  a geodesic starting at C{(B{lat1}, B{lon1})} with azimuth B{C{azi1}}.
244
244
 
@@ -246,14 +246,14 @@ class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
246
246
  @arg lat1: Latitude of the first point (C{degrees}).
247
247
  @arg lon1: Longitude of the first point (C{degrees}).
248
248
  @arg azi1: Azimuth at the first points (compass C{degrees}).
249
- @kwarg caps: Bit-or'ed combination of L{Caps} values specifying
250
- the capabilities the L{GeodesicLineSolve} instance
251
- should possess, always C{Caps.ALL}. Use C{Caps.LINE_OFF}
252
- if updates to the B{C{geodesic}} should I{not} be
253
- reflected in this L{GeodesicLineSolve} instance.
254
- @kwarg name: Optional name (C{str}).
255
-
256
- @raise GeodesicError: Invalid path for the C{GeodSolve} executable or
249
+ @kwarg caps: Bit-or'ed combination of L{Caps} values specifying the
250
+ capabilities the L{GeodesicLineSolve} instance should possess,
251
+ C{B{caps}=Caps.ALL} always. Include C{Caps.LINE_OFF} if
252
+ updates to the B{C{geodesic}} should I{not} be reflected in
253
+ this L{GeodesicLineSolve} instance.
254
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
255
+
256
+ @raise GeodesicError: Invalid path for the C{GeodSolve} executable
257
257
  or isn't the C{GeodSolve} executable, see
258
258
  property C{geodesic.GeodSolve}.
259
259
 
@@ -261,7 +261,7 @@ class GeodesicLineSolve(_GeodesicSolveBase, _SolveLineBase):
261
261
  '''
262
262
  _xinstanceof(GeodesicSolve, geodesic=geodesic)
263
263
  if (caps & Caps.LINE_OFF): # copy to avoid updates
264
- geodesic = geodesic.copy(deep=False, name=NN(_UNDER_, geodesic.name))
264
+ geodesic = geodesic.copy(deep=False, name=_UNDER_(NN, geodesic.name)) # NOT _under!
265
265
  _SolveLineBase.__init__(self, geodesic, lat1, lon1, caps, name, azi1=azi1)
266
266
  try:
267
267
  self.GeodSolve = geodesic.GeodSolve # geodesic or copy of geodesic
@@ -338,6 +338,7 @@ __all__ += _ALL_DOCS(_GeodesicSolveBase)
338
338
 
339
339
  if __name__ == '__main__':
340
340
 
341
+ from pygeodesy import printf
341
342
  from sys import argv
342
343
 
343
344
  gS = GeodesicSolve(name='Test')