pygeodesy 24.5.8__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 (83) hide show
  1. {PyGeodesy-24.5.8.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 +16 -12
  4. pygeodesy/__main__.py +9 -10
  5. pygeodesy/albers.py +42 -42
  6. pygeodesy/auxilats/__init__.py +1 -1
  7. pygeodesy/auxilats/__main__.py +7 -10
  8. pygeodesy/auxilats/auxAngle.py +32 -31
  9. pygeodesy/auxilats/auxLat.py +81 -51
  10. pygeodesy/azimuthal.py +123 -124
  11. pygeodesy/basics.py +165 -176
  12. pygeodesy/booleans.py +14 -15
  13. pygeodesy/cartesianBase.py +25 -23
  14. pygeodesy/clipy.py +3 -3
  15. pygeodesy/constants.py +8 -6
  16. pygeodesy/css.py +50 -42
  17. pygeodesy/datums.py +50 -48
  18. pygeodesy/dms.py +6 -6
  19. pygeodesy/ecef.py +27 -27
  20. pygeodesy/elevations.py +2 -2
  21. pygeodesy/ellipsoidalBase.py +28 -27
  22. pygeodesy/ellipsoidalBaseDI.py +8 -7
  23. pygeodesy/ellipsoidalNvector.py +11 -12
  24. pygeodesy/ellipsoids.py +41 -35
  25. pygeodesy/elliptic.py +12 -10
  26. pygeodesy/epsg.py +4 -3
  27. pygeodesy/errors.py +35 -13
  28. pygeodesy/etm.py +62 -53
  29. pygeodesy/fmath.py +48 -41
  30. pygeodesy/formy.py +93 -65
  31. pygeodesy/frechet.py +117 -102
  32. pygeodesy/fstats.py +52 -46
  33. pygeodesy/fsums.py +169 -145
  34. pygeodesy/gars.py +10 -9
  35. pygeodesy/geodesicw.py +32 -30
  36. pygeodesy/geodesicx/__init__.py +1 -1
  37. pygeodesy/geodesicx/__main__.py +4 -4
  38. pygeodesy/geodesicx/gx.py +40 -32
  39. pygeodesy/geodesicx/gxarea.py +15 -12
  40. pygeodesy/geodesicx/gxbases.py +3 -4
  41. pygeodesy/geodesicx/gxline.py +6 -8
  42. pygeodesy/geodsolve.py +28 -26
  43. pygeodesy/geohash.py +47 -44
  44. pygeodesy/geoids.py +37 -35
  45. pygeodesy/hausdorff.py +112 -99
  46. pygeodesy/heights.py +136 -129
  47. pygeodesy/internals.py +576 -0
  48. pygeodesy/interns.py +6 -207
  49. pygeodesy/iters.py +22 -19
  50. pygeodesy/karney.py +18 -15
  51. pygeodesy/ktm.py +31 -24
  52. pygeodesy/latlonBase.py +12 -11
  53. pygeodesy/lazily.py +140 -218
  54. pygeodesy/lcc.py +24 -25
  55. pygeodesy/ltp.py +83 -71
  56. pygeodesy/ltpTuples.py +7 -5
  57. pygeodesy/mgrs.py +5 -4
  58. pygeodesy/named.py +136 -49
  59. pygeodesy/namedTuples.py +33 -25
  60. pygeodesy/nvectorBase.py +10 -9
  61. pygeodesy/osgr.py +14 -12
  62. pygeodesy/points.py +13 -13
  63. pygeodesy/props.py +7 -7
  64. pygeodesy/rhumb/__init__.py +1 -1
  65. pygeodesy/rhumb/bases.py +3 -2
  66. pygeodesy/rhumb/solve.py +2 -2
  67. pygeodesy/solveBase.py +8 -7
  68. pygeodesy/sphericalTrigonometry.py +5 -5
  69. pygeodesy/streprs.py +8 -7
  70. pygeodesy/trf.py +8 -8
  71. pygeodesy/triaxials.py +67 -63
  72. pygeodesy/units.py +48 -50
  73. pygeodesy/unitsBase.py +24 -11
  74. pygeodesy/ups.py +7 -6
  75. pygeodesy/utily.py +4 -4
  76. pygeodesy/utm.py +53 -52
  77. pygeodesy/utmupsBase.py +11 -8
  78. pygeodesy/vector2d.py +6 -7
  79. pygeodesy/vector3d.py +16 -17
  80. pygeodesy/vector3dBase.py +5 -5
  81. PyGeodesy-24.5.8.dist-info/RECORD +0 -115
  82. {PyGeodesy-24.5.8.dist-info → PyGeodesy-24.5.24.dist-info}/WHEEL +0 -0
  83. {PyGeodesy-24.5.8.dist-info → PyGeodesy-24.5.24.dist-info}/top_level.txt +0 -0
pygeodesy/gars.py CHANGED
@@ -13,14 +13,14 @@ by I{Charles Karney}. See also U{Global Area Reference System
13
13
  <https://Earth-Info.NGA.mil/GandG/coordsys/grids/gars.html>}.
14
14
  '''
15
15
 
16
- # from pygeodesy.basics import isstr # from .dms
16
+ # from pygeodesy.basics import isstr # from .named
17
17
  from pygeodesy.constants import _off90, _1_over, _0_5, \
18
18
  _1_0 # PYCHOK used!
19
- from pygeodesy.dms import parse3llh, Fmt, isstr # parseDMS2
19
+ from pygeodesy.dms import parse3llh, Fmt # parseDMS2
20
20
  from pygeodesy.errors import _ValueError, _xkwds
21
21
  from pygeodesy.interns import NN, _0to9_, _AtoZnoIO_, _COMMA_
22
22
  from pygeodesy.lazily import _ALL_LAZY, _ALL_OTHER
23
- from pygeodesy.named import nameof, Property_RO
23
+ from pygeodesy.named import _name__, isstr, Property_RO
24
24
  from pygeodesy.namedTuples import LatLon2Tuple, LatLonPrec3Tuple
25
25
  # from pygeodesy.props import Property_RO # from .named
26
26
  # from pygeodesy.streprs import Fmt # from .dms
@@ -30,7 +30,7 @@ from pygeodesy.units import Int_, Lat, Lon, Precision_, Scalar_, \
30
30
  from math import floor
31
31
 
32
32
  __all__ = _ALL_LAZY.gars
33
- __version__ = '23.10.07'
33
+ __version__ = '24.05.24'
34
34
 
35
35
  _Digits = _0to9_
36
36
  _LatLen = 2
@@ -112,7 +112,7 @@ class Garef(Str):
112
112
  '''Garef class, a named C{str}.
113
113
  '''
114
114
  # no str.__init__ in Python 3
115
- def __new__(cls, cll, precision=1, name=NN):
115
+ def __new__(cls, cll, precision=1, **name):
116
116
  '''New L{Garef} from an other L{Garef} instance or garef
117
117
  C{str} or from a C{LatLon} instance or lat-/longitude C{str}.
118
118
 
@@ -121,7 +121,7 @@ class Garef(Str):
121
121
  @kwarg precision: Optional, the desired garef resolution
122
122
  and length (C{int} 0..2), see function
123
123
  L{gars.encode} for more details.
124
- @kwarg name: Optional name (C{str}).
124
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
125
125
 
126
126
  @return: New L{Garef}.
127
127
 
@@ -150,7 +150,7 @@ class Garef(Str):
150
150
  except AttributeError:
151
151
  raise _xStrError(Garef, cll=cll) # Error=GARSError
152
152
 
153
- self = Str.__new__(cls, g, name=name or nameof(cll))
153
+ self = Str.__new__(cls, g, name=_name__(name, _or_nameof=cll))
154
154
  self._latlon = ll
155
155
  self._precision = p
156
156
  return self
@@ -197,7 +197,7 @@ class Garef(Str):
197
197
  *self.latlon, **_xkwds(LatLon_kwds, name=self.name))
198
198
 
199
199
 
200
- def decode3(garef, center=True):
200
+ def decode3(garef, center=True, **name):
201
201
  '''Decode a C{garef} to lat-, longitude and precision.
202
202
 
203
203
  @arg garef: To be decoded (L{Garef} or C{str}).
@@ -245,10 +245,11 @@ def decode3(garef, center=True):
245
245
  lon += _0_5
246
246
  lat += _0_5
247
247
 
248
+ n = _name__(name, _or_nameof=garef)
248
249
  r = _Resolutions[precision] # == 1.0 / unit
249
250
  return LatLonPrec3Tuple(Lat(lat * r, Error=GARSError),
250
251
  Lon(lon * r, Error=GARSError),
251
- precision, name=nameof(garef))
252
+ precision, name=n)
252
253
 
253
254
 
254
255
  def encode(lat, lon, precision=1): # MCCABE 14
pygeodesy/geodesicw.py CHANGED
@@ -18,15 +18,15 @@ from pygeodesy.constants import EPS, NAN, _EPSqrt as _TOL, _0_5
18
18
  from pygeodesy.datums import _earth_datum, _WGS84, _EWGS84
19
19
  # from pygeodesy.dms import F_D # from .latlonBase
20
20
  # from pygeodesy.ellipsoids import _EWGS84 # from .datums
21
- from pygeodesy.errors import IntersectionError, GeodesicError, _xkwds_pop2
21
+ from pygeodesy.errors import IntersectionError, GeodesicError
22
22
  from pygeodesy.fsums import Fsum, Fmt, unstr
23
- from pygeodesy.interns import NN, _DOT_, _dunder_nameof, _SPACE_, \
24
- _to_, _too_,_under
23
+ from pygeodesy.internals import _dunder_nameof, _under
24
+ from pygeodesy.interns import NN, _DOT_, _SPACE_, _to_, _too_
25
25
  from pygeodesy.karney import _atan2d, Caps, Direct9Tuple, GDict, \
26
26
  _kWrapped, Inverse10Tuple
27
27
  from pygeodesy.latlonBase import LatLonBase as _LLB, F_D, Radius_
28
28
  from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS
29
- from pygeodesy.named import callername, classname
29
+ from pygeodesy.named import callername, classname, _name1__, _name2__
30
30
  from pygeodesy.namedTuples import Destination3Tuple, Distance3Tuple
31
31
  from pygeodesy.props import Property, Property_RO, property_RO
32
32
  # from pygeodesy.streprs import Fmt, unstr # from .fsums
@@ -37,7 +37,7 @@ from contextlib import contextmanager
37
37
  # from math import fabs # from .utily
38
38
 
39
39
  __all__ = _ALL_LAZY.geodesicw
40
- __version__ = '24.04.07'
40
+ __version__ = '24.05.24'
41
41
 
42
42
  _plumb_ = 'plumb'
43
43
  _TRIPS = 65
@@ -66,20 +66,21 @@ class _gWrapped(_kWrapped):
66
66
  LINE_OFF = 0 # in .azimuthal._GnomonicBase and .css.CassiniSoldner
67
67
  _name = NN
68
68
 
69
- def __init__(self, a_ellipsoid=_EWGS84, f=None, name=NN): # PYCHOK signature
69
+ def __init__(self, a_ellipsoid=_EWGS84, f=None, **name): # PYCHOK signature
70
70
  '''New I{wrapped} C{geodesic.Geodesic} instance.
71
71
 
72
72
  @arg a_ellipsoid: The equatorial radius I{a} (C{meter}, conventionally),
73
73
  an ellipsoid (L{Ellipsoid}) or a datum (L{Datum}).
74
74
  @arg f: The ellipsoid's flattening (C{scalar}), ignored if B{C{a_ellipsoid})
75
75
  is not C{meter}.
76
- @kwarg name: Optional name (C{str}).
76
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
77
77
  '''
78
- _earth_datum(self, a_ellipsoid, f=f, name=name) # raiser=NN
79
- with _wargs(self, *self.ellipsoid.a_f, name=name) as args:
78
+ _earth_datum(self, a_ellipsoid, f=f, **name) # raiser=NN
79
+ E = self.ellipsoid
80
+ with _wargs(self, *E.a_f, **name) as args:
80
81
  _Geodesic.__init__(self, *args)
81
82
  if name:
82
- self._name = str(name)
83
+ self._name, _ = _name2__(name, _or_nameof=E)
83
84
 
84
85
  def ArcDirect(self, lat1, lon1, azi1, a12, outmask=Caps._STD):
85
86
  '''Return the C{_Geodesic.ArcDirect} result as L{GDict}.
@@ -266,7 +267,7 @@ class _gWrapped(_kWrapped):
266
267
  _geodesic = None
267
268
  _name = NN
268
269
 
269
- def __init__(self, geodesic, lat1, lon1, azi1, **caps_name_): # salp1=NAN, calp1=NAN, name=NN
270
+ def __init__(self, geodesic, lat1, lon1, azi1, **caps_name_): # salp1=NAN, calp1=NAN
270
271
  '''New I{wrapped} C{geodesicline.GeodesicLine} instance.
271
272
 
272
273
  @arg geodesic: A I{wrapped} C{Geodesic} instance.
@@ -281,10 +282,10 @@ class _gWrapped(_kWrapped):
281
282
  '''
282
283
  _xinstanceof(_wrapped.Geodesic, geodesic=geodesic)
283
284
  with _wargs(self, geodesic, lat1, lon1, azi1, **caps_name_) as args:
284
- name, caps_ = _xkwds_pop2(caps_name_, name=geodesic.name)
285
- _GeodesicLine.__init__(self, *args, **caps_)
285
+ name, caps_ = _name2__(caps_name_, _or_nameof=geodesic)
286
+ _GeodesicLine.__init__(self, *args, **caps_) # XXX avoid updates?
286
287
  if name:
287
- self._name = str(name)
288
+ self._name = name
288
289
  self._geodesic = geodesic
289
290
 
290
291
  @Property_RO
@@ -353,17 +354,17 @@ class _gWrapped(_kWrapped):
353
354
  @arg radius: Radius of the circle (C{meter}, conventionally).
354
355
  @kwarg tol: Convergence tolerance (C{scalar}).
355
356
 
356
- @return: 2-Tuple C{(P, Q)} with both intersections (representing a
357
- geodesic chord), each a L{GDict} from method L{Position}
358
- extended to 14 items by C{lon0, lat0, azi0, a02, s02, at}
359
- with the circle center C{lat0}, C{lon0}, azimuth C{azi0} at,
360
- distance C{a02} in C{degrees} and C{s02} in C{meter} along
361
- the geodesic from the circle center to the intersection
362
- C{lat2}, C{lon2} and the angle C{at} between the geodesic
363
- and this line at the intersection. The I{geodesic} azimuth
364
- at the intersection is C{(at + azi2)}. If this line is
365
- tangential to the circle, both intersections are the same
366
- L{GDict} instance.
357
+ @return: 2-Tuple C{(P, Q)} with both intersections points (representing
358
+ a geodesic chord), each a L{GDict} from method L{Position} and
359
+ extended to 14 items C{lat1, lon1, azi1, lat2, lon2, azi2, a12,
360
+ s12, lat0, lon0, azi0, a02, s02, at} with the circle center
361
+ C{lat0}, C{lon0}, azimuth C{azi0} at the intersection, distance
362
+ C{a02} in C{degrees} and C{s02} in C{meter} along the geodesic
363
+ from the circle center to the intersection C{lat2, lon2} and
364
+ the angle C{at} between the geodesic and this line at the
365
+ intersection. The I{geodesic} azimuth at the intersection is
366
+ C{(at + azi2)}. If this line is tangential to the circle, both
367
+ intersections are the same L{GDict} instance.
367
368
 
368
369
  @raise IntersectionError: The circle and this geodesic line do not
369
370
  intersect.
@@ -428,7 +429,7 @@ class _gWrapped(_kWrapped):
428
429
  _wrapped = _gWrapped() # PYCHOK singleton, .ellipsoids, .test/base.py
429
430
 
430
431
 
431
- def Geodesic(a_ellipsoid, f=None, name=NN):
432
+ def Geodesic(a_ellipsoid, f=None, **name):
432
433
  '''Return a I{wrapped} C{geodesic.Geodesic} instance from I{Karney}'s
433
434
  Python U{geographiclib<https://PyPI.org/project/geographiclib>},
434
435
  provide the latter is installed, otherwise an C{ImportError}.
@@ -437,9 +438,10 @@ def Geodesic(a_ellipsoid, f=None, name=NN):
437
438
  or the equatorial radius I{a} of the ellipsoid (C{meter}).
438
439
  @arg f: The flattening of the ellipsoid (C{scalar}), ignored if
439
440
  B{C{a_ellipsoid}}) is not specified as C{meter}.
440
- @kwarg name: Optional ellipsoid name (C{str}), ignored like B{C{f}}.
441
+ @kwarg name: Optional ellipsoid C{B{name}=NN} (C{str}), ignored
442
+ like B{C{f}}.
441
443
  '''
442
- return _wrapped.Geodesic(a_ellipsoid, f=f, name=name)
444
+ return _wrapped.Geodesic(a_ellipsoid, f=f, **name)
443
445
 
444
446
 
445
447
  def GeodesicLine(geodesic, lat1, lon1, azi1, caps=Caps._STD_LINE):
@@ -479,8 +481,8 @@ class _wargs(object): # see also .formy._idllmn6, .latlonBase._toCartesian3, .v
479
481
  try:
480
482
  yield args
481
483
  except Exception as x:
482
- n = _DOT_(classname(inst), callername(up=2, underOK=True))
483
- raise GeodesicError(unstr(n, *args, **kwds), cause=x)
484
+ u = _DOT_(classname(inst), callername(up=2, underOK=True))
485
+ raise GeodesicError(unstr(u, *args, **_name1__(kwds)), cause=x)
484
486
 
485
487
  _wargs = _wargs() # PYCHOK singleton
486
488
 
@@ -23,7 +23,7 @@ from pygeodesy.karney import Caps, GeodesicError
23
23
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY
24
24
 
25
25
  __all__ = _ALL_LAZY.geodesicx + _ALL_DOCS(Caps, GeodesicError)
26
- __version__ = '23.12.03'
26
+ __version__ = '24.05.24'
27
27
 
28
28
  # **) MIT License
29
29
  #
@@ -5,7 +5,7 @@ u'''Print L{geodesicx} version, etc. using C{python -m pygeodesy.geodesicx}.
5
5
  '''
6
6
 
7
7
  __all__ = ()
8
- __version__ = '23.06.19'
8
+ __version__ = '24.05.13'
9
9
 
10
10
 
11
11
  def _C4stats(nC4=None): # PYCHOK no cover
@@ -28,8 +28,8 @@ def _main(): # PYCHOK no cover
28
28
  try:
29
29
  from pygeodesy import geodesicx as _gx, GeodesicError, \
30
30
  GeodesicSolve, printf, pygeodesy_abspath
31
- from pygeodesy.interns import _COMMASPACE_, _DOT_, _pythonarchine, \
32
- _SPACE_, _usage, _version_
31
+ from pygeodesy.internals import _Pythonarchine, _usage
32
+ from pygeodesy.interns import _COMMASPACE_, _DOT_, _SPACE_, _version_
33
33
  from pygeodesy.streprs import Fmt
34
34
 
35
35
  def _dot_attr(name, value):
@@ -41,7 +41,7 @@ def _main(): # PYCHOK no cover
41
41
  def _name_version(pkg):
42
42
  return _SPACE_(pkg.__name__, pkg.__version__)
43
43
 
44
- v = _pythonarchine()
44
+ v = _Pythonarchine()
45
45
  try:
46
46
  import geographiclib
47
47
  v.append(_name_version(geographiclib))
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,18 +19,18 @@ 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
29
29
 
30
- from math import fmod
30
+ from math import fmod as _fmod
31
31
 
32
32
  __all__ = ()
33
- __version__ = '24.03.24'
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
  '''
@@ -198,8 +198,8 @@ class GeodesicAreaExact(_NamedBase):
198
198
  # Since we only need the parity of the result we
199
199
  # can use std::remquo but this is buggy with g++
200
200
  # 4.8.3 and requires C++11. So instead we do:
201
- lon1 = fmod( lon1, _720_0) # r.lon1
202
- lon2 = fmod(r.lon2, _720_0)
201
+ lon1 = _fmod( lon1, _720_0) # r.lon1
202
+ lon2 = _fmod(r.lon2, _720_0)
203
203
  # int(True) == 1, int(False) == 0
204
204
  r.set_(xing=int(lon2 > 360 or -360 < lon2 <= 0) -
205
205
  int(lon1 > 360 or -360 < lon1 <= 0))
@@ -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)