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
@@ -24,8 +24,9 @@ from pygeodesy.errors import _incompatible, _IsnotError, RangeError, _TypeError,
24
24
  # from pygeodesy.fmath import favg # _MODS
25
25
  from pygeodesy.interns import NN, _COMMA_, _ellipsoidal_
26
26
  from pygeodesy.latlonBase import LatLonBase, _trilaterate5, fabs, _Wrap
27
- from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
27
+ # from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS # from .named
28
28
  # from pygeodesy.lcc import toLcc # _MODS
29
+ from pygeodesy.named import _name1__, _ALL_DOCS, _ALL_LAZY, _MODS
29
30
  # from pygeodesy.namedTuples import Vector3Tuple # _MODS
30
31
  from pygeodesy.props import deprecated_method, deprecated_property_RO, \
31
32
  Property_RO, property_doc_, property_RO, _update_all
@@ -36,7 +37,7 @@ from pygeodesy.units import Epoch, _isDegrees, Radius_, _1mm as _TOL_M
36
37
  # from math import fabs # from .latlonBase
37
38
 
38
39
  __all__ = _ALL_LAZY.ellipsoidalBase
39
- __version__ = '24.04.07'
40
+ __version__ = '24.05.21'
40
41
 
41
42
 
42
43
  class CartesianEllipsoidalBase(CartesianBase):
@@ -46,8 +47,8 @@ class CartesianEllipsoidalBase(CartesianBase):
46
47
  _epoch = None # overriding .reframe.epoch (C{float})
47
48
  _reframe = None # reference frame (L{RefFrame})
48
49
 
49
- def __init__(self, x_xyz, y=None, z=None, datum=None, reframe=None,
50
- epoch=None, ll=None, name=NN):
50
+ def __init__(self, x_xyz, y=None, z=None, reframe=None, epoch=None,
51
+ **datum_ll_name):
51
52
  '''New ellispoidal C{Cartesian...}.
52
53
 
53
54
  @kwarg reframe: Optional reference frame (L{RefFrame}).
@@ -61,9 +62,9 @@ class CartesianEllipsoidalBase(CartesianBase):
61
62
  not a L{Datum}, B{C{reframe}} is not a L{RefFrame} or
62
63
  B{C{epoch}} is not C{scalar} non-zero.
63
64
 
64
- @see: Super-class L{CartesianBase<CartesianBase.__init__>} for more details.
65
+ @see: Class L{CartesianBase<CartesianBase.__init__>} for more details.
65
66
  '''
66
- CartesianBase.__init__(self, x_xyz, y=y, z=z, datum=datum, ll=ll, name=name)
67
+ CartesianBase.__init__(self, x_xyz, y=y, z=z, **datum_ll_name)
67
68
  if reframe:
68
69
  self.reframe = reframe
69
70
  self.epoch = epoch
@@ -171,7 +172,7 @@ class CartesianEllipsoidalBase(CartesianBase):
171
172
  kwds = _xkwds(kwds, reframe=self.reframe, epoch=self.epoch)
172
173
  return CartesianBase.toLatLon(self, datum=datum, height=height, **kwds)
173
174
 
174
- def toRefFrame(self, reframe2, reframe=None, epoch=None, epoch2=None, name=NN):
175
+ def toRefFrame(self, reframe2, reframe=None, epoch=None, epoch2=None, **name):
175
176
  '''Convert this point to an other reference frame and epoch.
176
177
 
177
178
  @arg reframe2: Reference frame to convert I{to} (L{RefFrame}).
@@ -181,7 +182,7 @@ class CartesianEllipsoidalBase(CartesianBase):
181
182
  this point's C{epoch or B{reframe}.epoch}.
182
183
  @kwarg epoch2: Optional epoch to observe for the converted point (L{Epoch},
183
184
  C{scalar} or C{str}), otherwise B{C{epoch}}.
184
- @kwarg name: Optional name (C{str}), C{B{reframe2}.name} iff converted.
185
+ @kwarg name: Optional C{B{name}=NN} (C{str}), overriding C{B{reframe2}.name}.
185
186
 
186
187
  @return: The converted point (ellipsoidal C{Cartesian}) or if conversion
187
188
  C{isunity}, this point or a copy of this point if the B{C{name}}
@@ -194,7 +195,7 @@ class CartesianEllipsoidalBase(CartesianBase):
194
195
  @raise TypeError: B{C{reframe2}} or B{C{reframe}} not a L{RefFrame}.
195
196
  '''
196
197
  return _MODS.trf._toRefFrame(self, reframe2, reframe=reframe, epoch=epoch,
197
- epoch2=epoch2, name=name)
198
+ epoch2=epoch2, **name)
198
199
 
199
200
  @deprecated_method
200
201
  def toTransforms_(self, *transforms, **datum): # PYCHOK no cover
@@ -217,8 +218,8 @@ class LatLonEllipsoidalBase(LatLonBase):
217
218
  _scale = None # UTM/UPS scale factor (C{float})
218
219
  _toLLEB_args = () # Etm/Utm/Ups._toLLEB arguments
219
220
 
220
- def __init__(self, latlonh, lon=None, height=0, datum=None, reframe=None,
221
- epoch=None, wrap=False, name=NN):
221
+ def __init__(self, latlonh, lon=None, height=0, datum=_WGS84, reframe=None,
222
+ epoch=None, wrap=False, **name):
222
223
  '''Create an ellipsoidal C{LatLon} point from the given lat-, longitude
223
224
  and height on the given datum, reference frame and epoch.
224
225
 
@@ -236,7 +237,7 @@ class LatLonEllipsoidalBase(LatLonBase):
236
237
  if C{B{reframe}=None}.
237
238
  @kwarg wrap: If C{True}, wrap or I{normalize} B{C{lat}} and B{C{lon}}
238
239
  (C{bool}).
239
- @kwarg name: Optional name (C{str}).
240
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
240
241
 
241
242
  @raise RangeError: Value of C{lat} or B{C{lon}} outside the valid
242
243
  range and L{rangerrors} set to C{True}.
@@ -247,9 +248,9 @@ class LatLonEllipsoidalBase(LatLonBase):
247
248
 
248
249
  @raise UnitError: Invalid B{C{lat}}, B{C{lon}} or B{C{height}}.
249
250
  '''
250
- LatLonBase.__init__(self, latlonh, lon=lon, height=height, wrap=wrap, name=name)
251
+ LatLonBase.__init__(self, latlonh, lon=lon, height=height, wrap=wrap, **name)
251
252
  if datum not in (None, self._datum, _EWGS84):
252
- self.datum = _ellipsoidal_datum(datum, name=name)
253
+ self.datum = _ellipsoidal_datum(datum, name=self.name)
253
254
  if reframe:
254
255
  self.reframe = reframe
255
256
  self.epoch = epoch
@@ -736,7 +737,7 @@ class LatLonEllipsoidalBase(LatLonBase):
736
737
  return _MODS.osgr.toOsgr(self, kTM=True, name=self.name) # datum=self.datum
737
738
 
738
739
  def parse(self, strllh, height=0, datum=None, epoch=None, reframe=None,
739
- sep=_COMMA_, wrap=False, name=NN):
740
+ sep=_COMMA_, wrap=False, **name):
740
741
  '''Parse a string consisting of C{"lat, lon[, height]"},
741
742
  representing a similar, ellipsoidal C{LatLon} point.
742
743
 
@@ -753,7 +754,7 @@ class LatLonEllipsoidalBase(LatLonBase):
753
754
  @kwarg sep: Optional separator (C{str}).
754
755
  @kwarg wrap: If C{True}, wrap or I{normalize} the lat-
755
756
  and longitude (C{bool}).
756
- @kwarg name: Optional instance name (C{str}), overriding
757
+ @kwarg name: Optional C{B{name}=NN} (C{str}), overriding
757
758
  this name.
758
759
 
759
760
  @return: The similar point (ellipsoidal C{LatLon}).
@@ -768,7 +769,7 @@ class LatLonEllipsoidalBase(LatLonBase):
768
769
  r.epoch = epoch
769
770
  if reframe not in (None, self.reframe):
770
771
  r.reframe = reframe
771
- return self._xnamed(r, name=name, force=True) if name else r
772
+ return self._xnamed(r, force=True, **name) if name else r
772
773
 
773
774
  def _Radjust2(self, adjust, datum, meter_text2):
774
775
  '''(INTERNAL) Adjust an C{elevation} or C{geoidHeight} with
@@ -834,15 +835,15 @@ class LatLonEllipsoidalBase(LatLonBase):
834
835
  @see: Function L{pygeodesy.toCss}.
835
836
  '''
836
837
  return self._css if not toCss_kwds else _MODS.css.toCss(
837
- self, **_xkwds(toCss_kwds, name=self.name))
838
+ self, **_name1__(toCss_kwds, _or_nameof=self))
838
839
 
839
- def toDatum(self, datum2, height=None, name=NN):
840
+ def toDatum(self, datum2, height=None, **name):
840
841
  '''Convert this point to an other datum.
841
842
 
842
843
  @arg datum2: Datum to convert I{to} (L{Datum}).
843
844
  @kwarg height: Optional height, overriding the
844
845
  converted height (C{meter}).
845
- @kwarg name: Optional name (C{str}), iff converted.
846
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
846
847
 
847
848
  @return: The converted point (ellipsoidal C{LatLon})
848
849
  or a copy of this point if B{C{datum2}}
@@ -850,10 +851,10 @@ class LatLonEllipsoidalBase(LatLonBase):
850
851
 
851
852
  @raise TypeError: Invalid B{C{datum2}}.
852
853
  '''
853
- n = name or self.name
854
+ n = self._name__(name)
854
855
  d2 = _ellipsoidal_datum(datum2, name=n)
855
856
  if self.datum == d2:
856
- r = self.copy(name=name)
857
+ r = self.copy(name=n)
857
858
  else:
858
859
  kwds = _xkwds_not(None, LatLon=self.classof, name=n,
859
860
  epoch=self.epoch, reframe=self.reframe)
@@ -871,7 +872,7 @@ class LatLonEllipsoidalBase(LatLonBase):
871
872
  @see: Function L{pygeodesy.toEtm8}.
872
873
  '''
873
874
  return self._etm if not toEtm8_kwds else _MODS.etm.toEtm8(
874
- self, **_xkwds(toEtm8_kwds, name=self.name))
875
+ self, **_name1__(toEtm8_kwds, _or_nameof=self))
875
876
 
876
877
  def toLcc(self, **toLcc_kwds):
877
878
  '''Convert this C{LatLon} point to a Lambert location.
@@ -883,7 +884,7 @@ class LatLonEllipsoidalBase(LatLonBase):
883
884
  @see: Function L{pygeodesy.toLcc}.
884
885
  '''
885
886
  return self._lcc if not toLcc_kwds else _MODS.lcc.toLcc(
886
- self, **_xkwds(toLcc_kwds, name=self.name))
887
+ self, **_name1__(toLcc_kwds, _or_nameof=self))
887
888
 
888
889
  def toMgrs(self, center=False, pole=NN):
889
890
  '''Convert this C{LatLon} point to an MGRS coordinate.
@@ -918,7 +919,7 @@ class LatLonEllipsoidalBase(LatLonBase):
918
919
  r = self._osgrTM if kTM else self._osgr
919
920
  return r
920
921
 
921
- def toRefFrame(self, reframe2, reframe=None, epoch=None, epoch2=None, height=None, name=NN):
922
+ def toRefFrame(self, reframe2, reframe=None, epoch=None, epoch2=None, height=None, **name):
922
923
  '''Convert this point to an other reference frame and epoch.
923
924
 
924
925
  @arg reframe2: Reference frame to convert I{to} (L{RefFrame}).
@@ -929,7 +930,7 @@ class LatLonEllipsoidalBase(LatLonBase):
929
930
  @kwarg epoch2: Optional epoch to observe for the converted point (L{Epoch},
930
931
  C{scalar} or C{str}), otherwise B{C{epoch}}.
931
932
  @kwarg height: Optional height, overriding the converted height (C{meter}).
932
- @kwarg name: Optional name (C{str}), C{B{reframe2}.name} iff converted.
933
+ @kwarg name: Optional C{B{name}=NN} (C{str}), overriding C{B{reframe2}.name}.
933
934
 
934
935
  @return: The converted point (ellipsoidal C{LatLon}) or if conversion
935
936
  C{isunity}, this point or a copy of this point if the B{C{name}}
@@ -942,7 +943,7 @@ class LatLonEllipsoidalBase(LatLonBase):
942
943
  @raise TypeError: B{C{reframe2}} or B{C{reframe}} not a L{RefFrame}.
943
944
  '''
944
945
  return _MODS.trf._toRefFrame(self, reframe2, reframe=reframe, epoch=epoch,
945
- epoch2=epoch2, name=name, height=height)
946
+ epoch2=epoch2, height=height, **name)
946
947
 
947
948
  def toTransform(self, transform, inverse=False, datum=None, **LatLon_kwds):
948
949
  '''Apply a Helmert transform to this geodetic point.
@@ -17,10 +17,11 @@ from pygeodesy.errors import _AssertionError, IntersectionError, _IsnotError, \
17
17
  from pygeodesy.fmath import favg, fmean_
18
18
  from pygeodesy.fsums import Fmt, fsumf_
19
19
  from pygeodesy.formy import _isequalTo, opposing, _radical2
20
- from pygeodesy.interns import _antipodal_, _concentric_, _dunder_nameof, \
21
- _ellipsoidal_, _exceed_PI_radians_, _low_, \
22
- _near_, _SPACE_, _too_
23
- from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
20
+ from pygeodesy.interns import _antipodal_, _concentric_, _ellipsoidal_, \
21
+ _exceed_PI_radians_, _low_, _near_, \
22
+ _SPACE_, _too_
23
+ from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, \
24
+ _dunder_nameof
24
25
  from pygeodesy.namedTuples import Bearing2Tuple, Destination2Tuple, \
25
26
  Intersection3Tuple, NearestOn2Tuple, \
26
27
  NearestOn8Tuple, _LL4Tuple
@@ -34,7 +35,7 @@ from pygeodesy.utily import m2km, unroll180, _unrollon, _unrollon3, \
34
35
  from math import degrees, radians
35
36
 
36
37
  __all__ = _ALL_LAZY.ellipsoidalBaseDI
37
- __version__ = '24.02.14'
38
+ __version__ = '24.05.19'
38
39
 
39
40
  _polar__ = 'polar?'
40
41
  _B2END = _1_5 # _intersect3 bearing to pseudo-end point factor
@@ -398,12 +399,12 @@ class LatLonEllipsoidalBaseDI(LatLonEllipsoidalBase):
398
399
 
399
400
  f, j = _fi_j2(f, len(Ps)) # like .vector3d.nearestOn6
400
401
 
401
- n = self.nearestOn8.__name__
402
+ n = self.nearestOn8.__name__ # _dunder_nameof
402
403
  c.rename(n)
403
404
  if s is not c:
404
405
  s = s.copy(name=n)
405
406
  if e is not c:
406
- e = e.copy(name=n)
407
+ e = e.copy(name=n) # name__=self.nearestOn8
407
408
  return NearestOn8Tuple(c, c3.distance, f, j, s, e, c3.initial, c3.final,
408
409
  iteration=m) # ._iteration for tests
409
410
 
@@ -31,8 +31,7 @@ from pygeodesy.ellipsoidalBase import CartesianEllipsoidalBase, \
31
31
  _TOL_M, _Wrap
32
32
  from pygeodesy.errors import _IsnotError, _xkwds, _xkwds_pop2
33
33
  # from pygeodesy.fmath import fdot # from .nvectorBase
34
- from pygeodesy.interns import NN, _Nv00_, _COMMASPACE_
35
- from pygeodesy.interns import _down_, _east_, _north_, _pole_ # PYCHOK used!
34
+ from pygeodesy.interns import _Nv00_, _COMMASPACE_, _pole_ # PYCHOK used!
36
35
  from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _ALL_OTHER
37
36
  # from pygeodesy.ltp import Ltp # _MODS
38
37
  from pygeodesy.ltpTuples import Aer as _Aer, Ned as _Ned, Ned4Tuple, \
@@ -49,15 +48,15 @@ from pygeodesy.units import Bearing, Distance, Height, Scalar
49
48
  # from math import fabs # from .nvectorBase
50
49
 
51
50
  __all__ = _ALL_LAZY.ellipsoidalNvector
52
- __version__ = '24.02.18'
51
+ __version__ = '24.05.19'
53
52
 
54
53
 
55
54
  class Ned(_Ned):
56
55
  '''DEPRECATED on 2024.02.04, use class L{pygeodesy.Ned}.'''
57
56
 
58
- def __init__(self, north, east, down, name=NN):
57
+ def __init__(self, north, east, down, **name):
59
58
  deprecated_class(self.__class__)
60
- _Ned.__init__(self, north, east, down, name=name)
59
+ _Ned.__init__(self, north, east, down, **name)
61
60
 
62
61
  @deprecated_method # PYCHOK expected
63
62
  def toRepr(self, prec=None, fmt=Fmt.SQUARE, sep=_COMMASPACE_, **unused):
@@ -434,7 +433,7 @@ class Nvector(NvectorBase):
434
433
  '''
435
434
  _datum = _WGS84 # default datum (L{Datum})
436
435
 
437
- def __init__(self, x_xyz, y=None, z=None, h=0, datum=None, ll=None, name=NN):
436
+ def __init__(self, x_xyz, y=None, z=None, h=0, datum=None, ll=None, **name):
438
437
  '''New n-vector normal to the earth's surface.
439
438
 
440
439
  @arg x_xyz: X component of vector (C{scalar}) or (3-D) vector
@@ -449,13 +448,13 @@ class Nvector(NvectorBase):
449
448
  (L{Datum}, L{Ellipsoid}, L{Ellipsoid2} or
450
449
  L{a_f2Tuple}).
451
450
  @kwarg ll: Optional, original latlon (C{LatLon}).
452
- @kwarg name: Optional name (C{str}).
451
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
453
452
 
454
453
  @raise TypeError: If B{C{datum}} is not a L{Datum}.
455
454
  '''
456
- NvectorBase.__init__(self, x_xyz, y=y, z=z, h=h, ll=ll, name=name)
455
+ NvectorBase.__init__(self, x_xyz, y=y, z=z, h=h, ll=ll, **name)
457
456
  if datum not in (None, self._datum):
458
- self._datum = _ellipsoidal_datum(datum, name=name)
457
+ self._datum = _ellipsoidal_datum(datum, **name)
459
458
 
460
459
  @Property_RO
461
460
  def datum(self):
@@ -550,7 +549,7 @@ def meanOf(points, datum=_WGS84, height=None, wrap=False,
550
549
  # geographic mean
551
550
  m = sumOf(p._N_vector for p in Ps.iterate(closed=False))
552
551
  kwds = _xkwds(LatLon_and_kwds, height=height, datum=datum,
553
- LatLon=LatLon, name=meanOf.__name__)
552
+ LatLon=LatLon, name__=meanOf)
554
553
  return m.toLatLon(**kwds)
555
554
 
556
555
 
@@ -618,7 +617,7 @@ def sumOf(nvectors, Vector=Nvector, h=None, **Vector_kwds):
618
617
 
619
618
 
620
619
  @deprecated_function
621
- def toNed(distance, bearing, elevation, Ned=Ned, name=NN):
620
+ def toNed(distance, bearing, elevation, Ned=Ned, **name):
622
621
  '''DEPRECATED, use L{pygeodesy.Aer}C{(bearing, elevation,
623
622
  distance).xyzLocal.toNed(B{Ned}, name=B{name})} or
624
623
  L{XyzLocal}C{(pygeodesy.Aer(bearing, elevation,
@@ -633,7 +632,7 @@ def toNed(distance, bearing, elevation, Ned=Ned, name=NN):
633
632
  frame horizontal (C{degrees}).
634
633
  @kwarg Ned: Optional class to return the NED (C{Ned}) or
635
634
  C{None}.
636
- @kwarg name: Optional name (C{str}).
635
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
637
636
 
638
637
  @return: An NED vector equivalent to this B{C{distance}},
639
638
  B{C{bearing}} and B{C{elevation}} (DEPRECATED L{Ned})
pygeodesy/ellipsoids.py CHANGED
@@ -76,12 +76,11 @@ from pygeodesy.fmath import cbrt, cbrt2, fdot, Fhorner, fpowers, hypot, hypot_,
76
76
  from pygeodesy.interns import NN, _a_, _Airy1830_, _AiryModified_, _b_, _Bessel1841_, _beta_, \
77
77
  _Clarke1866_, _Clarke1880IGN_, _DOT_, _f_, _GRS80_, _height_, \
78
78
  _Intl1924_, _incompatible_, _invalid_, _Krassovski1940_, \
79
- _Krassowsky1940_, _meridional_, _lat_, _negative_, _not_, \
80
- _not_finite_, _prime_vertical_, _radius_, _Sphere_, _SPACE_, \
81
- _vs_, _WGS72_, _WGS84_
79
+ _Krassowsky1940_, _lat_, _meridional_, _negative_, _not_finite_, \
80
+ _prime_vertical_, _radius_, _Sphere_, _SPACE_, _vs_, _WGS72_, _WGS84_
82
81
  # from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS # from .named
83
- from pygeodesy.named import _lazyNamedEnumItem as _lazy, _NamedEnum, _NamedEnumItem, \
84
- _NamedTuple, _Pass, _ALL_LAZY, _MODS
82
+ from pygeodesy.named import _lazyNamedEnumItem as _lazy, _name__, _name2__, _NamedEnum, \
83
+ _NamedEnumItem, _NamedTuple, _Pass, _ALL_LAZY, _MODS
85
84
  from pygeodesy.namedTuples import Distance2Tuple, Vector3Tuple, Vector4Tuple
86
85
  from pygeodesy.props import deprecated_Property_RO, Property_RO, property_doc_, \
87
86
  deprecated_property_RO, property_RO
@@ -93,7 +92,7 @@ from pygeodesy.utily import atan1, atan1d, atan2b, degrees90, m2radians, radians
93
92
  from math import asinh, atan, atanh, cos, degrees, exp, fabs, radians, sin, sinh, sqrt, tan
94
93
 
95
94
  __all__ = _ALL_LAZY.ellipsoids
96
- __version__ = '24.04.14'
95
+ __version__ = '24.05.21'
97
96
 
98
97
  _f_0_0 = Float(f =_0_0) # zero flattening
99
98
  _f__0_0 = Float(f_=_0_0) # zero inverse flattening
@@ -136,7 +135,7 @@ class a_f2Tuple(_NamedTuple):
136
135
 
137
136
  @arg a: Equatorial radius (C{scalar} > 0).
138
137
  @arg f: Flattening (C{scalar} < 1, negative for I{prolate}).
139
- @kwarg name: Optional name (C{str}).
138
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
140
139
 
141
140
  @return: An L{a_f2Tuple}C{(a, f)} instance.
142
141
 
@@ -157,13 +156,15 @@ class a_f2Tuple(_NamedTuple):
157
156
  '''
158
157
  return a_f2b(self.a, self.f) # PYCHOK .a and .f
159
158
 
160
- def ellipsoid(self, name=NN):
159
+ def ellipsoid(self, **name):
161
160
  '''Return an L{Ellipsoid} for this 2-tuple C{(a, f)}.
162
161
 
162
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
163
+
163
164
  @raise NameError: A registered C{ellipsoid} with the
164
165
  same B{C{name}} already exists.
165
166
  '''
166
- return Ellipsoid(self.a, f=self.f, name=name or self.name) # PYCHOK .a and .f
167
+ return Ellipsoid(self.a, f=self.f, name=self._name__(name)) # PYCHOK .a and .f
167
168
 
168
169
  @Property_RO
169
170
  def f_(self):
@@ -215,7 +216,7 @@ class Ellipsoid(_NamedEnumItem):
215
216
  _KsOrder = 8 # Krüger series order (4, 6 or 8)
216
217
  _rhumbsolve = NN # means, use PYGEODESY_RHUMBSOLVE
217
218
 
218
- def __init__(self, a, b=None, f_=None, f=None, name=NN):
219
+ def __init__(self, a, b=None, f_=None, f=None, **name):
219
220
  '''New L{Ellipsoid} from the I{equatorial} radius I{and} either
220
221
  the I{polar} radius or I{inverse flattening} or I{flattening}.
221
222
 
@@ -224,7 +225,7 @@ class Ellipsoid(_NamedEnumItem):
224
225
  @arg f_: Inverse flattening: M{a / (a - b)} (C{float} >>> 1.0).
225
226
  @arg f: Flattening: M{(a - b) / a} (C{scalar}, near zero for
226
227
  spherical).
227
- @kwarg name: Optional, unique name (C{str}).
228
+ @kwarg name: Optional, unique C{B{name}=NN} (C{str}).
228
229
 
229
230
  @raise NameError: Ellipsoid with the same B{C{name}} already exists.
230
231
 
@@ -234,7 +235,8 @@ class Ellipsoid(_NamedEnumItem):
234
235
  @note: M{abs(f_) > 1 / EPS} or M{abs(1 / f_) < EPS} is forced
235
236
  to M{1 / f_ = 0}, spherical.
236
237
  '''
237
- ff_ = f, f_ # assertion below
238
+ ff_ = f, f_ # assertion below
239
+ n = _name__(**name) if name else NN
238
240
  try:
239
241
  a = Radius_(a=a) # low=EPS
240
242
  if not _isfinite(a):
@@ -268,7 +270,7 @@ class Ellipsoid(_NamedEnumItem):
268
270
 
269
271
  except (TypeError, ValueError) as x:
270
272
  d = _xkwds_not(None, b=b, f_=f_, f=f)
271
- t = instr(self, a=a, name=name, **d)
273
+ t = instr(self, a=a, name=n, **d)
272
274
  raise _ValueError(t, cause=x)
273
275
 
274
276
  self._a = a
@@ -276,7 +278,7 @@ class Ellipsoid(_NamedEnumItem):
276
278
  self._f = f
277
279
  self._f_ = f_
278
280
 
279
- self._register(Ellipsoids, name)
281
+ self._register(Ellipsoids, n)
280
282
 
281
283
  if f and f_: # see .test/testEllipsoidal.py
282
284
  d = dict(eps=_TOL)
@@ -1023,7 +1025,7 @@ class Ellipsoid(_NamedEnumItem):
1023
1025
  g = exact
1024
1026
  E = _xattr(g, ellipsoid=None)
1025
1027
  if not (E is self and isinstance(g, self._Geodesics)):
1026
- raise _ValueError(exact=g, ellipsoid=E, txt=_not_(self.name))
1028
+ raise _ValueError(exact=g, ellipsoid=E, txt_not_=self.name)
1027
1029
  return g
1028
1030
 
1029
1031
  @property_RO
@@ -1102,7 +1104,7 @@ class Ellipsoid(_NamedEnumItem):
1102
1104
  v, d = _MODS.triaxials._hartzell2(pov, los, self._triaxial)
1103
1105
  except Exception as x:
1104
1106
  raise IntersectionError(pov=pov, los=los, cause=x)
1105
- return Vector4Tuple(v.x, v.y, v.z, d, name=self.hartzell4.__name__)
1107
+ return Vector4Tuple(v.x, v.y, v.z, d, name__=self.hartzell4)
1106
1108
 
1107
1109
  @Property_RO
1108
1110
  def _hash(self):
@@ -1163,8 +1165,7 @@ class Ellipsoid(_NamedEnumItem):
1163
1165
  v = v.times(t)
1164
1166
  h = r * (_1_0 - t)
1165
1167
 
1166
- return Vector4Tuple(v.x, v.y, v.z, h, iteration=i,
1167
- name=self.height4.__name__)
1168
+ return Vector4Tuple(v.x, v.y, v.z, h, iteration=i, name__=self.height4)
1168
1169
 
1169
1170
  def _hubeny_2(self, phi2, phi1, lam21, scaled=True, squared=True):
1170
1171
  '''(INTERNAL) like function C{pygeodesy.flatLocal_}/C{pygeodesy.hubeny_},
@@ -1493,7 +1494,7 @@ class Ellipsoid(_NamedEnumItem):
1493
1494
  r = exact
1494
1495
  E = _xattr(r, ellipsoid=None)
1495
1496
  if not (E is self and isinstance(r, self._Rhumbs)):
1496
- raise _ValueError(exact=r, ellipsosid=E, txt=_not_(self.name))
1497
+ raise _ValueError(exact=r, ellipsosid=E, txt_not_=self.name)
1497
1498
  return r
1498
1499
 
1499
1500
  @property_RO
@@ -1807,42 +1808,45 @@ class Ellipsoid(_NamedEnumItem):
1807
1808
  (sqrt((_3_0 * self.a2_b2 + _1_0) * _0_25) * b) if a < b else a)
1808
1809
  return Radius(Rtriaxial=q)
1809
1810
 
1810
- def toEllipsoid2(self, name=NN):
1811
+ def toEllipsoid2(self, **name):
1811
1812
  '''Get a copy of this ellipsoid as an L{Ellipsoid2}.
1812
1813
 
1813
- @kwarg name: Optional, unique name (C{str}).
1814
+ @kwarg name: Optional, unique C{B{name}=NN} (C{str}).
1814
1815
 
1815
1816
  @see: Property C{a_f}.
1816
1817
  '''
1817
- return Ellipsoid2(self, None, name=name)
1818
+ return Ellipsoid2(self, None, **name)
1818
1819
 
1819
- def toStr(self, prec=8, terse=0, name=NN, **unused): # PYCHOK expected
1820
+ def toStr(self, prec=8, terse=0, **name): # PYCHOK expected
1820
1821
  '''Return this ellipsoid as a text string.
1821
1822
 
1822
1823
  @kwarg prec: Number of decimal digits, unstripped (C{int}).
1823
1824
  @kwarg terse: Limit the number of items (C{int}, 0...18).
1824
- @kwarg name: Override name (C{str}) or C{None} to exclude
1825
- this ellipsoid's name.
1825
+ @kwarg name: Optional C{B{name}=NN} (C{str}) or C{None} to
1826
+ exclude this ellipsoid's name.
1826
1827
 
1827
1828
  @return: This C{Ellipsoid}'s attributes (C{str}).
1828
1829
  '''
1829
1830
  E = Ellipsoid
1830
- t = E.a, E.b, E.f_, E.f, E.f2, E.n, E.e, E.e2, E.e21, E.e22, E.e32, \
1831
+ t = E.a, E.b, E.f_, E.f, E.f2, E.n, E.e, E.e2, E.e21, E.e22, E.e32, \
1831
1832
  E.A, E.L, E.R1, E.R2, E.R3, E.Rbiaxial, E.Rtriaxial
1832
1833
  if terse:
1833
1834
  t = t[:terse]
1834
- return self._instr(name, prec, props=t)
1835
+ n, _ = _name2__(**name) # name=None
1836
+ return self._instr(n, prec, props=t)
1835
1837
 
1836
- def toTriaxial(self, name=NN):
1838
+ def toTriaxial(self, **name):
1837
1839
  '''Convert this ellipsoid to a L{Triaxial_}.
1838
1840
 
1841
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
1842
+
1839
1843
  @return: A L{Triaxial_} or L{Triaxial} with the C{X} axis
1840
1844
  pointing east and C{Z} pointing north.
1841
1845
 
1842
1846
  @see: Method L{Triaxial_.toEllipsoid}.
1843
1847
  '''
1844
1848
  T = self._triaxial
1845
- return T.copy(name=name) if name else T
1849
+ return T.copy(**name) if name else T
1846
1850
 
1847
1851
  @property_RO
1848
1852
  def _triaxial(self):
@@ -1864,12 +1868,14 @@ class Ellipsoid(_NamedEnumItem):
1864
1868
  class Ellipsoid2(Ellipsoid):
1865
1869
  '''An L{Ellipsoid} specified by I{equatorial} radius and I{flattening}.
1866
1870
  '''
1867
- def __init__(self, a, f, name=NN):
1871
+ def __init__(self, a, f=None, **name):
1868
1872
  '''New L{Ellipsoid2}.
1869
1873
 
1870
- @arg a: Equatorial radius, semi-axis (C{meter}).
1871
- @arg f: Flattening: (C{float} < 1.0, negative for I{prolate}).
1872
- @kwarg name: Optional, unique name (C{str}).
1874
+ @arg a: Equatorial radius, semi-axis (C{meter}) or a previous
1875
+ L{Ellipsoid} instance.
1876
+ @arg f: Flattening: (C{float} < 1.0, negative for I{prolate}),
1877
+ if B{C{a}} is in C{meter}.
1878
+ @kwarg name: Optional, unique C{B{name}=NN} (C{str}).
1873
1879
 
1874
1880
  @raise NameError: Ellipsoid with that B{C{name}} already exists.
1875
1881
 
@@ -1880,9 +1886,9 @@ class Ellipsoid2(Ellipsoid):
1880
1886
  '''
1881
1887
  if f is None and isinstance(a, Ellipsoid):
1882
1888
  Ellipsoid.__init__(self, a.a, f =a.f,
1883
- b=a.b, f_=a.f_, name=name)
1889
+ b=a.b, f_=a.f_, **name)
1884
1890
  else:
1885
- Ellipsoid.__init__(self, a, f=f, name=name)
1891
+ Ellipsoid.__init__(self, a, f=f, **name)
1886
1892
 
1887
1893
 
1888
1894
  def _spherical_a_b(a, b):
pygeodesy/elliptic.py CHANGED
@@ -82,11 +82,12 @@ from pygeodesy.constants import EPS, INF, NAN, PI, PI_2, PI_4, \
82
82
  _360_0, _over
83
83
  # from pygeodesy.errors import _ValueError # from .fmath
84
84
  from pygeodesy.fmath import fdot, hypot1, zqrt, _ValueError
85
- from pygeodesy.fsums import Fsum, _sum, _ALL_LAZY
86
- from pygeodesy.interns import NN, _delta_, _DOT_, _dunder_nameof, _f_, \
87
- _invalid_, _invokation_, _negative_, _SPACE_
85
+ from pygeodesy.fsums import Fsum, _sum
86
+ # from pygeodesy.internals import _dunder_nameof # from .lazily
87
+ from pygeodesy.interns import NN, _delta_, _DOT_, _f_, _invalid_, \
88
+ _invokation_, _negative_, _SPACE_
88
89
  from pygeodesy.karney import _K_2_0, _norm180, _signBit, _sincos2
89
- # from pygeodesy.lazily import _ALL_LAZY # from .fsums
90
+ from pygeodesy.lazily import _ALL_LAZY, _dunder_nameof
90
91
  from pygeodesy.named import _Named, _NamedTuple, Fmt, unstr
91
92
  from pygeodesy.props import _allPropertiesOf_n, Property_RO, _update_all
92
93
  # from pygeodesy.streprs import Fmt, unstr # from .named
@@ -97,7 +98,7 @@ from math import asinh, atan, atan2, ceil, cosh, fabs, floor, \
97
98
  radians, sin, sqrt, tanh
98
99
 
99
100
  __all__ = _ALL_LAZY.elliptic
100
- __version__ = '24.04.14'
101
+ __version__ = '24.05.18'
101
102
 
102
103
  _TolRD = zqrt(EPS * 0.002)
103
104
  _TolRF = zqrt(EPS * 0.030)
@@ -138,10 +139,10 @@ class Elliptic(_Named):
138
139
  # _k2 = 0
139
140
  # _kp2 = 0
140
141
 
141
- def __init__(self, k2=0, alpha2=0, kp2=None, alphap2=None, name=NN):
142
+ def __init__(self, k2=0, alpha2=0, kp2=None, alphap2=None, **name):
142
143
  '''Constructor, specifying the C{modulus} and C{parameter}.
143
144
 
144
- @kwarg name: Optional name (C{str}).
145
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
145
146
 
146
147
  @see: Method L{Elliptic.reset} for further details.
147
148
 
@@ -151,7 +152,6 @@ class Elliptic(_Named):
151
152
  E(φ, k)} and C{H(φ, 0, k) = F(φ, k) - D(φ, k)}.
152
153
  '''
153
154
  self.reset(k2=k2, alpha2=alpha2, kp2=kp2, alphap2=alphap2)
154
-
155
155
  if name:
156
156
  self.name = name
157
157
 
@@ -402,10 +402,12 @@ class Elliptic(_Named):
402
402
  Phi = Fsum(phi)
403
403
  # first order correction
404
404
  phi = Phi.fsum_(self.eps * sin(phi * _2_0) / _N_2_0)
405
+ self._iteration = 0
405
406
  # For kp2 close to zero use asin(r / cE) or J. P. Boyd,
406
407
  # Applied Math. and Computation 218, 7005-7013 (2012)
407
408
  # <https://DOI.org/10.1016/j.amc.2011.12.021>
408
- _Phi2, self._iteration = Phi.fsum2f_, 0 # aggregate
409
+ _Phi2 = Phi.fsum2f_ # aggregate
410
+ _abs = fabs
409
411
  for i in range(1, _TRIPS): # GEOGRAPHICLIB_PANIC
410
412
  sn, cn, dn = self._sncndn3(phi)
411
413
  if dn:
@@ -413,7 +415,7 @@ class Elliptic(_Named):
413
415
  phi, d = _Phi2((r - sn) / dn)
414
416
  else: # PYCHOK no cover
415
417
  d = _0_0 # XXX continue?
416
- if fabs(d) < _TolJAC: # 3-4 trips
418
+ if _abs(d) < _TolJAC: # 3-4 trips
417
419
  _iterations(self, i)
418
420
  break
419
421
  else: # PYCHOK no cover
pygeodesy/epsg.py CHANGED
@@ -28,7 +28,7 @@ from pygeodesy.utmupsBase import _to3zBhp, _UPS_ZONE, _UTM_ZONE_MIN, \
28
28
  _UTM_ZONE_MAX, _UTMUPS_ZONE_INVALID
29
29
 
30
30
  __all__ = _ALL_LAZY.epsg
31
- __version__ = '22.09.24'
31
+ __version__ = '24.05.18'
32
32
 
33
33
  # _EPSG_INVALID = _UTMUPS_ZONE_INVALID
34
34
  _EPSG_N_01 = 32601 # EPSG code for UTM zone 01 N
@@ -49,11 +49,12 @@ class Epsg(Int):
49
49
  _utmups = None
50
50
  _zone = _UTMUPS_ZONE_INVALID
51
51
 
52
- def __new__(cls, eisu, name=NN):
52
+ def __new__(cls, eisu, **name):
53
53
  '''New L{Epsg} (I{European Petroleum Survey Group}) code from a
54
54
  UTM/USP coordinate or other EPSG code.
55
55
 
56
56
  @arg eisu: Other code (L{Epsg}, C{int}, C{str}, L{Utm} or L{Ups}).
57
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
57
58
 
58
59
  @return: New L{Epsg}.
59
60
 
@@ -88,7 +89,7 @@ class Epsg(Int):
88
89
  self.name = u.name
89
90
 
90
91
  if name:
91
- self.name = name
92
+ self.rename(name)
92
93
  return self
93
94
 
94
95
  def __repr__(self):