pygeodesy 24.5.15__py2.py3-none-any.whl → 24.5.24__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.5.24.dist-info/RECORD +116 -0
  3. pygeodesy/__init__.py +1 -1
  4. pygeodesy/albers.py +41 -41
  5. pygeodesy/auxilats/__init__.py +1 -1
  6. pygeodesy/auxilats/auxAngle.py +32 -31
  7. pygeodesy/auxilats/auxLat.py +80 -51
  8. pygeodesy/azimuthal.py +123 -124
  9. pygeodesy/basics.py +8 -6
  10. pygeodesy/booleans.py +11 -12
  11. pygeodesy/cartesianBase.py +25 -23
  12. pygeodesy/clipy.py +3 -3
  13. pygeodesy/css.py +50 -42
  14. pygeodesy/datums.py +42 -41
  15. pygeodesy/dms.py +6 -6
  16. pygeodesy/ecef.py +23 -24
  17. pygeodesy/ellipsoidalBase.py +28 -27
  18. pygeodesy/ellipsoidalBaseDI.py +3 -4
  19. pygeodesy/ellipsoidalNvector.py +11 -12
  20. pygeodesy/ellipsoids.py +41 -35
  21. pygeodesy/elliptic.py +3 -4
  22. pygeodesy/epsg.py +4 -3
  23. pygeodesy/errors.py +34 -12
  24. pygeodesy/etm.py +62 -54
  25. pygeodesy/fmath.py +36 -30
  26. pygeodesy/formy.py +93 -65
  27. pygeodesy/frechet.py +117 -102
  28. pygeodesy/fstats.py +21 -14
  29. pygeodesy/fsums.py +67 -57
  30. pygeodesy/gars.py +10 -9
  31. pygeodesy/geodesicw.py +19 -17
  32. pygeodesy/geodesicx/__init__.py +1 -1
  33. pygeodesy/geodesicx/gx.py +40 -32
  34. pygeodesy/geodesicx/gxarea.py +12 -9
  35. pygeodesy/geodesicx/gxbases.py +3 -4
  36. pygeodesy/geodesicx/gxline.py +6 -8
  37. pygeodesy/geodsolve.py +28 -27
  38. pygeodesy/geohash.py +47 -44
  39. pygeodesy/geoids.py +34 -32
  40. pygeodesy/hausdorff.py +112 -99
  41. pygeodesy/heights.py +134 -127
  42. pygeodesy/internals.py +14 -9
  43. pygeodesy/interns.py +3 -6
  44. pygeodesy/iters.py +19 -17
  45. pygeodesy/karney.py +15 -12
  46. pygeodesy/ktm.py +25 -18
  47. pygeodesy/latlonBase.py +12 -11
  48. pygeodesy/lazily.py +4 -4
  49. pygeodesy/lcc.py +24 -25
  50. pygeodesy/ltp.py +83 -71
  51. pygeodesy/ltpTuples.py +7 -5
  52. pygeodesy/mgrs.py +3 -3
  53. pygeodesy/named.py +126 -42
  54. pygeodesy/namedTuples.py +33 -25
  55. pygeodesy/nvectorBase.py +7 -7
  56. pygeodesy/points.py +9 -9
  57. pygeodesy/rhumb/__init__.py +1 -1
  58. pygeodesy/solveBase.py +5 -5
  59. pygeodesy/sphericalTrigonometry.py +5 -5
  60. pygeodesy/streprs.py +5 -5
  61. pygeodesy/trf.py +5 -5
  62. pygeodesy/triaxials.py +67 -63
  63. pygeodesy/units.py +35 -35
  64. pygeodesy/unitsBase.py +24 -11
  65. pygeodesy/utm.py +53 -53
  66. pygeodesy/utmupsBase.py +10 -8
  67. pygeodesy/vector2d.py +6 -7
  68. pygeodesy/vector3d.py +16 -17
  69. pygeodesy/vector3dBase.py +4 -5
  70. PyGeodesy-24.5.15.dist-info/RECORD +0 -116
  71. {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/WHEEL +0 -0
  72. {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/top_level.txt +0 -0
pygeodesy/frechet.py CHANGED
@@ -84,12 +84,13 @@ than the well-known C{Hausdorff} distance, see the L{hausdorff} module.
84
84
  # from pygeodesy.basics import isscalar # from .points
85
85
  from pygeodesy.constants import EPS, EPS1, INF, NINF
86
86
  from pygeodesy.datums import _ellipsoidal_datum, _WGS84
87
- from pygeodesy.errors import PointsError, _xattr, _xcallable, _xkwds, _xkwds_get
87
+ from pygeodesy.errors import PointsError, _xattr, _xcallable, _xkwds, \
88
+ _xkwds_get
88
89
  import pygeodesy.formy as _formy
89
90
  from pygeodesy.interns import NN, _DOT_, _n_, _units_
90
91
  # from pygeodesy.iters import points2 as _points2 # from .points
91
92
  from pygeodesy.lazily import _ALL_LAZY, _FOR_DOCS
92
- from pygeodesy.named import _Named, _NamedTuple, _Pass
93
+ from pygeodesy.named import _name2__, _Named, _NamedTuple, _Pass
93
94
  # from pygeodesy.namedTuples import PhiLam2Tuple # from .points
94
95
  from pygeodesy.points import _distanceTo, _fractional, isscalar, \
95
96
  PhiLam2Tuple, points2 as _points2, radians
@@ -102,7 +103,7 @@ from collections import defaultdict as _defaultdict
102
103
  # from math import radians # from .points
103
104
 
104
105
  __all__ = _ALL_LAZY.frechet
105
- __version__ = '24.04.07'
106
+ __version__ = '24.05.24'
106
107
 
107
108
 
108
109
  def _fraction(fraction, n):
@@ -128,36 +129,37 @@ class Frechet(_Named):
128
129
  be overloaded.
129
130
  '''
130
131
  _datum = _WGS84
131
- _func = None # formy function
132
+ _func = None # formy function/property
132
133
  _f1 = 1
133
134
  _kwds = {} # func_ options
134
135
  _n1 = 0
135
136
  _ps1 = None
136
137
  _units = _Str_NN # XXX Str to _Pass and for backward compatibility
137
138
 
138
- def __init__(self, point1s, fraction=None, name=NN, units=NN, **kwds):
139
+ def __init__(self, point1s, fraction=None, units=NN, **name__kwds):
139
140
  '''New C{Frechet...} calculator/interpolator.
140
141
 
141
142
  @arg point1s: First set of points (C{LatLon}[], L{Numpy2LatLon}[],
142
143
  L{Tuple2LatLon}[] or C{other}[]).
143
144
  @kwarg fraction: Index fraction (C{float} in L{EPS}..L{EPS1}) to
144
- interpolate intermediate B{C{point1s}} or use
145
- C{None}, C{0} or C{1} for no intermediate
146
- B{C{point1s}} and no I{fractional} indices.
147
- @kwarg name: Optional calculator/interpolator name (C{str}).
145
+ interpolate intermediate B{C{point1s}} or use C{None},
146
+ C{0} or C{1} for no intermediate B{C{point1s}} and no
147
+ I{fractional} indices.
148
148
  @kwarg units: Optional distance units (C{Unit} or C{str}).
149
- @kwarg kwds: Optional keyword argument for distance function,
149
+ @kwarg name__kwds: Optional C{B{name}=NN} for this calculator/interpolator
150
+ (C{str}) and any keyword arguments for the distance function,
150
151
  retrievable with property C{kwds}.
151
152
 
152
- @raise FrechetError: Insufficient number of B{C{point1s}} or
153
- an invalid B{C{point1}}, B{C{fraction}}
154
- or B{C{units}}.
153
+ @raise FrechetError: Insufficient number of B{C{point1s}} or an invalid
154
+ B{C{point1}}, B{C{fraction}} or B{C{units}}.
155
155
  '''
156
+ name, kwds = _name2__(**name__kwds) # name__=self.__class__
157
+ if name:
158
+ self.name = name
159
+
156
160
  self._n1, self._ps1 = self._points2(point1s)
157
161
  if fraction:
158
162
  self.fraction = fraction
159
- if name:
160
- self.name = name
161
163
  if units: # and not self.units:
162
164
  self.units = units
163
165
  if kwds:
@@ -246,9 +248,18 @@ class Frechet(_Named):
246
248
  '''
247
249
  self._f1 = _fraction(fraction, self._n1)
248
250
 
249
- def _func(self, *args, **kwds): # PYCHOK no cover
251
+ # def _func(self, *args, **kwds): # PYCHOK no cover
252
+ # '''(INTERNAL) I{Must be overloaded}.'''
253
+ # self._notOverloaded(*args, **kwds)
254
+
255
+ @property
256
+ def _func(self):
250
257
  '''(INTERNAL) I{Must be overloaded}.'''
251
- self._notOverloaded(*args, **kwds)
258
+ return _formy._Propy(self, 0, _func=None)
259
+
260
+ @_func.setter # PYCHOK setter!
261
+ def _func(self, func):
262
+ _formy._Propy(self, 4, _func=func)
252
263
 
253
264
  @property_RO
254
265
  def kwds(self):
@@ -371,26 +382,31 @@ class _FrechetMeterRadians(Frechet):
371
382
  '''
372
383
  return self._discrete(point2s, fraction, _formy._radistance(self))
373
384
 
374
- def _func_(self, *args, **kwds): # PYCHOK no cover
385
+ @property
386
+ def _func_(self):
375
387
  '''(INTERNAL) I{Must be overloaded}.'''
376
- self._notOverloaded(*args, **kwds)
388
+ return _formy._Propy(self, 0, _func_=None)
389
+
390
+ @_func_.setter # PYCHOK setter!
391
+ def _func_(self, func):
392
+ _formy._Propy(self, 3, _func_=func)
377
393
 
378
394
 
379
395
  class FrechetCosineAndoyerLambert(_FrechetMeterRadians):
380
396
  '''Compute the C{Frechet} distance based on the I{angular} distance
381
397
  in C{radians} from function L{pygeodesy.cosineAndoyerLambert}.
382
398
  '''
383
- def __init__(self, point1s, fraction=None, name=NN, **datum_wrap):
399
+ def __init__(self, point1s, **fraction_name__datum_wrap):
384
400
  '''New L{FrechetCosineAndoyerLambert} calculator/interpolator.
385
401
 
386
- @kwarg datum_wrap: Optional keyword arguments for function
387
- L{pygeodesy.cosineAndoyerLambert}.
402
+ @kwarg fraction_name__datum_wrap: Optional C{B{fraction}=None}
403
+ and C{B{name}=NN} and keyword arguments for
404
+ function L{pygeodesy.cosineAndoyerLambert}.
388
405
 
389
406
  @see: L{Frechet.__init__} for details about B{C{point1s}},
390
407
  B{C{fraction}}, B{C{name}} and other exceptions.
391
408
  '''
392
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
393
- **datum_wrap)
409
+ Frechet.__init__(self, point1s, **fraction_name__datum_wrap)
394
410
  self._func = _formy.cosineAndoyerLambert
395
411
  self._func_ = _formy.cosineAndoyerLambert_
396
412
 
@@ -402,17 +418,17 @@ class FrechetCosineForsytheAndoyerLambert(_FrechetMeterRadians):
402
418
  '''Compute the C{Frechet} distance based on the I{angular} distance
403
419
  in C{radians} from function L{pygeodesy.cosineForsytheAndoyerLambert}.
404
420
  '''
405
- def __init__(self, point1s, fraction=None, name=NN, **datum_wrap):
421
+ def __init__(self, point1s, **fraction_name__datum_wrap):
406
422
  '''New L{FrechetCosineForsytheAndoyerLambert} calculator/interpolator.
407
423
 
408
- @kwarg datum_wrap: Optional keyword arguments for function
409
- L{pygeodesy.cosineAndoyerLambert}.
424
+ @kwarg fraction_name__datum_wrap: Optional C{B{fraction}=None} and
425
+ C{B{name}=NN} and keyword arguments for function
426
+ L{pygeodesy.cosineForsytheAndoyerLambert}.
410
427
 
411
428
  @see: L{Frechet.__init__} for details about B{C{point1s}},
412
429
  B{C{fraction}}, B{C{name}} and other exceptions.
413
430
  '''
414
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
415
- **datum_wrap)
431
+ Frechet.__init__(self, point1s, **fraction_name__datum_wrap)
416
432
  self._func = _formy.cosineForsytheAndoyerLambert
417
433
  self._func_ = _formy.cosineForsytheAndoyerLambert_
418
434
 
@@ -426,17 +442,17 @@ class FrechetCosineLaw(_FrechetMeterRadians):
426
442
 
427
443
  @note: See note at function L{pygeodesy.vincentys_}.
428
444
  '''
429
- def __init__(self, point1s, fraction=None, name=NN, **radius_wrap):
445
+ def __init__(self, point1s, **fraction_name__radius_wrap):
430
446
  '''New L{FrechetCosineLaw} calculator/interpolator.
431
447
 
432
- @kwarg radius_wrap: Optional keyword arguments for function
433
- L{pygeodesy.cosineLaw}.
448
+ @kwarg fraction_name__radius_wrap: Optional C{B{fraction}=None}
449
+ and C{B{name}=NN} and keyword arguments
450
+ for function L{pygeodesy.cosineLaw}.
434
451
 
435
452
  @see: L{Frechet.__init__} for details about B{C{point1s}},
436
453
  B{C{fraction}}, B{C{name}} and other exceptions.
437
454
  '''
438
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
439
- **radius_wrap)
455
+ Frechet.__init__(self, point1s, **fraction_name__radius_wrap)
440
456
  self._func = _formy.cosineLaw
441
457
  self._func_ = _formy.cosineLaw_
442
458
 
@@ -450,21 +466,20 @@ class FrechetDistanceTo(Frechet): # FrechetMeter
450
466
  '''
451
467
  _units = _Str_meter
452
468
 
453
- def __init__(self, point1s, fraction=None, name=NN, **distanceTo_kwds):
469
+ def __init__(self, point1s, **fraction_name__distanceTo_kwds):
454
470
  '''New L{FrechetDistanceTo} calculator/interpolator.
455
471
 
456
- @kwarg distanceTo_kwds: Optional keyword arguments for each
457
- B{C{point1s}}' C{LatLon.distanceTo}
458
- method.
472
+ @kwarg fraction_name__distanceTo_kwds: Optional C{B{fraction}=None}
473
+ and C{B{name}=NN} and keyword arguments for
474
+ each B{C{point1s}}' C{LatLon.distanceTo} method.
459
475
 
460
- @see: L{Frechet.__init__} for details about B{C{point1s}},
461
- B{C{fraction}}, B{C{name}} and other exceptions.
476
+ @see: L{Frechet.__init__} for details about B{C{point1s}}, B{C{fraction}},
477
+ B{C{name}} and other exceptions.
462
478
 
463
- @note: All B{C{point1s}} I{must} be instances of the same
464
- ellipsoidal or spherical C{LatLon} class.
479
+ @note: All B{C{point1s}} I{must} be instances of the same ellipsoidal
480
+ or spherical C{LatLon} class.
465
481
  '''
466
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
467
- **distanceTo_kwds)
482
+ Frechet.__init__(self, point1s, **fraction_name__distanceTo_kwds)
468
483
 
469
484
  if _FOR_DOCS:
470
485
  discrete = Frechet.discrete
@@ -487,19 +502,19 @@ class FrechetEquirectangular(Frechet):
487
502
  '''
488
503
  _units = _Str_radians2
489
504
 
490
- def __init__(self, point1s, fraction=None, name=NN, **adjust_limit_wrap):
505
+ def __init__(self, point1s, **fraction_name__adjust_limit_wrap):
491
506
  '''New L{FrechetEquirectangular} calculator/interpolator.
492
507
 
493
- @kwarg adjust_limit_wrap: Optional keyword arguments for function
494
- L{pygeodesy.equirectangular_} I{with default}
495
- C{B{limit}=0} for I{backward compatibility}.
508
+ @kwarg fraction_name__adjust_limit_wrap: Optional C{B{fraction}=None}
509
+ and C{B{name}=NN} and keyword arguments for
510
+ function L{pygeodesy.equirectangular_} I{with
511
+ default} C{B{limit}=0} for I{backward compatibility}.
496
512
 
497
- @see: L{Frechet.__init__} for details about B{C{point1s}},
498
- B{C{fraction}}, B{C{name}} and other exceptions.
513
+ @see: L{Frechet.__init__} for details about B{C{point1s}}, B{C{fraction}},
514
+ B{C{name}} and other exceptions.
499
515
  '''
500
- adjust_limit_wrap = _xkwds(adjust_limit_wrap, limit=0)
501
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
502
- **adjust_limit_wrap)
516
+ Frechet.__init__(self, point1s, **_xkwds(fraction_name__adjust_limit_wrap,
517
+ limit=0))
503
518
  self._func = _formy._equirectangular # helper
504
519
 
505
520
  if _FOR_DOCS:
@@ -510,17 +525,17 @@ class FrechetEuclidean(_FrechetMeterRadians):
510
525
  '''Compute the C{Frechet} distance based on the I{Euclidean}
511
526
  distance in C{radians} from function L{pygeodesy.euclidean}.
512
527
  '''
513
- def __init__(self, point1s, fraction=None, name=NN, **adjust_radius_wrap): # was=True
528
+ def __init__(self, point1s, **fraction_name__adjust_radius_wrap): # was=True
514
529
  '''New L{FrechetEuclidean} calculator/interpolator.
515
530
 
516
- @kwarg adjust_radius_wrap: Optional keyword arguments for
517
- function L{pygeodesy.euclidean}.
531
+ @kwarg fraction_name__adjust_radius_wrap: Optional C{B{fraction}=None}
532
+ and C{B{name}=NN} and keyword arguments for
533
+ function L{pygeodesy.euclidean}.
518
534
 
519
- @see: L{Frechet.__init__} for details about B{C{point1s}},
520
- B{C{fraction}}, B{C{name}} and other exceptions.
535
+ @see: L{Frechet.__init__} for details about B{C{point1s}}, B{C{fraction}},
536
+ B{C{name}} and other exceptions.
521
537
  '''
522
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
523
- **adjust_radius_wrap)
538
+ Frechet.__init__(self, point1s, **fraction_name__adjust_radius_wrap)
524
539
  self._func = _formy.euclidean
525
540
  self._func_ = _formy.euclidean_
526
541
 
@@ -534,22 +549,22 @@ class FrechetExact(Frechet):
534
549
  '''
535
550
  _units = _Str_degrees
536
551
 
537
- def __init__(self, point1s, fraction=None, name=NN, datum=None, **wrap):
552
+ def __init__(self, point1s, datum=None, **fraction_name__wrap):
538
553
  '''New L{FrechetExact} calculator/interpolator.
539
554
 
540
- @kwarg datum: Datum to override the default C{Datums.WGS84} and
541
- first B{C{point1s}}' datum (L{Datum}, L{Ellipsoid},
542
- L{Ellipsoid2} or L{a_f2Tuple}).
543
- @kwarg wrap: Optional keyword argument for method C{Inverse1}
544
- of class L{geodesicx.GeodesicExact}.
555
+ @kwarg datum: Datum to override the default C{Datums.WGS84} and first
556
+ B{C{point1s}}' datum (L{Datum}, L{Ellipsoid}, L{Ellipsoid2}
557
+ or L{a_f2Tuple}).
558
+ @kwarg fraction_name__wrap: Optional C{B{fraction}=None} and C{B{name}=NN}
559
+ and keyword argument for method C{Inverse1} of class
560
+ L{geodesicx.GeodesicExact}.
545
561
 
546
562
  @raise TypeError: Invalid B{C{datum}}.
547
563
 
548
- @see: L{Frechet.__init__} for details about B{C{point1s}},
549
- B{C{fraction}}, B{C{name}} and other exceptions.
564
+ @see: L{Frechet.__init__} for details about B{C{point1s}}, B{C{fraction}},
565
+ B{C{name}} and other exceptions.
550
566
  '''
551
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
552
- **wrap)
567
+ Frechet.__init__(self, point1s, **fraction_name__wrap)
553
568
  self._datum_setter(datum)
554
569
  self._func = self.datum.ellipsoid.geodesicx.Inverse1 # note -x
555
570
 
@@ -563,19 +578,19 @@ class FrechetFlatLocal(_FrechetMeterRadians):
563
578
  '''
564
579
  _units_ = _Str_radians2 # see L{flatLocal_}
565
580
 
566
- def __init__(self, point1s, fraction=None, name=NN, **datum_scaled_wrap):
581
+ def __init__(self, point1s, **fraction_name__datum_scaled_wrap):
567
582
  '''New L{FrechetFlatLocal}/L{FrechetHubeny} calculator/interpolator.
568
583
 
569
- @kwarg datum_scaled_wrap: Optional keyword arguments for
570
- function L{pygeodesy.flatLocal}.
584
+ @kwarg fraction_name__datum_scaled_wrap: Optional C{B{fraction}=None}
585
+ and C{B{name}=NN} and keyword arguments for
586
+ function L{pygeodesy.flatLocal}.
571
587
 
572
- @see: L{Frechet.__init__} for details about B{C{point1s}},
573
- B{C{fraction}}, B{C{name}} and other exceptions.
588
+ @see: L{Frechet.__init__} for details about B{C{point1s}}, B{C{fraction}},
589
+ B{C{name}} and other exceptions.
574
590
 
575
591
  @note: The distance C{units} are C{radians squared}, not C{radians}.
576
592
  '''
577
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
578
- **datum_scaled_wrap)
593
+ Frechet.__init__(self, point1s, **fraction_name__datum_scaled_wrap)
579
594
  self._func = _formy.flatLocal
580
595
  self._func_ = self.datum.ellipsoid._hubeny_2
581
596
 
@@ -587,17 +602,17 @@ class FrechetFlatPolar(_FrechetMeterRadians):
587
602
  '''Compute the C{Frechet} distance based on the I{angular} distance
588
603
  in C{radians} from function L{flatPolar_}.
589
604
  '''
590
- def __init__(self, point1s, fraction=None, name=NN, **radius_wrap):
605
+ def __init__(self, point1s, **fraction_name__radius_wrap):
591
606
  '''New L{FrechetFlatPolar} calculator/interpolator.
592
607
 
593
- @kwarg radius_wrap: Optional keyword arguments for function
594
- L{pygeodesy.flatPolar}.
608
+ @kwarg fraction_name__radius_wrap: Optional C{B{fraction}=None}
609
+ and C{B{name}=NN} and keyword arguments
610
+ for function L{pygeodesy.flatPolar}.
595
611
 
596
612
  @see: L{Frechet.__init__} for details about B{C{point1s}},
597
613
  B{C{fraction}}, B{C{name}} and other exceptions.
598
614
  '''
599
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
600
- **radius_wrap)
615
+ Frechet.__init__(self, point1s, **fraction_name__radius_wrap)
601
616
  self._func = _formy.flatPolar
602
617
  self._func_ = _formy.flatPolar_
603
618
 
@@ -611,17 +626,17 @@ class FrechetHaversine(_FrechetMeterRadians):
611
626
 
612
627
  @note: See note at function L{pygeodesy.vincentys_}.
613
628
  '''
614
- def __init__(self, point1s, fraction=None, name=NN, **radius_wrap):
629
+ def __init__(self, point1s, **fraction_name__radius_wrap):
615
630
  '''New L{FrechetHaversine} calculator/interpolator.
616
631
 
617
- @kwarg radius_wrap: Optional keyword arguments for function
618
- L{pygeodesy.haversine}.
632
+ @kwarg fraction_name__radius_wrap: Optional C{B{fraction}=None}
633
+ and C{B{name}=NN} and keyword arguments
634
+ for function L{pygeodesy.haversine}.
619
635
 
620
636
  @see: L{Frechet.__init__} for details about B{C{point1s}},
621
637
  B{C{fraction}}, B{C{name}} and other exceptions.
622
638
  '''
623
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
624
- **radius_wrap)
639
+ Frechet.__init__(self, point1s, **fraction_name__radius_wrap)
625
640
  self._func = _formy.haversine
626
641
  self._func_ = _formy.haversine_
627
642
 
@@ -646,14 +661,15 @@ class FrechetKarney(Frechet):
646
661
  '''
647
662
  _units = _Str_degrees
648
663
 
649
- def __init__(self, point1s, fraction=None, name=NN, datum=None, **wrap):
664
+ def __init__(self, point1s, datum=None, **fraction_name__wrap):
650
665
  '''New L{FrechetKarney} calculator/interpolator.
651
666
 
652
667
  @kwarg datum: Datum to override the default C{Datums.WGS84} and
653
668
  first B{C{knots}}' datum (L{Datum}, L{Ellipsoid},
654
669
  L{Ellipsoid2} or L{a_f2Tuple}).
655
- @kwarg wrap: Optional keyword argument for method C{Inverse1}
656
- of class L{geodesicw.Geodesic}.
670
+ @kwarg fraction_name__wrap: Optional C{B{fraction}=None} and
671
+ C{B{name}=NN} and keyword arguments for
672
+ method C{Inverse1} of class L{geodesicw.Geodesic}.
657
673
 
658
674
  @raise ImportError: Package U{geographiclib
659
675
  <https://PyPI.org/project/geographiclib>} missing.
@@ -663,8 +679,7 @@ class FrechetKarney(Frechet):
663
679
  @see: L{Frechet.__init__} for details about B{C{point1s}},
664
680
  B{C{fraction}}, B{C{name}} and other exceptions.
665
681
  '''
666
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
667
- **wrap)
682
+ Frechet.__init__(self, point1s, **fraction_name__wrap)
668
683
  self._datum_setter(datum)
669
684
  self._func = self.datum.ellipsoid.geodesic.Inverse1
670
685
 
@@ -676,17 +691,17 @@ class FrechetThomas(_FrechetMeterRadians):
676
691
  '''Compute the C{Frechet} distance based on the I{angular} distance
677
692
  in C{radians} from function L{pygeodesy.thomas_}.
678
693
  '''
679
- def __init__(self, point1s, fraction=None, name=NN, **datum_wrap):
694
+ def __init__(self, point1s, **fraction_name__datum_wrap):
680
695
  '''New L{FrechetThomas} calculator/interpolator.
681
696
 
682
- @kwarg datum_wrap: Optional keyword argument for function
683
- L{pygeodesy.thomas}.
697
+ @kwarg fraction_name__datum_wrap: Optional C{B{fraction}=None}
698
+ and C{B{name}=NN} and keyword arguments
699
+ for function L{pygeodesy.thomas}.
684
700
 
685
701
  @see: L{Frechet.__init__} for details about B{C{point1s}},
686
702
  B{C{fraction}}, B{C{name}} and other exceptions.
687
703
  '''
688
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
689
- **datum_wrap)
704
+ Frechet.__init__(self, point1s, **fraction_name__datum_wrap)
690
705
  self._func = _formy.thomas
691
706
  self._func_ = _formy.thomas_
692
707
 
@@ -700,17 +715,17 @@ class FrechetVincentys(_FrechetMeterRadians):
700
715
 
701
716
  @note: See note at function L{pygeodesy.vincentys_}.
702
717
  '''
703
- def __init__(self, point1s, fraction=None, name=NN, **radius_wrap):
718
+ def __init__(self, point1s, **fraction_name__radius_wrap):
704
719
  '''New L{FrechetVincentys} calculator/interpolator.
705
720
 
706
- @kwarg radius_wrap: Optional keyword arguments for function
707
- L{pygeodesy.vincentys}.
721
+ @kwarg fraction_name__radius_wrap: Optional C{B{fraction}=None}
722
+ and C{B{name}=NN} and keyword arguments
723
+ for function L{pygeodesy.vincentys}.
708
724
 
709
725
  @see: L{Frechet.__init__} for details about B{C{point1s}},
710
726
  B{C{fraction}}, B{C{name}} and other exceptions.
711
727
  '''
712
- Frechet.__init__(self, point1s, fraction=fraction, name=name,
713
- **radius_wrap)
728
+ Frechet.__init__(self, point1s, **fraction_name__radius_wrap)
714
729
  self._func = _formy.vincentys
715
730
  self._func_ = _formy.vincentys_
716
731
 
pygeodesy/fstats.py CHANGED
@@ -13,14 +13,15 @@ from pygeodesy.constants import _0_0, _1_0, _2_0, _3_0, _4_0, _6_0
13
13
  from pygeodesy.errors import _AssertionError, _ValueError, _xError
14
14
  from pygeodesy.fmath import Fsqrt, Fmt
15
15
  from pygeodesy.fsums import _2finite, Fsum, _iadd_op_, _isFsumTuple
16
- from pygeodesy.interns import NN, _odd_, _SPACE_
16
+ from pygeodesy.interns import _odd_, _SPACE_
17
17
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY
18
- from pygeodesy.named import _Named, _NotImplemented, property_RO
18
+ from pygeodesy.named import _name__, _Named, _NotImplemented, \
19
+ property_RO
19
20
  # from pygeodesy.props import property_RO # from .named
20
21
  # from pygeodesy.streprs import Fmt # from .fmath
21
22
 
22
23
  __all__ = _ALL_LAZY.fstats
23
- __version__ = '24.05.10'
24
+ __version__ = '24.05.21'
24
25
 
25
26
 
26
27
  def _2Floats(**xs):
@@ -86,10 +87,14 @@ class _FstatsNamed(_Named):
86
87
  n = _SPACE_(self.classname, n) if n else self.classname
87
88
  return Fmt.SQUARE(n, len(self))
88
89
 
89
- def copy(self, deep=False, name=NN):
90
+ def copy(self, deep=False, **name):
90
91
  '''Copy this instance, C{shallow} or B{C{deep}}.
92
+
93
+ @kwarg name: Optional, overriding C{B{name}="copy"} (C{str}).
94
+
95
+ @return: The copy instance.
91
96
  '''
92
- n = name or self.copy.__name__
97
+ n = _name__(name, name__=self.copy)
93
98
  f = _Named.copy(self, deep=deep, name=n)
94
99
  return self._copy(f, self) # PYCHOK expected
95
100
 
@@ -234,12 +239,12 @@ class Fcook(_FstatsBase):
234
239
  @see: L{Fwelford} and U{Higher-order statistics<https://
235
240
  WikiPedia.org/wiki/Algorithms_for_calculating_variance>}.
236
241
  '''
237
- def __init__(self, xs=None, name=NN):
242
+ def __init__(self, xs=None, **name):
238
243
  '''New L{Fcook} stats accumulator.
239
244
 
240
245
  @arg xs: Iterable of additional values (each C{scalar} or
241
246
  an L{Fsum} or L{Fsum2Tuple} instance).
242
- @kwarg name: Optional name (C{str}).
247
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
243
248
 
244
249
  @see: Method L{Fcook.fadd}.
245
250
  '''
@@ -505,10 +510,12 @@ class Fcook(_FstatsBase):
505
510
  S *= (n + 1) / (n - 1)
506
511
  return S
507
512
 
508
- def toFwelford(self, name=NN):
509
- '''Return an L{Fwelford} equivalent.
513
+ def toFwelford(self, **name):
514
+ '''Return a L{Fwelford} equivalent.
515
+
516
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
510
517
  '''
511
- f = Fwelford(name=name or self.name)
518
+ f = Fwelford(name=self._name__(name))
512
519
  f._Ms = self._M1.copy(), self._M2.copy() # deep=False
513
520
  f._n = self._n
514
521
  return f
@@ -520,12 +527,12 @@ class Fwelford(_FstatsBase):
520
527
 
521
528
  @see: U{Cook<https://www.JohnDCook.com/blog/standard_deviation/>} and L{Fcook}.
522
529
  '''
523
- def __init__(self, xs=None, name=NN):
530
+ def __init__(self, xs=None, **name):
524
531
  '''New L{Fwelford} stats accumulator.
525
532
 
526
533
  @arg xs: Iterable of initial values (each C{scalar} or an
527
534
  L{Fsum} or L{Fsum2Tuple} instance).
528
- @kwarg name: Optional name (C{str}).
535
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
529
536
 
530
537
  @see: Method L{Fwelford.fadd}.
531
538
  '''
@@ -619,7 +626,7 @@ class Flinear(_FstatsNamed):
619
626
  C{RunningRegression} computing the running slope, intercept
620
627
  and correlation of a linear regression.
621
628
  '''
622
- def __init__(self, xs=None, ys=None, Fstats=Fwelford, name=NN):
629
+ def __init__(self, xs=None, ys=None, Fstats=Fwelford, **name):
623
630
  '''New L{Flinear} regression accumulator.
624
631
 
625
632
  @kwarg xs: Iterable of initial C{x} values (each C{scalar} or
@@ -628,7 +635,7 @@ class Flinear(_FstatsNamed):
628
635
  an L{Fsum} or L{Fsum2Tuple} instance).
629
636
  @kwarg Fstats: Class for C{xs} and C{ys} values (L{Fcook} or
630
637
  L{Fwelford}).
631
- @kwarg name: Optional name (C{str}).
638
+ @kwarg name: Optional C{B{name}=NN} (C{str}).
632
639
 
633
640
  @raise TypeError: B{C{Fstats}} not L{Fcook} or L{Fwelford}.
634
641