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/units.py CHANGED
@@ -6,32 +6,30 @@ C{Str} from basic C{float}, C{int} respectively C{str} to
6
6
  named units as L{Degrees}, L{Feet}, L{Meter}, L{Radians}, etc.
7
7
  '''
8
8
 
9
- from pygeodesy.basics import isinstanceof, isscalar, isstr, issubclassof, \
10
- signOf
11
- from pygeodesy.constants import EPS, EPS1, PI, PI2, PI_2, \
12
- _umod_360, _0_0, _0_001, \
13
- _0_5, INT0 # PYCHOK for .mgrs, .namedTuples
14
- from pygeodesy.dms import F__F, F__F_, parseDMS, parseRad, \
15
- S_NUL, S_SEP, _toDMS, toDMS
16
- from pygeodesy.errors import _AssertionError, _IsnotError, TRFError, \
17
- UnitError, _xkwds, _xkwds_item2
9
+ from pygeodesy.basics import isinstanceof, isscalar, isstr, issubclassof, signOf
10
+ from pygeodesy.constants import EPS, EPS1, PI, PI2, PI_2, _umod_360, _0_0, \
11
+ _0_001, _0_5, INT0 # PYCHOK for .mgrs, .namedTuples
12
+ from pygeodesy.dms import F__F, F__F_, S_NUL, S_SEP, parseDMS, parseRad, \
13
+ _toDMS, toDMS
14
+ from pygeodesy.errors import _AssertionError, _IsnotError, TRFError, UnitError, \
15
+ _xkwds
18
16
  from pygeodesy.interns import NN, _band_, _bearing_, _degrees_, _degrees2_, \
19
- _distance_, _E_, _easting_, _epoch_, _EW_, \
20
- _feet_, _height_, _lam_, _lat_, \
21
- _LatLon_, _lon_, _meter_, _meter2_, _N_, \
22
- _northing_, _NS_, _NSEW_, _number_, _PERCENT_, \
23
- _phi_, _precision_, _radians_, _radians2_, \
24
- _radius_, _S_, _scalar_, _units_, \
25
- _W_, _zone_, _std_ # PYCHOK used!
17
+ _distance_, _E_, _easting_, _epoch_, _EW_, _feet_, \
18
+ _height_, _lam_, _lat_, _LatLon_, _lon_, _meter_, \
19
+ _meter2_, _N_, _northing_, _NS_, _NSEW_, _number_, \
20
+ _PERCENT_, _phi_, _precision_, _radians_, _radians2_, \
21
+ _radius_, _S_, _scalar_, _units_, _W_, _zone_, \
22
+ _std_ # PYCHOK used!
26
23
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, _getenv
27
24
  from pygeodesy.props import Property_RO
28
25
  # from pygeodesy.streprs import Fmt, fstr # from .unitsBase
29
- from pygeodesy.unitsBase import _Error, Float, Fmt, fstr, Int, _NamedUnit, \
30
- Radius, Str # PYCHOK shared .namedTuples
26
+ from pygeodesy.unitsBase import _Error, Float, Fmt, fstr, Int, _arg_name_arg2, \
27
+ _NamedUnit, Radius, Str # PYCHOK shared .namedTuples
28
+
31
29
  from math import degrees, radians
32
30
 
33
31
  __all__ = _ALL_LAZY.units
34
- __version__ = '24.02.20'
32
+ __version__ = '24.05.20'
35
33
 
36
34
  _negative_falsed_ = 'negative, falsed'
37
35
 
@@ -48,15 +46,15 @@ class Float_(Float):
48
46
  @kwarg Error: Optional error to raise, overriding the default L{UnitError}.
49
47
  @kwarg low: Optional lower B{C{arg}} limit (C{float} or C{None}).
50
48
  @kwarg high: Optional upper B{C{arg}} limit (C{float} or C{None}).
51
- @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of B{C{name}}
52
- and B{C{arg}}.
49
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of separate
50
+ B{C{arg}} and B{C{name}} ones.
53
51
 
54
52
  @returns: A C{Float_} instance.
55
53
 
56
54
  @raise Error: Invalid B{C{arg}} or B{C{arg}} below B{C{low}} or above B{C{high}}.
57
55
  '''
58
56
  if name_arg:
59
- name, arg = _xkwds_item2(name_arg)
57
+ name, arg = _arg_name_arg2(arg, **name_arg)
60
58
  self = Float.__new__(cls, arg=arg, name=name, Error=Error)
61
59
  if (low is not None) and self < low:
62
60
  txt = Fmt.limit(below=Fmt.g(low, prec=6, ints=isinstance(self, Epoch)))
@@ -79,15 +77,15 @@ class Int_(Int):
79
77
  @kwarg Error: Optional error to raise, overriding the default C{UnitError}.
80
78
  @kwarg low: Optional lower B{C{arg}} limit (C{int} or C{None}).
81
79
  @kwarg high: Optional upper B{C{arg}} limit (C{int} or C{None}).
82
- @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of B{C{name}}
83
- and B{C{arg}}.
80
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of separate
81
+ B{C{arg}} and B{C{name}} ones.
84
82
 
85
83
  @returns: An L{Int_} instance.
86
84
 
87
85
  @raise Error: Invalid B{C{arg}} or B{C{arg}} below B{C{low}} or above B{C{high}}.
88
86
  '''
89
87
  if name_arg:
90
- name, arg = _xkwds_item2(name_arg)
88
+ name, arg = _arg_name_arg2(arg, **name_arg)
91
89
  self = Int.__new__(cls, arg=arg, name=name, Error=Error)
92
90
  if (low is not None) and self < low:
93
91
  txt = Fmt.limit(below=low)
@@ -120,7 +118,7 @@ class Bool(Int, _NamedUnit):
120
118
  @raise Error: Invalid B{C{arg}}.
121
119
  '''
122
120
  if name_arg:
123
- name, arg = _xkwds_item2(name_arg)
121
+ name, arg = _arg_name_arg2(arg, **name_arg)
124
122
  try:
125
123
  b = bool(arg)
126
124
  except Exception as x: # XXX not ... as x:
@@ -195,7 +193,7 @@ class Degrees(Float):
195
193
  range and L{pygeodesy.rangerrors} set to C{True}.
196
194
  '''
197
195
  if name_arg:
198
- name, arg = _xkwds_item2(name_arg)
196
+ name, arg = _arg_name_arg2(arg, **name_arg)
199
197
  try:
200
198
  d = Float.__new__(cls, parseDMS(arg, suffix=suffix, clip=clip),
201
199
  Error=Error, name=name)
@@ -255,15 +253,15 @@ class Degrees_(Degrees):
255
253
  @kwarg suffix: Optional, valid compass direction suffixes (C{NSEW}).
256
254
  @kwarg low: Optional lower B{C{arg}} limit (C{float} or C{None}).
257
255
  @kwarg high: Optional upper B{C{arg}} limit (C{float} or C{None}).
258
- @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of B{C{name}}
259
- and B{C{arg}}.
256
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of separate
257
+ B{C{arg}} and B{C{name}} ones.
260
258
 
261
259
  @returns: A C{Degrees} instance.
262
260
 
263
261
  @raise Error: Invalid B{C{arg}} or B{C{arg}} below B{C{low}} or above B{C{high}}.
264
262
  '''
265
263
  if name_arg:
266
- name, arg = _xkwds_item2(name_arg)
264
+ name, arg = _arg_name_arg2(arg, **name_arg)
267
265
  self = Degrees.__new__(cls, arg=arg, name=name, Error=Error, suffix=suffix, clip=0)
268
266
  if (low is not None) and self < low:
269
267
  txt = Fmt.limit(below=low)
@@ -297,8 +295,8 @@ class Radians(Float):
297
295
  @kwarg suffix: Optional, valid compass direction suffixes (C{NSEW}).
298
296
  @kwarg clip: Optional B{C{arg}} range B{C{-clip..+clip}} (C{radians} or C{0}
299
297
  or C{None} for unclipped).
300
- @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of B{C{name}}
301
- and B{C{arg}}.
298
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of separate
299
+ B{C{arg}} and B{C{name}} ones.
302
300
 
303
301
  @returns: A C{Radians} instance.
304
302
 
@@ -306,7 +304,7 @@ class Radians(Float):
306
304
  range and L{pygeodesy.rangerrors} set to C{True}.
307
305
  '''
308
306
  if name_arg:
309
- name, arg = _xkwds_item2(name_arg)
307
+ name, arg = _arg_name_arg2(arg, **name_arg)
310
308
  try:
311
309
  return Float.__new__(cls, parseRad(arg, suffix=suffix, clip=clip),
312
310
  Error=Error, name=name)
@@ -326,8 +324,8 @@ class Radians(Float):
326
324
  def toRepr(self, std=False, **prec_fmt_ints): # PYCHOK prec=8, ...
327
325
  '''Return a representation of this C{Radians}.
328
326
 
329
- @kwarg std: If C{True} return the standard C{repr},
330
- otherwise the named representation (C{bool}).
327
+ @kwarg std: If C{True} return the standard C{repr}, otherwise
328
+ the named representation (C{bool}).
331
329
 
332
330
  @see: Methods L{Radians.toStr}, L{Float.toRepr} and function
333
331
  L{pygeodesy.toDMS} for more documentation.
@@ -356,15 +354,15 @@ class Radians_(Radians):
356
354
  @kwarg suffix: Optional, valid compass direction suffixes (C{NSEW}).
357
355
  @kwarg low: Optional lower B{C{arg}} limit (C{float} or C{None}).
358
356
  @kwarg high: Optional upper B{C{arg}} limit (C{float} or C{None}).
359
- @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of B{C{name}}
360
- and B{C{arg}}.
357
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of separate
358
+ B{C{arg}} and B{C{name}} ones.
361
359
 
362
360
  @returns: A C{Radians_} instance.
363
361
 
364
362
  @raise Error: Invalid B{C{arg}} or B{C{arg}} below B{C{low}} or above B{C{high}}.
365
363
  '''
366
364
  if name_arg:
367
- name, arg = _xkwds_item2(name_arg)
365
+ name, arg = _arg_name_arg2(arg, **name_arg)
368
366
  self = Radians.__new__(cls, arg=arg, name=name, Error=Error, suffix=suffix, clip=0)
369
367
  if (low is not None) and self < low:
370
368
  txt = Fmt.limit(below=low)
@@ -394,7 +392,7 @@ class Bearing(Degrees):
394
392
  '''New L{Bearing} instance, see L{Degrees}.
395
393
  '''
396
394
  if name_arg:
397
- name, arg = _xkwds_item2(name_arg)
395
+ name, arg = _arg_name_arg2(arg, **name_arg)
398
396
  d = Degrees.__new__(cls, arg=arg, name=name, Error=Error, suffix=_N_, clip=clip)
399
397
  b = _umod_360(d) # 0 <= b < 360
400
398
  return d if b == d else Degrees.__new__(cls, arg=b, name=name, Error=Error)
@@ -440,15 +438,15 @@ class Easting(Float):
440
438
  @kwarg Error: Optional error to raise, overriding the default L{UnitError}.
441
439
  @kwarg falsed: The B{C{arg}} value includes false origin (C{bool}).
442
440
  @kwarg high: Optional upper B{C{arg}} easting limit (C{scalar} or C{None}).
443
- @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of B{C{name}}
444
- and B{C{arg}}.
441
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of separate
442
+ B{C{arg}} and B{C{name}} ones.
445
443
 
446
444
  @returns: An C{Easting} instance.
447
445
 
448
446
  @raise Error: Invalid B{C{arg}}, above B{C{high}} or negative, falsed B{C{arg}}.
449
447
  '''
450
448
  if name_arg:
451
- name, arg = _xkwds_item2(name_arg)
449
+ name, arg = _arg_name_arg2(arg, **name_arg)
452
450
  self = Float.__new__(cls, arg=arg, name=name, Error=Error)
453
451
  if high and (self < 0 or self > high): # like Veness
454
452
  raise _Error(cls, arg, name, Error)
@@ -467,7 +465,7 @@ class Epoch(Float_): # in .ellipsoidalBase, .trf
467
465
  '''New L{Epoch} instance, see L{Float_}.
468
466
  '''
469
467
  if name_arg:
470
- name, arg = _xkwds_item2(name_arg)
468
+ name, arg = _arg_name_arg2(arg, **name_arg)
471
469
  return arg if isinstance(arg, Epoch) else Float_.__new__(cls,
472
470
  arg=arg, name=name, Error=Error, low=low, high=high)
473
471
 
@@ -515,8 +513,8 @@ class FIx(Float_):
515
513
  @arg fi: The fractional index (C{float} or C{int}).
516
514
  @kwarg fin: Optional C{len}, the number of C{points}, the index
517
515
  C{[n]} wrapped to C{[0]} (C{int} or C{None}).
518
- @kwarg name_Error: Optional keyword argument C{B{name}=NN}
519
- and C{B{Error}=UnitError}.
516
+ @kwarg name_Error: Optional C{B{name}=NN} (C{str}) and keyword
517
+ argument C{B{Error}=UnitError}.
520
518
 
521
519
  @return: The B{C{fi}} (named L{FIx}).
522
520
 
@@ -631,7 +629,7 @@ class Lam_(Lam):
631
629
  '''New L{Lam_} instance, see L{Lam} and L{Radians}.
632
630
  '''
633
631
  if name_arg:
634
- name, arg = _xkwds_item2(name_arg)
632
+ name, arg = _arg_name_arg2(arg, **name_arg)
635
633
  d = Lam.__new__(cls, arg=arg, name=name, Error=Error, clip=clip)
636
634
  return Radians.__new__(cls, radians(d), name=name, Error=Error)
637
635
 
@@ -752,15 +750,15 @@ class Northing(Float):
752
750
  @kwarg Error: Optional error to raise, overriding the default L{UnitError}.
753
751
  @kwarg falsed: The B{C{arg}} value includes false origin (C{bool}).
754
752
  @kwarg high: Optional upper B{C{arg}} northing limit (C{scalar} or C{None}).
755
- @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of B{C{name}}
756
- and B{C{arg}}.
753
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu of separate
754
+ B{C{arg}} and B{C{name}} ones.
757
755
 
758
756
  @returns: A C{Northing} instance.
759
757
 
760
758
  @raise Error: Invalid B{C{arg}}, above B{C{high}} or negative, falsed B{C{arg}}.
761
759
  '''
762
760
  if name_arg:
763
- name, arg = _xkwds_item2(name_arg)
761
+ name, arg = _arg_name_arg2(arg, **name_arg)
764
762
  self = Float.__new__(cls, arg=arg, name=name, Error=Error)
765
763
  if high and (self < 0 or self > high):
766
764
  raise _Error(cls, arg, name, Error)
@@ -794,7 +792,7 @@ class Phi_(Phi):
794
792
  '''New L{Phi_} instance, see L{Phi} and L{Radians}.
795
793
  '''
796
794
  if name_arg:
797
- name, arg = _xkwds_item2(name_arg)
795
+ name, arg = _arg_name_arg2(arg, **name_arg)
798
796
  d = Phi.__new__(cls, arg=arg, name=name, Error=Error, clip=clip)
799
797
  return Radians.__new__(cls, arg=radians(d), name=name, Error=Error)
800
798
 
pygeodesy/unitsBase.py CHANGED
@@ -4,9 +4,9 @@
4
4
  u'''Basic C{Float}, C{Int} and C{Str}ing units classes.
5
5
  '''
6
6
 
7
- from pygeodesy.errors import UnitError, _XError, _xkwds_item2
7
+ from pygeodesy.errors import _UnexpectedError, UnitError, _XError
8
8
  from pygeodesy.interns import NN, _degrees_, _degrees2_, _invalid_, \
9
- _meter_, _radians_, _radians2_, \
9
+ _meter_, MISSING, _radians_, _radians2_, \
10
10
  _radius_, _UNDER_, _std_ # PYCHOK used!
11
11
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY
12
12
  from pygeodesy.named import modulename, _Named, property_doc_
@@ -14,7 +14,7 @@ from pygeodesy.named import modulename, _Named, property_doc_
14
14
  from pygeodesy.streprs import Fmt, fstr
15
15
 
16
16
  __all__ = _ALL_LAZY.unitsBase
17
- __version__ = '24.02.20'
17
+ __version__ = '24.05.20'
18
18
 
19
19
 
20
20
  class _NamedUnit(_Named):
@@ -69,14 +69,14 @@ class Float(float, _NamedUnit):
69
69
  @kwarg Error: Optional error to raise, overriding the default
70
70
  L{UnitError}.
71
71
  @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu
72
- of B{C{name}} and B{C{arg}}.
72
+ of separate B{C{arg}} and B{C{name}} ones.
73
73
 
74
74
  @returns: A C{Float} instance.
75
75
 
76
76
  @raise Error: Invalid B{C{arg}}.
77
77
  '''
78
78
  if name_arg:
79
- name, arg = _xkwds_item2(name_arg)
79
+ name, arg = _arg_name_arg2(arg, **name_arg)
80
80
  try:
81
81
  self = float.__new__(cls, arg)
82
82
  if name:
@@ -146,15 +146,15 @@ class Int(int, _NamedUnit):
146
146
  @kwarg name: Optional instance name (C{str}).
147
147
  @kwarg Error: Optional error to raise, overriding the
148
148
  default L{UnitError}.
149
- @kwarg name_arg: Optional C{name=arg} keyword argument,
150
- inlieu of B{C{name}} and B{C{arg}}.
149
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu
150
+ of separate B{C{arg}} and B{C{name}} ones.
151
151
 
152
152
  @returns: An C{Int} instance.
153
153
 
154
154
  @raise Error: Invalid B{C{arg}}.
155
155
  '''
156
156
  if name_arg:
157
- name, arg = _xkwds_item2(name_arg)
157
+ name, arg = _arg_name_arg2(arg, **name_arg)
158
158
  try:
159
159
  self = int.__new__(cls, arg)
160
160
  if name:
@@ -223,8 +223,8 @@ class Str(str, _NamedUnit):
223
223
  @kwarg name: Optional instance name (C{str}).
224
224
  @kwarg Error: Optional error to raise, overriding the
225
225
  default (C{ValueError}).
226
- @kwarg name_arg: Optional C{name=arg} keyword argument,
227
- inlieu of B{C{name}} and B{C{arg}}.
226
+ @kwarg name_arg: Optional C{name=arg} keyword argument, inlieu
227
+ of separate B{C{arg}} and B{C{name}} ones.
228
228
 
229
229
  @returns: A L{Str} instance.
230
230
 
@@ -233,7 +233,7 @@ class Str(str, _NamedUnit):
233
233
  @see: Callable, not-nameable class L{pygeodesy.Str_}.
234
234
  '''
235
235
  if name_arg:
236
- name, arg = _xkwds_item2(name_arg)
236
+ name, arg = _arg_name_arg2(arg, **name_arg)
237
237
  try:
238
238
  self = str.__new__(cls, arg)
239
239
  if name:
@@ -324,6 +324,19 @@ def _Error(clas, arg, name, Error, txt=_invalid_, x=None):
324
324
  return _XError(Error, n, arg, txt=txt, cause=x)
325
325
 
326
326
 
327
+ def _arg_name_arg2(arg, name__=None, **name_arg): # in .units
328
+ '''(INTERNAL) Get the 2-tuple C{(name, arg)}.
329
+ '''
330
+ if name__ is None:
331
+ t = name_arg.popitem() if len(name_arg) == 1 else \
332
+ (MISSING, arg)
333
+ else:
334
+ t = name__.__name__, arg
335
+ if name_arg:
336
+ raise _UnexpectedError(**name_arg)
337
+ return t
338
+
339
+
327
340
  __all__ += _ALL_DOCS(_NamedUnit)
328
341
 
329
342
  # **) MIT License
pygeodesy/ups.py CHANGED
@@ -28,11 +28,12 @@ from pygeodesy.datums import _ellipsoidal_datum, _WGS84
28
28
  from pygeodesy.dms import degDMS, _neg, parseDMS2
29
29
  from pygeodesy.errors import RangeError, _ValueError
30
30
  from pygeodesy.fmath import hypot, hypot1, sqrt0
31
- from pygeodesy.interns import NN, _COMMASPACE_, _inside_, _N_, _pole_, \
32
- _range_, _S_, _scale0_, _SPACE_, _std_, \
33
- _to_, _UTM_, _under
34
- from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _getenv
35
- from pygeodesy.named import nameof, _xnamed
31
+ # from pygeodesy.internals import _under # from .named
32
+ from pygeodesy.interns import NN, _COMMASPACE_, _inside_, _N_, \
33
+ _pole_, _range_, _S_, _scale0_, \
34
+ _SPACE_, _std_, _to_, _UTM_
35
+ from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _getenv
36
+ from pygeodesy.named import nameof, _xnamed, _under
36
37
  from pygeodesy.namedTuples import EasNor2Tuple, UtmUps5Tuple, \
37
38
  UtmUps8Tuple, UtmUpsLatLon5Tuple
38
39
  from pygeodesy.props import deprecated_method, property_doc_, \
@@ -48,7 +49,7 @@ from pygeodesy.utmupsBase import Fmt, _LLEB, _hemi, _parseUTMUPS5, _to4lldn, \
48
49
  from math import atan2, fabs, radians, tan
49
50
 
50
51
  __all__ = _ALL_LAZY.ups
51
- __version__ = '23.09.29'
52
+ __version__ = '25.05.13'
52
53
 
53
54
  _BZ_UPS = _getenv('PYGEODESY_UPS_POLES', _std_) == _std_
54
55
  _Falsing = Meter(2000e3) # false easting and northing (C{meter})
pygeodesy/utily.py CHANGED
@@ -10,8 +10,7 @@ U{Vector-based geodesy<https://www.Movable-Type.co.UK/scripts/latlong-vectors.ht
10
10
  # make sure int/int division yields float quotient, see .basics
11
11
  from __future__ import division as _; del _ # PYCHOK semicolon
12
12
 
13
- from pygeodesy.basics import _copysign, isinstanceof, isint, isstr, neg, \
14
- _passargs
13
+ from pygeodesy.basics import _copysign, isinstanceof, isint, isstr, neg
15
14
  from pygeodesy.constants import EPS, EPS0, INF, NAN, PI, PI2, PI_2, R_M, \
16
15
  _M_KM, _M_NM, _M_SM, _0_0, _1__90, _0_5, _1_0, \
17
16
  _N_1_0, _2__PI, _10_0, _90_0, _N_90_0, _180_0, \
@@ -19,6 +18,7 @@ from pygeodesy.constants import EPS, EPS0, INF, NAN, PI, PI2, PI_2, R_M, \
19
18
  _float as _F, _isfinite, isnan, isnear0, \
20
19
  _over, _umod_360, _umod_PI2
21
20
  from pygeodesy.errors import _ValueError, _xkwds, _xkwds_get, _ALL_LAZY, _MODS
21
+ from pygeodesy.internals import _passargs # , _MODS?
22
22
  from pygeodesy.interns import _edge_, _radians_, _semi_circular_, _SPACE_
23
23
  # from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS # from .errors
24
24
  from pygeodesy.units import Degrees, Degrees_, Feet, Float, Lam, Lam_, \
@@ -27,7 +27,7 @@ from pygeodesy.units import Degrees, Degrees_, Feet, Float, Lam, Lam_, \
27
27
  from math import acos, asin, atan2, cos, degrees, fabs, radians, sin, tan # pow
28
28
 
29
29
  __all__ = _ALL_LAZY.utily
30
- __version__ = '24.04.04'
30
+ __version__ = '24.05.14'
31
31
 
32
32
  # read constant name "_M_Unit" as "meter per Unit"
33
33
  _M_CHAIN = _F( 20.1168) # yard2m(1) * 22
@@ -907,7 +907,7 @@ def truncate(x, ndigits=None):
907
907
  '''
908
908
  if isint(ndigits):
909
909
  p = _10_0**ndigits
910
- x = int(x * p) / p
910
+ x = int(x * p) / p
911
911
  return x
912
912
 
913
913