pygeodesy 24.6.9__py2.py3-none-any.whl → 24.7.7__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 (87) hide show
  1. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.7.7.dist-info/RECORD +117 -0
  3. pygeodesy/__init__.py +39 -32
  4. pygeodesy/__main__.py +6 -1
  5. pygeodesy/albers.py +2 -2
  6. pygeodesy/auxilats/__init__.py +1 -1
  7. pygeodesy/auxilats/auxAngle.py +40 -39
  8. pygeodesy/auxilats/auxDLat.py +3 -2
  9. pygeodesy/auxilats/auxLat.py +16 -18
  10. pygeodesy/auxilats/auxily.py +1 -1
  11. pygeodesy/azimuthal.py +10 -10
  12. pygeodesy/basics.py +16 -4
  13. pygeodesy/booleans.py +4 -4
  14. pygeodesy/cartesianBase.py +11 -14
  15. pygeodesy/css.py +14 -18
  16. pygeodesy/datums.py +6 -6
  17. pygeodesy/deprecated/__init__.py +1 -1
  18. pygeodesy/deprecated/classes.py +25 -4
  19. pygeodesy/deprecated/datum.py +3 -3
  20. pygeodesy/deprecated/functions.py +6 -8
  21. pygeodesy/dms.py +23 -27
  22. pygeodesy/ecef.py +4 -4
  23. pygeodesy/elevations.py +4 -4
  24. pygeodesy/ellipsoidalBase.py +23 -28
  25. pygeodesy/ellipsoidalBaseDI.py +19 -23
  26. pygeodesy/ellipsoidalExact.py +3 -3
  27. pygeodesy/ellipsoidalGeodSolve.py +15 -23
  28. pygeodesy/ellipsoidalKarney.py +37 -60
  29. pygeodesy/ellipsoidalNvector.py +38 -44
  30. pygeodesy/ellipsoidalVincenty.py +11 -14
  31. pygeodesy/ellipsoids.py +107 -101
  32. pygeodesy/errors.py +109 -48
  33. pygeodesy/etm.py +32 -44
  34. pygeodesy/formy.py +55 -58
  35. pygeodesy/frechet.py +18 -20
  36. pygeodesy/fsums.py +3 -3
  37. pygeodesy/gars.py +3 -4
  38. pygeodesy/geodesici.py +1696 -0
  39. pygeodesy/geodesicw.py +15 -15
  40. pygeodesy/geodesicx/__init__.py +4 -4
  41. pygeodesy/geodesicx/gx.py +34 -55
  42. pygeodesy/geodesicx/gxbases.py +20 -8
  43. pygeodesy/geodesicx/gxline.py +93 -88
  44. pygeodesy/geodsolve.py +108 -59
  45. pygeodesy/geohash.py +26 -34
  46. pygeodesy/geoids.py +28 -37
  47. pygeodesy/hausdorff.py +17 -18
  48. pygeodesy/heights.py +2 -2
  49. pygeodesy/internals.py +46 -13
  50. pygeodesy/interns.py +2 -2
  51. pygeodesy/karney.py +78 -15
  52. pygeodesy/ktm.py +13 -16
  53. pygeodesy/latlonBase.py +17 -19
  54. pygeodesy/lazily.py +28 -25
  55. pygeodesy/lcc.py +28 -31
  56. pygeodesy/ltp.py +7 -8
  57. pygeodesy/ltpTuples.py +71 -73
  58. pygeodesy/mgrs.py +8 -9
  59. pygeodesy/named.py +19 -10
  60. pygeodesy/nvectorBase.py +9 -10
  61. pygeodesy/osgr.py +9 -9
  62. pygeodesy/points.py +6 -6
  63. pygeodesy/rhumb/__init__.py +1 -1
  64. pygeodesy/rhumb/aux_.py +5 -5
  65. pygeodesy/rhumb/bases.py +30 -31
  66. pygeodesy/rhumb/ekx.py +3 -4
  67. pygeodesy/rhumb/solve.py +21 -22
  68. pygeodesy/solveBase.py +177 -123
  69. pygeodesy/sphericalBase.py +10 -11
  70. pygeodesy/sphericalNvector.py +13 -13
  71. pygeodesy/sphericalTrigonometry.py +86 -97
  72. pygeodesy/streprs.py +4 -34
  73. pygeodesy/triaxials.py +48 -43
  74. pygeodesy/units.py +208 -275
  75. pygeodesy/unitsBase.py +115 -107
  76. pygeodesy/ups.py +26 -31
  77. pygeodesy/utily.py +8 -8
  78. pygeodesy/utm.py +35 -40
  79. pygeodesy/utmups.py +43 -46
  80. pygeodesy/utmupsBase.py +8 -9
  81. pygeodesy/vector3d.py +26 -27
  82. pygeodesy/vector3dBase.py +6 -7
  83. pygeodesy/webmercator.py +19 -21
  84. pygeodesy/wgrs.py +18 -20
  85. PyGeodesy-24.6.9.dist-info/RECORD +0 -116
  86. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/WHEEL +0 -0
  87. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/top_level.txt +0 -0
pygeodesy/geohash.py CHANGED
@@ -20,7 +20,7 @@ from pygeodesy.basics import isodd, isstr, map2
20
20
  from pygeodesy.constants import EPS, R_M, _floatuple, _0_0, _0_5, _180_0, \
21
21
  _360_0, _90_0, _N_90_0, _N_180_0 # PYCHOK used!
22
22
  from pygeodesy.dms import parse3llh # parseDMS2
23
- from pygeodesy.errors import _ValueError, _xkwds
23
+ from pygeodesy.errors import _ValueError, _xkwds, _xStrError
24
24
  from pygeodesy.fmath import favg
25
25
  # from pygeodesy import formy as _formy # _MODS
26
26
  from pygeodesy.interns import NN, _COMMA_, _DOT_, _E_, _N_, _NE_, _NW_, \
@@ -32,13 +32,12 @@ from pygeodesy.namedTuples import Bounds2Tuple, Bounds4Tuple, LatLon2Tuple, \
32
32
  from pygeodesy.props import deprecated_function, deprecated_method, \
33
33
  deprecated_property_RO, Property_RO
34
34
  from pygeodesy.streprs import fstr
35
- from pygeodesy.units import Degrees_, Int, Lat, Lon, Precision_, Str, \
36
- _xStrError
35
+ from pygeodesy.units import Degrees_, Int, Lat, Lon, Precision_, Str
37
36
 
38
37
  from math import fabs, ldexp, log10, radians
39
38
 
40
39
  __all__ = _ALL_LAZY.geohash
41
- __version__ = '24.06.10'
40
+ __version__ = '24.06.15'
42
41
 
43
42
  _formy = _MODS.into(formy=__name__)
44
43
 
@@ -237,7 +236,7 @@ class Geohash(Str):
237
236
  @kwarg LatLon: Optional class to return I{bounds} (C{LatLon})
238
237
  or C{None}.
239
238
  @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
240
- arguments, ignored if B{C{LatLon}} is C{None}.
239
+ arguments, ignored if C{B{LatLon} is None}.
241
240
 
242
241
  @return: A L{Bounds2Tuple}C{(latlonSW, latlonNE)} of B{C{LatLon}}s
243
242
  or a L{Bounds4Tuple}C{(latS, lonW, latN, lonE)} if
@@ -300,16 +299,15 @@ class Geohash(Str):
300
299
 
301
300
  @arg other: The other geohash (L{Geohash}, C{LatLon} or C{str}).
302
301
  @kwarg radius: Mean earth radius, ellipsoid or datum (C{meter},
303
- L{Ellipsoid}, L{Ellipsoid2}, L{Datum} or
304
- L{a_f2Tuple}) or C{None}, see function
305
- L{pygeodesy.equirectangular}.
302
+ L{Ellipsoid}, L{Ellipsoid2}, L{Datum} or L{a_f2Tuple})
303
+ or C{None}, see function L{pygeodesy.equirectangular}.
306
304
  @kwarg adjust_limit_wrap: Optional keyword arguments for function
307
305
  L{pygeodesy.equirectangular4}, overriding defaults
308
306
  C{B{adjust}=False, B{limit}=None} and C{B{wrap}=False}.
309
307
 
310
- @return: Distance (C{meter}, same units as B{C{radius}} or the
311
- ellipsoid or datum axes or C{radians I{squared}} if
312
- B{C{radius}} is C{None} or C{0}).
308
+ @return: Distance (C{meter}, same units as B{C{radius}} or the ellipsoid
309
+ or datum axes or C{radians I{squared}} if B{C{radius} is None}
310
+ or C{0}).
313
311
 
314
312
  @raise TypeError: The B{C{other}} is not a L{Geohash}, C{LatLon} or
315
313
  C{str} or invalid B{C{radius}}.
@@ -398,13 +396,11 @@ class Geohash(Str):
398
396
  as an instance of the supplied C{LatLon} class.
399
397
 
400
398
  @arg LatLon: Class to use (C{LatLon}) or C{None}.
401
- @kwarg LatLon_kwds: Optional, additional B{C{LatLon}}
402
- keyword arguments, ignored if
403
- C{B{LatLon} is None}.
399
+ @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
400
+ arguments, ignored if C{B{LatLon} is None}.
404
401
 
405
- @return: This geohash location (B{C{LatLon}}) or a
406
- L{LatLon2Tuple}C{(lat, lon)} if B{C{LatLon}}
407
- is C{None}.
402
+ @return: This geohash location (B{C{LatLon}}) or if C{B{LatLon}
403
+ is None}, a L{LatLon2Tuple}C{(lat, lon)}.
408
404
 
409
405
  @raise TypeError: Invalid B{C{LatLon}} or B{C{LatLon_kwds}}.
410
406
  '''
@@ -500,19 +496,17 @@ _Neighbors8Defaults = dict(zip(Neighbors8Dict._Keys_, (None,) *
500
496
  def bounds(geohash, LatLon=None, **LatLon_kwds):
501
497
  '''Returns the lower-left SW and upper-right NE corners of a geohash.
502
498
 
503
- @arg geohash: To be bound (L{Geohash}).
504
- @kwarg LatLon: Optional class to return the bounds (C{LatLon})
505
- or C{None}.
506
- @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
507
- arguments, ignored if C{B{LatLon} is None}.
499
+ @arg geohash: To be "bound" (L{Geohash}).
500
+ @kwarg LatLon: Optional class to return the bounds (C{LatLon}) or C{None}.
501
+ @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword arguments,
502
+ ignored if C{B{LatLon} is None}.
508
503
 
509
- @return: A L{Bounds2Tuple}C{(latlonSW, latlonNE)} of B{C{LatLon}}s
510
- or if B{C{LatLon}} is C{None}, a L{Bounds4Tuple}C{(latS,
511
- lonW, latN, lonE)}.
504
+ @return: A L{Bounds2Tuple}C{(latlonSW, latlonNE)}, each a B{C{LatLon}}
505
+ or if C{B{LatLon} is None}, a L{Bounds4Tuple}C{(latS, lonW,
506
+ latN, lonE)}.
512
507
 
513
- @raise TypeError: The B{C{geohash}} is not a L{Geohash}, C{LatLon}
514
- or C{str} or invalid B{C{LatLon}} or invalid
515
- B{C{LatLon_kwds}}.
508
+ @raise TypeError: The B{C{geohash}} is not a L{Geohash}, C{LatLon} or
509
+ C{str} or invalid B{C{LatLon}} or invalid B{C{LatLon_kwds}}.
516
510
 
517
511
  @raise GeohashError: Invalid or C{null} B{C{geohash}}.
518
512
  '''
@@ -847,14 +841,12 @@ def resolution2(prec1, prec2=None):
847
841
  def sizes(geohash):
848
842
  '''Return the lat- and longitudinal size of this L{Geohash} cell.
849
843
 
850
- @arg geohash: Cell for which size are required (L{Geohash} or
851
- C{str}).
844
+ @arg geohash: Cell for which size are required (L{Geohash} or C{str}).
852
845
 
853
- @return: A L{LatLon2Tuple}C{(lat, lon)} with the latitudinal
854
- height and longitudinal width in (C{meter}).
846
+ @return: A L{LatLon2Tuple}C{(lat, lon)} with the latitudinal height and
847
+ longitudinal width in (C{meter}).
855
848
 
856
- @raise TypeError: The B{C{geohash}} is not a L{Geohash},
857
- C{LatLon} or C{str}.
849
+ @raise TypeError: The B{C{geohash}} is not a L{Geohash}, C{LatLon} or C{str}.
858
850
  '''
859
851
  return _2Geohash(geohash).sizes
860
852
 
pygeodesy/geoids.py CHANGED
@@ -118,7 +118,7 @@ except ImportError: # Python 3+
118
118
  from io import BytesIO as _BytesIO # PYCHOK expected
119
119
 
120
120
  __all__ = _ALL_LAZY.geoids
121
- __version__ = '24.06.03'
121
+ __version__ = '24.06.11'
122
122
 
123
123
  _assert_ = 'assert'
124
124
  _bHASH_ = b'#'
@@ -323,10 +323,9 @@ class _GeoidBase(_HeightsBase):
323
323
  @kwarg LatLon: Optional class to return the location and height
324
324
  (C{LatLon}) or C{None}.
325
325
 
326
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
327
- lon, height)} otherwise a B{C{LatLon}} instance
328
- with the lat-, longitude and geoid height of the
329
- center grid location.
326
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
327
+ height)} otherwise a B{C{LatLon}} instance with the lat-,
328
+ longitude and geoid height of the center grid location.
330
329
  '''
331
330
  return self._llh3LL(self._center, LatLon)
332
331
 
@@ -437,10 +436,9 @@ class _GeoidBase(_HeightsBase):
437
436
  @kwarg LatLon: Optional class to return the location and height
438
437
  (C{LatLon}) or C{None}.
439
438
 
440
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
441
- lon, height)} otherwise a B{C{LatLon}} instance
442
- with the lat-, longitude and geoid height of the
443
- highest grid location.
439
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
440
+ height)} otherwise a B{C{LatLon}} instance with the lat-,
441
+ longitude and geoid height of the highest grid location.
444
442
  '''
445
443
  return self._llh3LL(self._highest, LatLon)
446
444
 
@@ -513,10 +511,9 @@ class _GeoidBase(_HeightsBase):
513
511
  @kwarg LatLon: Optional class to return the location
514
512
  (C{LatLon}) and height or C{None}.
515
513
 
516
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
517
- lon, height)} otherwise a B{C{LatLon}} instance
518
- with the lat-, longitude and geoid height of the
519
- lower-left, SW grid corner.
514
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
515
+ otherwise a B{C{LatLon}} instance with the lat-, longitude and
516
+ geoid height of the lower-left, SW grid corner.
520
517
  '''
521
518
  return self._llh3LL(self._lowerleft, LatLon)
522
519
 
@@ -532,10 +529,9 @@ class _GeoidBase(_HeightsBase):
532
529
  @kwarg LatLon: Optional class to return the location and height
533
530
  (C{LatLon}) or C{None}.
534
531
 
535
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
536
- lon, height)} otherwise a B{C{LatLon}} instance
537
- with the lat-, longitude and geoid height of the
538
- lower-right, SE grid corner.
532
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
533
+ otherwise a B{C{LatLon}} instance with the lat-, longitude and
534
+ geoid height of the lower-right, SE grid corner.
539
535
  '''
540
536
 
541
537
  return self._llh3LL(self._loweright, LatLon)
@@ -554,10 +550,9 @@ class _GeoidBase(_HeightsBase):
554
550
  @kwarg LatLon: Optional class to return the location and height
555
551
  (C{LatLon}) or C{None}.
556
552
 
557
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
558
- lon, height)} otherwise a B{C{LatLon}} instance
559
- with the lat-, longitude and geoid height of the
560
- lowest grid location.
553
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
554
+ height)} otherwise a B{C{LatLon}} instance with the lat-,
555
+ longitude and geoid height of the lowest grid location.
561
556
  '''
562
557
  return self._llh3LL(self._lowest, LatLon)
563
558
 
@@ -701,10 +696,9 @@ class _GeoidBase(_HeightsBase):
701
696
  @kwarg LatLon: Optional class to return the location and height
702
697
  (C{LatLon}) or C{None}.
703
698
 
704
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
705
- lon, height)} otherwise a B{C{LatLon}} instance
706
- with the lat-, longitude and geoid height of the
707
- upper-left, NW grid corner.
699
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
700
+ otherwise a B{C{LatLon}} instance with the lat-, longitude and
701
+ geoid height of the upper-left, NW grid corner.
708
702
  '''
709
703
  return self._llh3LL(self._upperleft, LatLon)
710
704
 
@@ -720,10 +714,9 @@ class _GeoidBase(_HeightsBase):
720
714
  @kwarg LatLon: Optional class to return the location and height
721
715
  (C{LatLon}) or C{None}.
722
716
 
723
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
724
- lon, height)} otherwise a B{C{LatLon}} instance
725
- with the lat-, longitude and geoid height of the
726
- upper-right, NE grid corner.
717
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon, height)}
718
+ otherwise a B{C{LatLon}} instance with the lat-, longitude and
719
+ geoid height of the upper-right, NE grid corner.
727
720
  '''
728
721
  return self._llh3LL(self._upperright, LatLon)
729
722
 
@@ -1169,10 +1162,9 @@ class GeoidKarney(_GeoidBase):
1169
1162
  (C{LatLon}) or C{None}.
1170
1163
  @kwarg full: Search the full or limited latitude range (C{bool}).
1171
1164
 
1172
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
1173
- lon, height)} otherwise a B{C{LatLon}} instance
1174
- with the lat-, longitude and geoid height at the
1175
- highest grid location.
1165
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
1166
+ height)} otherwise a B{C{LatLon}} instance with the lat-,
1167
+ longitude and geoid height of the highest grid location.
1176
1168
  '''
1177
1169
  llh = self._highest if full or self.cropped else self._highest_ltd
1178
1170
  return self._llh3LL(llh, LatLon)
@@ -1223,10 +1215,9 @@ class GeoidKarney(_GeoidBase):
1223
1215
  (C{LatLon}) or C{None}.
1224
1216
  @kwarg full: Search the full or limited latitude range (C{bool}).
1225
1217
 
1226
- @return: If B{C{LatLon}} is C{None}, a L{LatLon3Tuple}C{(lat,
1227
- lon, height)} otherwise a B{C{LatLon}} instance
1228
- with the lat-, longitude and geoid height of the
1229
- lowest grid location.
1218
+ @return: If C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
1219
+ height)} otherwise a B{C{LatLon}} instance with the lat-,
1220
+ longitude and geoid height of the lowest grid location.
1230
1221
  '''
1231
1222
  llh = self._lowest if full or self.cropped else self._lowest_ltd
1232
1223
  return self._llh3LL(llh, LatLon)
pygeodesy/hausdorff.py CHANGED
@@ -72,21 +72,20 @@ from pygeodesy.datums import _ellipsoidal_datum, _WGS84
72
72
  from pygeodesy.errors import PointsError, _xattr, _xcallable, _xkwds, _xkwds_get
73
73
  import pygeodesy.formy as _formy
74
74
  from pygeodesy.interns import NN, _i_, _j_, _units_
75
- # from pygeodesy.iters import points2 # from .points
75
+ # from pygeodesy.iters import points2 as _points # from .points
76
76
  from pygeodesy.lazily import _ALL_LAZY, _FOR_DOCS
77
77
  from pygeodesy.named import _name2__, _Named, _NamedTuple, _Pass
78
78
  # from pygeodesy.namedTuples import PhiLam2Tuple # from .points
79
- from pygeodesy.points import _distanceTo, points2 as _points2, PhiLam2Tuple, radians
79
+ from pygeodesy.points import _distanceTo, PhiLam2Tuple, points2 as _points2, radians
80
80
  from pygeodesy.props import Property, Property_RO, property_doc_, property_RO
81
- from pygeodesy.units import Float, Number_, _xUnit, _xUnits
82
- from pygeodesy.unitsBase import _Str_degrees, _Str_degrees2, _Str_meter, _Str_NN, \
83
- _Str_radians, _Str_radians2
81
+ from pygeodesy.units import Float, Number_
82
+ from pygeodesy import unitsBase as _unitsBase # _Str_..., _xUnit, _xUnits
84
83
 
85
84
  # from math import radians # from .points
86
85
  from random import Random
87
86
 
88
87
  __all__ = _ALL_LAZY.hausdorff
89
- __version__ = '24.06.08'
88
+ __version__ = '24.06.15'
90
89
 
91
90
 
92
91
  class HausdorffError(PointsError):
@@ -104,7 +103,7 @@ class Hausdorff(_Named):
104
103
  _kwds = {} # func_ options
105
104
  _model = ()
106
105
  _seed = None
107
- _units = _Str_NN # XXX Str to _Pass and for backward compatibility
106
+ _units = _unitsBase._Str_NN # XXX Str to _Pass and for backward compatibility
108
107
 
109
108
  def __init__(self, point1s, seed=None, units=NN, **name__kwds):
110
109
  '''New C{Hausdorff...} calculator.
@@ -261,7 +260,7 @@ class Hausdorff(_Named):
261
260
 
262
261
  @raise TypeError: Invalid B{C{units}}.
263
262
  '''
264
- self._units = _xUnits(units, Base=Float)
263
+ self._units = _unitsBase._xUnits(units, Base=Float)
265
264
 
266
265
  @Property_RO
267
266
  def wrap(self):
@@ -274,7 +273,7 @@ class HausdorffDegrees(Hausdorff):
274
273
  '''L{Hausdorff} base class for distances from C{LatLon}
275
274
  points in C{degrees}.
276
275
  '''
277
- _units = _Str_degrees
276
+ _units = _unitsBase._Str_degrees
278
277
 
279
278
  if _FOR_DOCS:
280
279
  __init__ = Hausdorff.__init__
@@ -290,7 +289,7 @@ class HausdorffRadians(Hausdorff):
290
289
  '''L{Hausdorff} base class for distances from C{LatLon}
291
290
  points converted from C{degrees} to C{radians}.
292
291
  '''
293
- _units = _Str_radians
292
+ _units = _unitsBase._Str_radians
294
293
 
295
294
  if _FOR_DOCS:
296
295
  __init__ = Hausdorff.__init__
@@ -318,8 +317,8 @@ class _HausdorffMeterRadians(Hausdorff):
318
317
  the optional keyword arguments supplied at instantiation
319
318
  of the C{Hausdorff*} sub-class.
320
319
  '''
321
- _units = _Str_meter
322
- _units_ = _Str_radians
320
+ _units = _unitsBase._Str_meter
321
+ _units_ = _unitsBase._Str_radians
323
322
 
324
323
  def directed(self, point2s, early=True):
325
324
  '''Overloaded method L{Hausdorff.directed} to determine
@@ -426,7 +425,7 @@ class HausdorffDistanceTo(Hausdorff):
426
425
  '''Compute the C{Hausdorff} distance based on the distance from the
427
426
  points' C{LatLon.distanceTo} method, conventionally in C{meter}.
428
427
  '''
429
- _units = _Str_meter
428
+ _units = _unitsBase._Str_meter
430
429
 
431
430
  def __init__(self, point1s, **seed_name__distanceTo_kwds):
432
431
  '''New L{HausdorffDistanceTo} calculator.
@@ -464,7 +463,7 @@ class HausdorffEquirectangular(Hausdorff):
464
463
  '''Compute the C{Hausdorff} distance based on the C{equirectangular} distance
465
464
  in C{radians squared} like function L{pygeodesy.equirectangular}.
466
465
  '''
467
- _units = _Str_degrees2
466
+ _units = _unitsBase._Str_degrees2
468
467
 
469
468
  def __init__(self, point1s, **seed_name__adjust_limit_wrap):
470
469
  '''New L{HausdorffEquirectangular} calculator.
@@ -513,7 +512,7 @@ class HausdorffExact(Hausdorff):
513
512
  '''Compute the C{Hausdorff} distance based on the I{angular}
514
513
  distance in C{degrees} from method L{GeodesicExact}C{.Inverse}.
515
514
  '''
516
- _units = _Str_degrees
515
+ _units = _unitsBase._Str_degrees
517
516
 
518
517
  def __init__(self, point1s, datum=None, **seed_name__wrap):
519
518
  '''New L{HausdorffKarney} calculator.
@@ -543,7 +542,7 @@ class HausdorffFlatLocal(_HausdorffMeterRadians):
543
542
  '''Compute the C{Hausdorff} distance based on the I{angular} distance in
544
543
  C{radians squared} like function L{pygeodesy.flatLocal_}/L{pygeodesy.hubeny_}.
545
544
  '''
546
- _units = _Str_radians2
545
+ _units = _unitsBase._Str_radians2
547
546
 
548
547
  def __init__(self, point1s, **seed_name__datum_scaled_wrap):
549
548
  '''New L{HausdorffFlatLocal}/L{HausdorffHubeny} calculator.
@@ -634,7 +633,7 @@ class HausdorffKarney(Hausdorff):
634
633
  <https://GeographicLib.SourceForge.io/Python/doc/code.html>}
635
634
  Inverse method.
636
635
  '''
637
- _units = _Str_degrees
636
+ _units = _unitsBase._Str_degrees
638
637
 
639
638
  def __init__(self, point1s, datum=None, **seed_name__wrap):
640
639
  '''New L{HausdorffKarney} calculator.
@@ -823,7 +822,7 @@ class Hausdorff6Tuple(_NamedTuple):
823
822
  '''Overloaded C{_NamedTuple.toUnits} for C{hd} and C{md} units.
824
823
  '''
825
824
  u = list(Hausdorff6Tuple._Units_)
826
- u[0] = U = _xUnit(self.units, Float) # PYCHOK expected
825
+ u[0] = U = _unitsBase._xUnit(self.units, Float) # PYCHOK expected
827
826
  u[4] = _Pass if self.md is None else U # PYCHOK expected
828
827
  return _NamedTuple.toUnits(self.reUnit(*u), **Error_name) # PYCHOK self
829
828
 
pygeodesy/heights.py CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
- u'''Height interpolations at C{LatLon} points from C{knots}.
4
+ u'''Height interpolations at C{LatLon} points from known C{knots}.
5
5
 
6
6
  Classes L{HeightCubic}, L{HeightIDWcosineAndoyerLambert},
7
7
  L{HeightIDWcosineForsytheAndoyerLambert}, L{HeightIDWcosineLaw},
@@ -91,7 +91,7 @@ from pygeodesy.units import _isDegrees, Float_, Int_
91
91
  # from math import radians # from .points
92
92
 
93
93
  __all__ = _ALL_LAZY.heights
94
- __version__ = '24.06.03'
94
+ __version__ = '24.06.22'
95
95
 
96
96
  _error_ = 'error'
97
97
  _formy = _MODS.into(formy=__name__)
pygeodesy/internals.py CHANGED
@@ -4,9 +4,9 @@ u'''Mostly INTERNAL functions, except L{machine}, L{print_} and L{printf}.
4
4
  '''
5
5
  # from pygeodesy.basics import isiterablen # _MODS
6
6
  # from pygeodesy.errors import _AttributeError, _error_init, _UnexpectedError, _xError2 # _MODS
7
- from pygeodesy.interns import NN, _COLON_, _DOT_, _ELLIPSIS_, _EQUALSPACED_, \
8
- _immutable_, _NL_, _pygeodesy_, _PyPy__, _python_, \
9
- _QUOTE1_, _QUOTE2_, _s_, _SPACE_, _sys, _UNDER_, _utf_8_
7
+ from pygeodesy.interns import NN, _BAR_, _COLON_, _DASH_, _DOT_, _ELLIPSIS_, _EQUALSPACED_, \
8
+ _immutable_, _NL_, _pygeodesy_, _PyPy__, _python_, _QUOTE1_, \
9
+ _QUOTE2_, _s_, _SPACE_, _sys, _UNDER_, _utf_8_
10
10
  from pygeodesy.interns import _COMMA_, _Python_ # PYCHOK used!
11
11
  # from pygeodesy.streprs import anstr, pairs, unstr # _MODS
12
12
 
@@ -31,6 +31,12 @@ def _dunder_nameof(inst, *dflt):
31
31
  return dflt[0] if dflt else inst.__class__.__name__
32
32
 
33
33
 
34
+ def _dunder_nameof_(*names__): # in .errors._IsnotError
35
+ '''(INTERNAL) Yield the _dunder_nameof or name.
36
+ '''
37
+ return map(_dunder_nameof, names__, names__)
38
+
39
+
34
40
  def _Property_RO(method):
35
41
  '''(INTERNAL) Can't I{recursively} import L{props.property_RO}.
36
42
  '''
@@ -354,10 +360,10 @@ def _passargs(*args):
354
360
  return args
355
361
 
356
362
 
357
- def _plural(noun, n):
363
+ def _plural(noun, n, nn=NN):
358
364
  '''(INTERNAL) Return C{noun}['s'] or C{NN}.
359
365
  '''
360
- return NN(noun, _s_) if n > 1 else (noun if n else NN)
366
+ return NN(noun, _s_) if n > 1 else (noun if n else nn)
361
367
 
362
368
 
363
369
  def print_(*args, **nl_nt_prec_prefix__end_file_flush_sep__kwds): # PYCHOK no cover
@@ -498,17 +504,44 @@ def _under(name): # PYCHOK in .datums, .auxilats, .ups, .utm, .utmupsBase, ...
498
504
  return name if name.startswith(_UNDER_) else NN(_UNDER_, name)
499
505
 
500
506
 
501
- def _usage(file_py, *args): # in .etm
507
+ def _usage(file_py, *args, **opts_help): # in .etm, .geodesici
502
508
  '''(INTERNAL) Build "usage: python -m ..." cmd line for module B{C{file_py}}.
503
509
  '''
504
- m = _os_path.dirname(file_py).replace(_os.getcwd(), _ELLIPSIS_) \
505
- .replace(_os.sep, _DOT_).strip()
506
- b, x = _os_path.splitext(_os_path.basename(file_py))
510
+ if opts_help:
511
+
512
+ def _help(alts=(), help=NN, **unused):
513
+ if alts and help:
514
+ h = NN(help, _SPACE_).lstrip(_DASH_)
515
+ for a in alts:
516
+ if a.startswith(h):
517
+ return NN(_DASH_, a),
518
+
519
+ def _opts(opts=NN, alts=(), **unused):
520
+ # opts='T--v-C-R meter-c|i|n|o'
521
+ d, fmt = NN, _MODS.streprs.Fmt.SQUARE
522
+ for o in (opts + _BAR_(*alts)).split(_DASH_):
523
+ if o:
524
+ yield fmt(NN(d, _DASH_, o.replace(_BAR_, ' | -')))
525
+ d = NN
526
+ else:
527
+ d = _DASH_
528
+
529
+ args = _help(**opts_help) or (tuple(_opts(**opts_help)) + args)
530
+
531
+ u = _COLON_(_dunder_nameof(_usage)[1:], NN)
532
+ return _SPACE_(u, *_usage_argv(file_py, *args))
533
+
534
+
535
+ def _usage_argv(argv0, *args):
536
+ '''(INTERNAL) Return 3-tuple C{(python, '-m', module, *args)}.
537
+ '''
538
+ m = _os_path.dirname(argv0).replace(_os.getcwd(), _ELLIPSIS_) \
539
+ .replace(_os.sep, _DOT_).strip()
540
+ b, x = _os_path.splitext(_os_path.basename(argv0))
507
541
  if x == '.py' and not _dunder_ismain(b):
508
542
  m = _DOT_(m or _pygeodesy_, b)
509
- p = NN(_python_, _sys.version_info[0])
510
- u = _COLON_(_dunder_nameof(_usage)[1:], NN)
511
- return _SPACE_(u, p, '-m', _enquote(m), *args)
543
+ p = NN(_python_, _sys.version_info[0])
544
+ return (p, '-m', _enquote(m)) + args
512
545
 
513
546
 
514
547
  def _version2(version, n=2):
@@ -544,7 +577,7 @@ def _version_ints(vs):
544
577
 
545
578
 
546
579
  __all__ = tuple(map(_dunder_nameof, (machine, print_, printf)))
547
- __version__ = '24.06.05'
580
+ __version__ = '24.07.04'
548
581
 
549
582
  if _dunder_ismain(__name__): # PYCHOK no cover
550
583
 
pygeodesy/interns.py CHANGED
@@ -32,7 +32,7 @@ class _Int(int):
32
32
  class Str_(str):
33
33
  '''Extended, I{callable} C{str} class, not nameable.
34
34
 
35
- @see: Nameable and callable class L{pygeodesy.Str}.
35
+ @see: Nameable and callable class L{Str<pygeodesy.unitsBase.Str>}.
36
36
  '''
37
37
  def join_(self, *args):
38
38
  '''Join all positional B{C{args}} like C{self.join(B{args})}.
@@ -441,7 +441,7 @@ _LR_PAIRS = {_LANGLE_: _RANGLE_,
441
441
 
442
442
  __all__ = (_NN_, # NOT MISSING!
443
443
  Str_.__name__) # classes
444
- __version__ = '24.06.05'
444
+ __version__ = '24.06.14'
445
445
 
446
446
  if __name__ == '__main__':
447
447