pygeodesy 25.1.9__py2.py3-none-any.whl → 25.4.8__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.
pygeodesy/fsums.py CHANGED
@@ -39,8 +39,8 @@ results may differ from Python's C{math.fsum} results.
39
39
  # make sure int/int division yields float quotient, see .basics
40
40
  from __future__ import division as _; del _ # PYCHOK semicolon
41
41
 
42
- from pygeodesy.basics import isbool, iscomplex, isint, isscalar, \
43
- _signOf, itemsorted, signOf, _xiterable
42
+ from pygeodesy.basics import _gcd, isbool, iscomplex, isint, isscalar, \
43
+ _signOf, itemsorted, signOf, _xiterable
44
44
  from pygeodesy.constants import INF, INT0, MANT_DIG, NEG0, NINF, _0_0, \
45
45
  _1_0, _N_1_0, _isfinite, _pos_self, \
46
46
  Float, Int
@@ -64,20 +64,21 @@ from math import fabs, isinf, isnan, \
64
64
  ceil as _ceil, floor as _floor # PYCHOK used! .ltp
65
65
 
66
66
  __all__ = _ALL_LAZY.fsums
67
- __version__ = '24.12.02'
67
+ __version__ = '25.01.12'
68
68
 
69
69
  from pygeodesy.interns import (
70
70
  _PLUS_ as _add_op_, # in .auxilats.auxAngle
71
+ _DSLASH_ as _floordiv_op_,
71
72
  _EQUAL_ as _fset_op_,
72
73
  _RANGLE_ as _gt_op_,
73
74
  _LANGLE_ as _lt_op_,
74
75
  _PERCENT_ as _mod_op_,
75
76
  _STAR_ as _mul_op_,
76
77
  _NOTEQUAL_ as _ne_op_,
78
+ _DSTAR_ as _pow_op_,
77
79
  _DASH_ as _sub_op_, # in .auxilats.auxAngle
78
80
  _SLASH_ as _truediv_op_
79
81
  )
80
- _floordiv_op_ = _truediv_op_ * 2 # _DSLASH_
81
82
  _divmod_op_ = _floordiv_op_ + _mod_op_
82
83
  _F2PRODUCT = _getPYGEODESY('FSUM_F2PRODUCT')
83
84
  _iadd_op_ = _add_op_ + _fset_op_ # in .auxilats.auxAngle, .fstats
@@ -86,7 +87,6 @@ _isub_op_ = _sub_op_ + _fset_op_ # in .auxilats.auxAngle
86
87
  _NONFINITEr = _0_0 # NOT INT0!
87
88
  _NONFINITES = _getPYGEODESY('FSUM_NONFINITES')
88
89
  _non_zero_ = 'non-zero'
89
- _pow_op_ = _mul_op_ * 2 # _DSTAR_
90
90
  _RESIDUAL_0_0 = _getPYGEODESY('FSUM_RESIDUAL', _0_0)
91
91
  _significant_ = 'significant'
92
92
  _threshold_ = 'threshold'
@@ -96,7 +96,7 @@ def _2finite(x, _isfine=_isfinite): # in .fstats
96
96
  '''(INTERNAL) return C{float(x)} if finite.
97
97
  '''
98
98
  return (float(x) if _isfine(x) # and isscalar(x)
99
- else _nfError(x))
99
+ else _nfError(x))
100
100
 
101
101
 
102
102
  def _2float(index=None, _isfine=_isfinite, **name_x): # in .fmath, .fstats
@@ -132,27 +132,23 @@ except ImportError: # PYCHOK DSPACE! Python 3.12-
132
132
 
133
133
  if _F2PRODUCT and _F2PRODUCT != _std_:
134
134
  # backward to PyGeodesy 24.09.09, with _fmaX
135
+ from pygeodesy.basics import _integer_ratio2
135
136
 
136
137
  def _fma(*a_b_c): # PYCHOK no cover
137
138
  # mimick C{math.fma} from Python 3.13+,
138
139
  # the same accuracy, but ~14x slower
139
- (na, da), (nb, db), (nc, dc) = map(_2n_d, a_b_c)
140
+ (na, da), (nb, db), (nc, dc) = map(_integer_ratio2, a_b_c)
140
141
  n = na * nb * dc
141
142
  n += da * db * nc
142
143
  d = da * db * dc
143
144
  try:
144
- n, d = _n_d2(n, d)
145
+ n, d = _n_d2(n, d)
145
146
  r = float(n / d)
146
147
  except OverflowError: # "integer division result too large ..."
147
148
  r = NINF if (_signOf(n, 0) * _signOf(d, 0)) < 0 else INF
148
149
  return r if _isfinite(r) else _fmaX(r, *a_b_c) # "overflow in fma"
149
-
150
- def _2n_d(x): # PYCHOK no cover
151
- try: # int.as_integer_ratio in 3.8+
152
- return x.as_integer_ratio()
153
- except (AttributeError, OverflowError, TypeError, ValueError):
154
- return (x if isint(x) else float(x)), 1
155
150
  else:
151
+ _integer_ratio2 = None # redef, in Fsum.is_math_fma
156
152
 
157
153
  def _fma(a, b, c): # PYCHOK redef
158
154
  # mimick C{math.fma} from Python 3.13+,
@@ -161,17 +157,15 @@ except ImportError: # PYCHOK DSPACE! Python 3.12-
161
157
  r = _fsum(_2products(a, b3s, c))
162
158
  return r if _isfinite(r) else _fmaX(r, a, b, c)
163
159
 
164
- _2n_d = None # redef
165
-
166
160
  def _fmaX(r, *a_b_c): # PYCHOK no cover
167
- # handle non-finite as Python 3.13+ C-function U{math_fma_impl<https://
168
- # GitHub.com/python/cpython/blob/main/Modules/mathmodule.c#L2305>}:
169
- # raise a ValueError for a NAN result from non-NAN C{a_b_c}s or an
170
- # OverflowError for a non-NAN non-finite from all finite C{a_b_c}s.
161
+ # handle non-finite fma result as Python 3.13+ C-function U{math_fma_impl
162
+ # <https://GitHub.com/python/cpython/blob/main/Modules/mathmodule.c#L2305>}:
163
+ # raise a ValueError for a NAN result from non-NAN C{a_b_c}s otherwise an
164
+ # OverflowError for a non-finite, non-NAN result from all finite C{a_b_c}s.
171
165
  if isnan(r):
172
166
  def _x(x):
173
167
  return not isnan(x)
174
- else: # non-NAN non-finite
168
+ else: # non-finite, non-NAN
175
169
  _x = _isfinite
176
170
  if all(map(_x, a_b_c)):
177
171
  raise _nfError(r, unstr(_fma, *a_b_c))
@@ -179,10 +173,8 @@ except ImportError: # PYCHOK DSPACE! Python 3.12-
179
173
 
180
174
  def _2products(x, y3s, *zs): # PYCHOK in _fma, ...
181
175
  # yield(x * y3 for y3 in y3s) + yield(z in zs)
182
- # TwoProduct U{Algorithm 3.3
183
- # <https://www.TUHH.De/ti3/paper/rump/OgRuOi05.pdf>}
184
- # also in Python 3.13+ C{Modules/mathmodule.c} under
185
- # #ifndef UNRELIABLE_FMA ... #else ... #endif
176
+ # TwoProduct U{Algorithm 3.3<https://www.TUHH.De/ti3/paper/rump/OgRuOi05.pdf>}, also
177
+ # in Python 3.13+ C{Modules/mathmodule.c} under #ifndef UNRELIABLE_FMA ... #else ...
186
178
  _, a, b = _2split3(x)
187
179
  for y, c, d in y3s:
188
180
  y *= x
@@ -282,25 +274,17 @@ def _isOK_or_finite(x, _isfine=_isfinite):
282
274
  return _isfine(x) # C{bool}
283
275
 
284
276
 
285
- try:
286
- from math import gcd as _gcd
287
-
288
- def _n_d2(n, d):
289
- '''(INTERNAL) Reduce C{n} and C{d} by C{gcd}.
290
- '''
291
- if n and d:
292
- try:
293
- c = _gcd(n, d)
294
- if c > 1:
295
- n, d = (n // c), (d // c)
296
- except TypeError: # non-int float
297
- pass
298
- return n, d
299
-
300
- except ImportError: # 3.4-
301
-
302
- def _n_d2(*n_d): # PYCHOK redef
303
- return n_d
277
+ def _n_d2(n, d):
278
+ '''(INTERNAL) Reduce C{n} and C{d} by C{gcd}.
279
+ '''
280
+ if n and d:
281
+ try:
282
+ c = _gcd(n, d)
283
+ if c > 1:
284
+ return (n // c), (d // c)
285
+ except TypeError: # non-int float
286
+ pass
287
+ return n, d
304
288
 
305
289
 
306
290
  def _nfError(x, *args):
@@ -1332,16 +1316,16 @@ class Fsum(_Named): # sync __methods__ with .vector3dBase.Vector3dBase, .fstats
1332
1316
 
1333
1317
  def _fhorner(self, x, cs, where, incx=True): # in .fmath
1334
1318
  '''(INTERNAL) Add an L{Fhorner} evaluation of polynomial
1335
- C{sum(cs[i] * B{x}**i for i=0..len(cs)-1) if B{incx}
1336
- else sum(... i=len(cs)-1..0)}.
1319
+ C{sum(c * B{x}**i for i, c in _e(cs))} where C{_e =
1320
+ enumerate if B{incx} else _enumereverse}.
1337
1321
  '''
1338
1322
  # assert _xiterablen(cs)
1339
1323
  try:
1340
- n = len(cs)
1341
- H = self._Fsum_as(name__=self._fhorner)
1342
- _m = H._mul_Fsum if _isFsum_2Tuple(x) else \
1343
- H._mul_scalar
1344
- if _2finite(x, **self._isfine) and n > 1:
1324
+ n = len(cs)
1325
+ if n > 1 and _2finite(x, **self._isfine):
1326
+ H = self._Fsum_as(name__=self._fhorner)
1327
+ _m = H._mul_Fsum if _isFsum_2Tuple(x) else \
1328
+ H._mul_scalar
1345
1329
  for c in (reversed(cs) if incx else cs):
1346
1330
  H._fset(_m(x, _mul_op_), up=False)
1347
1331
  H._fadd(c, up=False)
@@ -1804,8 +1788,8 @@ class Fsum(_Named): # sync __methods__ with .vector3dBase.Vector3dBase, .fstats
1804
1788
  kwds.update(name_f2product_nonfinites_RESIDUAL)
1805
1789
  f = Fsum(**kwds)
1806
1790
  # assert all(v == self.__dict__[n] for n, v in f.__dict__.items())
1807
- return f._fset(xs[0], op=_fset_op_) if len(xs) == 1 else (
1808
- f._facc(xs, up=False) if xs else f)
1791
+ return (f._facc(xs, up=False) if len(xs) > 1 else
1792
+ f._fset(xs[0], op=_fset_op_)) if xs else f
1809
1793
 
1810
1794
  def fsum2(self, xs=(), **name):
1811
1795
  '''Add an iterable's items, summate and return the
@@ -1960,7 +1944,7 @@ class Fsum(_Named): # sync __methods__ with .vector3dBase.Vector3dBase, .fstats
1960
1944
  an C{fma} implementation as C{math.fma} or C{None}, a previous
1961
1945
  C{PyGeodesy} implementation.
1962
1946
  '''
1963
- return (_2split3s is _passarg) or (False if _2n_d is None else None)
1947
+ return (_2split3s is _passarg) or (False if _integer_ratio2 is None else None)
1964
1948
 
1965
1949
  def is_math_fsum(self):
1966
1950
  '''Are the summation functions L{fsum}, L{fsum_}, L{fsumf_}, L{fsum1},
pygeodesy/gars.py CHANGED
@@ -14,14 +14,13 @@ Transcoded from I{Charles Karney}'s C++ class U{GARS
14
14
  (GARS)<https://Earth-Info.NGA.mil/GandG/coordsys/grids/gars.html>}.
15
15
  '''
16
16
 
17
- # from pygeodesy.basics import isstr # from .named
17
+ from pygeodesy.basics import isstr, _splituple
18
18
  from pygeodesy.constants import _off90, _1_over, _0_5, \
19
19
  _1_0 # PYCHOK used!
20
20
  from pygeodesy.errors import _ValueError, _xkwds, _xStrError
21
- from pygeodesy.interns import NN, _0to9_, _AtoZnoIO_, _COMMA_, \
22
- _INV_, _SPACE_
21
+ from pygeodesy.interns import NN, _0to9_, _AtoZnoIO_, _INV_
23
22
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY
24
- from pygeodesy.named import _name__, Fmt, isstr, Property_RO
23
+ from pygeodesy.named import _name__, Fmt, Property_RO
25
24
  from pygeodesy.namedTuples import LatLon2Tuple, LatLonPrec3Tuple
26
25
  # from pygeodesy.props import Property_RO # from .named
27
26
  # from pygeodesy.streprs import Fmt # from .named
@@ -30,7 +29,7 @@ from pygeodesy.units import Int_, Lat, Lon, Precision_, Scalar_, Str
30
29
  from math import floor
31
30
 
32
31
  __all__ = _ALL_LAZY.gars
33
- __version__ = '24.08.13'
32
+ __version__ = '25.01.15'
34
33
 
35
34
  _Digits = _0to9_
36
35
  _LatLen = 2
@@ -136,7 +135,7 @@ class Garef(Str):
136
135
  if isinstance(lat_gll, Garef):
137
136
  g, ll, p = str(lat_gll), lat_gll.latlon, lat_gll.precision
138
137
  elif isstr(lat_gll):
139
- ll = lat_gll.replace(_COMMA_, _SPACE_).split()
138
+ ll = _splituple(lat_gll)
140
139
  if len(ll) > 1:
141
140
  g, ll, p = _encode3(ll[0], ll[1], precision)
142
141
  else:
@@ -5,7 +5,7 @@ u'''Print L{geodesicx} version, etc. using C{python -m pygeodesy.geodesicx}.
5
5
  '''
6
6
 
7
7
  __all__ = ()
8
- __version__ = '24.12.31'
8
+ __version__ = '25.04.04'
9
9
 
10
10
 
11
11
  def _main(**C4order): # PYCHOK no cover
@@ -44,7 +44,7 @@ def _main(**C4order): # PYCHOK no cover
44
44
  print(_usage(__file__))
45
45
 
46
46
 
47
- from sys import argv # .internals._isPyChecker
47
+ from sys import argv # .internals._isPyChOK
48
48
  _main(C4order=int(argv[1])) if len(argv) == 2 and argv[1].isdigit() else _main()
49
49
 
50
50
  # % python3.13 -m pygeodesy.geodesicx 30
pygeodesy/geohash.py CHANGED
@@ -17,14 +17,13 @@ U{Geohashes<https://www.Movable-Type.co.UK/scripts/geohash.html>}.
17
17
  U{geohash-js<https://GitHub.com/DaveTroy/geohash-js>}.
18
18
  '''
19
19
 
20
- from pygeodesy.basics import isstr, map2
20
+ from pygeodesy.basics import isstr, map2, _splituple
21
21
  from pygeodesy.constants import EPS, R_M, _0_0, _0_5, _180_0, _360_0, \
22
22
  _90_0, _N_90_0, _N_180_0 # PYCHOK used!
23
23
  from pygeodesy.errors import _ValueError, _xkwds, _xStrError
24
24
  # from pygeodesy import formy as _formy # _MODS
25
- from pygeodesy.interns import NN, _COMMA_, _DOT_, _E_, _height_, _N_, _NE_, \
26
- _NW_, _radius_, _S_, _SE_, _SPACE_, _SW_, _W_, \
27
- _width_ # _INV_
25
+ from pygeodesy.interns import NN, _DOT_, _E_, _height_, _N_, _NE_, _NW_, \
26
+ _radius_, _S_, _SE_, _SW_, _W_, _width_ # _INV_
28
27
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
29
28
  from pygeodesy.named import _name__, _NamedDict, _NamedTuple, nameof, _xnamed
30
29
  from pygeodesy.namedTuples import Bounds2Tuple, Bounds4Tuple, LatLon2Tuple, \
@@ -38,7 +37,7 @@ from pygeodesy.units import Degrees_, Int, Lat_, Lon_, Meter, Precision_, Str
38
37
  from math import fabs, ldexp, log10, radians
39
38
 
40
39
  __all__ = _ALL_LAZY.geohash
41
- __version__ = '24.10.12'
40
+ __version__ = '25.01.15'
42
41
 
43
42
  _formy = _MODS.into(formy=__name__)
44
43
  _MASK5 = 16, 8, 4, 2, 1 # PYCHOK used!
@@ -290,7 +289,7 @@ class Geohash(Str):
290
289
  if isinstance(lat_ghll, Geohash):
291
290
  gh, ll = str(lat_ghll), lat_ghll.latlon
292
291
  elif isstr(lat_ghll): # "lat, lon" or "geohash"
293
- ll = lat_ghll.replace(_COMMA_, _SPACE_).split()
292
+ ll = _splituple(lat_ghll)
294
293
  if len(ll) > 1:
295
294
  gh, ll = _GH.encode2(ll[0], ll[1], precision, eps)
296
295
  else:
pygeodesy/geoids.py CHANGED
@@ -89,7 +89,7 @@ courtesy of SBFRF.
89
89
  # make sure int/int division yields float quotient, see .basics
90
90
  from __future__ import division as _; del _ # PYCHOK semicolon
91
91
 
92
- from pygeodesy.basics import len2, min2, isodd, ub2str as _ub2str
92
+ from pygeodesy.basics import len2, min2, isodd, _splituple, ub2str as _ub2str
93
93
  from pygeodesy.constants import EPS, _float as _F, _1_0, _N_90_0, _180_0, \
94
94
  _N_180_0, _360_0
95
95
  from pygeodesy.datums import Datums, _ellipsoidal_datum, _WGS84
@@ -105,7 +105,6 @@ from pygeodesy.interns import NN, _COLONSPACE_, _COMMASPACE_, _E_, _height_, \
105
105
  _in_, _kind_, _lat_, _lon_, _mean_, _N_, _n_a_, \
106
106
  _numpy_, _on_, _outside_, _S_, _s_, _scipy_, \
107
107
  _SPACE_, _stdev_, _tbd_, _W_, _width_, _4_
108
- from pygeodesy.interns import _COMMA_ # PYCHOK used!
109
108
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS, _FOR_DOCS
110
109
  from pygeodesy.named import _name__, _Named, _NamedTuple
111
110
  # from pygeodesy.namedTuples import LatLon3Tuple # _MODS
@@ -126,7 +125,7 @@ except ImportError: # Python 3+
126
125
  from io import BytesIO as _BytesIO # PYCHOK expected
127
126
 
128
127
  __all__ = _ALL_LAZY.geoids
129
- __version__ = '24.12.31'
128
+ __version__ = '25.01.15'
130
129
 
131
130
  _assert_ = 'assert'
132
131
  _bHASH_ = b'#'
@@ -912,8 +911,7 @@ def _I(i):
912
911
  def _T(cs):
913
912
  '''(INTERNAL) Cache a tuple of single C{int} constants.
914
913
  '''
915
- cs = cs.replace(_COMMA_, _SPACE_).strip()
916
- return tuple(map(_I, cs.split()))
914
+ return tuple(map(_I, _splituple(cs)))
917
915
 
918
916
  _T0s12 = (_I(0),) * 12 # PYCHOK _T('0, 0, ..., 0')
919
917
 
pygeodesy/internals.py CHANGED
@@ -345,11 +345,12 @@ def _isNix(): # in test/bases
345
345
  return _MODS.nix2[0]
346
346
 
347
347
 
348
- def _isPyChecker(): # PYCHOK no cover
349
- '''(INTERNAL) Is C{PyChecker} running? (C{bool}).
348
+ def _isPyChOK(): # PYCHOK no cover
349
+ '''(INTERNAL) Is C{PyChecker} running? (C{bool})
350
350
  '''
351
351
  # .../pychecker/checker.py --limit 0 --stdlib pygeodesy/<mod>/<name>.py
352
- return _sys.argv[0].endswith('/pychecker/checker.py')
352
+ return _sys.argv[0].endswith('/pychecker/checker.py') or \
353
+ bool(_getPYGEODESY('PYCHOK'))
353
354
 
354
355
 
355
356
  def _isPyPy(): # in test/bases
@@ -701,7 +702,7 @@ def _versions(sep=_SPACE_):
701
702
 
702
703
 
703
704
  __all__ = tuple(map(_DUNDER_nameof, (machine, print_, printf)))
704
- __version__ = '24.11.06'
705
+ __version__ = '25.04.04'
705
706
 
706
707
  if _is_DUNDER_main(__name__): # PYCHOK no cover
707
708
 
@@ -714,7 +715,7 @@ if _is_DUNDER_main(__name__): # PYCHOK no cover
714
715
  _main()
715
716
 
716
717
  # % python3 -m pygeodesy.internals
717
- # pygeodesy 24.11.11 Python 3.13.0 64bit arm64 macOS 14.6.1 _isfrozen False isLazy 1
718
+ # pygeodesy 25.4.4 Python 3.13.2 64bit arm64 macOS 15.4 _isfrozen False isLazy 1
718
719
 
719
720
  # **) MIT License
720
721
  #
pygeodesy/interns.py CHANGED
@@ -429,8 +429,8 @@ _SW_ = _S_ + _W_ # PYCHOK negative ones
429
429
  _DDOT_ = Str_(_DOT_ * 2) # PYCHOK OK
430
430
  # _DEQUAL_ = Str_(_EQUAL_ * 2) # PYCHOK OK
431
431
  # _DNL_ = Str_(_NL_ * 2) # PYCHOK OK
432
- # _DSLASH_ = Str_(_SLASH_ * 2) # PYCHOK OK
433
- # _DSTAR_ = Str_(_STAR_ * 2) # PYCHOK OK
432
+ _DSLASH_ = Str_(_SLASH_ * 2) # PYCHOK OK
433
+ _DSTAR_ = Str_(_STAR_ * 2) # PYCHOK OK
434
434
  _DUNDER_ = Str_(_UNDER_ * 2) # PYCHOK OK
435
435
 
436
436
  _LR_PAIRS = {_LANGLE_: _RANGLE_,
@@ -440,7 +440,7 @@ _LR_PAIRS = {_LANGLE_: _RANGLE_,
440
440
 
441
441
  __all__ = (_NN_, # NOT MISSING!
442
442
  Str_.__name__) # classes
443
- __version__ = '24.11.27'
443
+ __version__ = '25.01.12'
444
444
 
445
445
  if __name__ == '__main__':
446
446
 
pygeodesy/karney.py CHANGED
@@ -165,7 +165,7 @@ from pygeodesy.utily import atan2d, sincos2d, tand, _unrollon, fabs
165
165
  # from math import fabs # from .utily
166
166
 
167
167
  __all__ = _ALL_LAZY.karney
168
- __version__ = '24.11.26'
168
+ __version__ = '25.04.08'
169
169
 
170
170
  _2_4_ = '2.4'
171
171
  _K_2_0 = _getenv(_PYGEODESY(_xgeographiclib, 1), _2_)
@@ -880,8 +880,9 @@ except ImportError: # Python 3.12-
880
880
  s, t, _ = _sum3(s * x, t * x, c)
881
881
  return s + t
882
882
 
883
- # def _poly_fma(x, *cs):
884
- # S = Fhorner(x, *cs, incx=False)
883
+ # def _poly_fma(x, s, *cs):
884
+ # S = Fhorner(x, *cs, incx=False)
885
+ # S += s
885
886
  # return float(S)
886
887
 
887
888
  def _polynomial(x, cs, i, j): # PYCHOK shared
@@ -893,8 +894,8 @@ def _polynomial(x, cs, i, j): # PYCHOK shared
893
894
  if (i + 1) < j <= len(cs): # load _Rtuple._tuple
894
895
  try:
895
896
  r = _wrapped.Math.polyval(j - i - 1, cs, i, x)
896
- except AttributeError:
897
- r = _poly_fma(x, *cs[i:j])
897
+ except AttributeError: # no .Math
898
+ r = _poly_fma(x, _0_0, *cs[i:j])
898
899
  else:
899
900
  r = cs[i]
900
901
  return float(r)
pygeodesy/lazily.py CHANGED
@@ -32,7 +32,7 @@ from pygeodesy import internals as _internals, interns as _interns, \
32
32
  # from pygeodesy.errors import _error_init, _xkwds_item2 # _ALL_MODS
33
33
  from pygeodesy.internals import _caller3, _DUNDER_nameof, _getPYGEODESY, _headof, \
34
34
  _is_DUNDER_main, printf, _tailof, _versions
35
- from pygeodesy.interns import NN, _attribute_, _by_, _COLONSPACE_, _COMMASPACE_, \
35
+ from pygeodesy.interns import NN, _1_, _attribute_, _by_, _COLONSPACE_, _COMMASPACE_, \
36
36
  _doesn_t_exist_, _DOT_, _DUNDER_all_, _EQUALSPACED_, \
37
37
  _from_, _HASH_, _immutable_, _line_, _module_, _no_, \
38
38
  _not_, _or_, _pygeodesy_abspath_, _pygeodesy_, _sys, \
@@ -64,7 +64,7 @@ class LazyAttributeError(AttributeError):
64
64
 
65
65
 
66
66
  class LazyImportError(ImportError):
67
- '''Raised if C{lazy import} is not supported, disabled or failed some other way.
67
+ '''Raised if C{lazy import} is not supported, disabled or failed.
68
68
  '''
69
69
  def __init__(self, *args, **kwds):
70
70
  _ALL_MODS.errors._error_init(ImportError, self, args, **kwds)
@@ -485,7 +485,7 @@ class _ALL_MODS(_internals._MODS_Base):
485
485
  mod, dun = self.errors._xkwds_item2(mod_DUNDER_name)
486
486
  _mod = _UNDER_(NN, mod)
487
487
  d = self.getmodule(dun) # '__main__' OK
488
- i = _getattribute(d, _mod, dun)
488
+ i = _getmodattr(d, _mod, dun)
489
489
  assert isinstance(i, _Into)
490
490
  m = self.getmodule(mod)
491
491
  setattr(d, _mod, m) # overwrite C{d._mod}
@@ -509,7 +509,7 @@ class _ALL_MODS(_internals._MODS_Base):
509
509
  _internals._MODS = _ALL_MODS = _ALL_MODS() # PYCHOK singleton
510
510
 
511
511
  __all__ = _ALL_LAZY.lazily
512
- __version__ = '25.01.05'
512
+ __version__ = '25.01.25'
513
513
 
514
514
 
515
515
  def _ALL_OTHER(*objs):
@@ -592,7 +592,7 @@ def _getattras(attr_as): # test/testDeprecated
592
592
  return as_ or a_.rstrip(_DOT_)
593
593
 
594
594
 
595
- def _getattribute(m, name, mod=_pygeodesy_):
595
+ def _getmodattr(m, name, mod=_pygeodesy_):
596
596
  '''(INTERNAL) Get attr C{m.name}.
597
597
  '''
598
598
  try:
@@ -691,7 +691,7 @@ def _lazy_import2(pack): # MCCABE 14
691
691
  if t not in sub_packages: # invalid module package
692
692
  raise LazyImportError(_DOT_(mod, _DUNDER_package_), t)
693
693
  if attr: # get mod.attr
694
- v = _getattribute(v, attr, mod)
694
+ v = _getmodattr(v, attr, mod)
695
695
 
696
696
  elif name in (_DUNDER_all_,): # XXX _DUNDER_dir_, _DUNDER_members_?
697
697
  v = _ALL_INIT + tuple(imports.keys())
@@ -785,11 +785,11 @@ def _lazy_init2(pack):
785
785
  '''(INTERNAL) Initialize lazy import and set globals C{isLazy} and C{_unLazy0}.
786
786
 
787
787
  @arg pack: The name of the package (C{str}) performing the imports,
788
- to help resolving relative imports, usually C{__package__}.
788
+ to resolve relative imports, usually C{__package__}.
789
789
 
790
790
  @return: 2-Tuple C{(package, parent)} with the importing C{package}
791
791
  for easy reference within itself and its name aka the
792
- C{parent}, same as B{C{pack}}.
792
+ C(package)'s C{parent}, same as B{C{pack}}.
793
793
 
794
794
  @raise LazyImportError: Lazy import not supported or not enabled,
795
795
  an import failed or the package name is
@@ -799,12 +799,9 @@ def _lazy_init2(pack):
799
799
  '''
800
800
  global isLazy, _unLazy0
801
801
 
802
- z = _getPYGEODESY('LAZY_IMPORT', None)
803
- if z is None: # not set, but ...
804
- isLazy = 1 # ... default on 3.7+
805
- else:
806
- z = z.strip() # like PYTHONVERBOSE et.al.
807
- isLazy = int(z) if z.isdigit() else (1 if z else 0)
802
+ z = _getPYGEODESY('LAZY_IMPORT', _1_) # 1 default on 3.7+
803
+ z = z.strip() # like PYTHONVERBOSE et.al.
804
+ isLazy = int(z) if z.isdigit() else (1 if z else 0)
808
805
 
809
806
  _unLazy0 = _unlazy or not isLazy # pre-3.7 or w/o lazy import
810
807
 
@@ -9,7 +9,7 @@ u'''Package of lazily imported C{rhumb} modules L{rhumb.aux_}, L{rhumb.ekx} and
9
9
  from pygeodesy.lazily import _ALL_LAZY, _ALL_OTHER, _lazy_import_as, _unLazy0
10
10
 
11
11
  __all__ = _ALL_LAZY.rhumb
12
- __version__ = '24.11.07'
12
+ __version__ = '25.01.15'
13
13
 
14
14
  if _unLazy0: # or _isfrozen
15
15
  from pygeodesy.rhumb.aux_ import RhumbAux, RhumbLineAux
pygeodesy/rhumb/aux_.py CHANGED
@@ -32,7 +32,7 @@ from pygeodesy.auxilats.auxAngle import AuxMu, AuxPhi, hypot
32
32
  from pygeodesy.auxilats.auxDLat import AuxDLat, _DClenshaw
33
33
  # from pygeodesy.auxilats.auxDST import AuxDST # _MODS
34
34
  from pygeodesy.auxilats.auxily import _Dlam, _Dp0Dpsi
35
- from pygeodesy.auxilats._CX_Rs import _Rdict, _Rtuple
35
+ from pygeodesy.auxilats._CX_Rs import _Rdict, _Rkey, _Rtuple
36
36
  from pygeodesy.basics import copysign0, _reverange, _xkwds_get1
37
37
  from pygeodesy.constants import EPS_2, MANT_DIG, PI4, isinf, \
38
38
  _0_0, _4_0, _720_0, _log2, _over
@@ -48,7 +48,7 @@ from pygeodesy.rhumb.bases import RhumbBase, RhumbLineBase, \
48
48
  from math import ceil as _ceil, fabs, radians
49
49
 
50
50
  __all__ = _ALL_LAZY.rhumb_aux_
51
- __version__ = '24.09.02'
51
+ __version__ = '25.01.15'
52
52
 
53
53
  # DIGITS = (sizeof(real) * 8) bits
54
54
  # = (ctypes.sizeof(ctypes.c_double(1.0)) * 8) bits
@@ -314,25 +314,25 @@ def _RAseries(auxD):
314
314
 
315
315
 
316
316
  _RACoeffs = _Rdict(110, # Rhumb Area Coefficients in matrix Q
317
- _Rtuple(4, 10, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 4
317
+ _Rtuple(_Rkey(4), 10, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 4
318
318
  '596/2025, -398/945, 22/45, -1/3',
319
319
  '1543/4725, -118/315, 1/5',
320
320
  '152/945, -17/315',
321
321
  '5/252'),
322
- _Rtuple(5, 15, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 5
322
+ _Rtuple(_Rkey(5), 15, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 5
323
323
  '-102614/467775, 596/2025, -398/945, 22/45, -1/3',
324
324
  '-24562/155925, 1543/4725, -118/315, 1/5',
325
325
  '-38068/155925, 152/945, -17/315',
326
326
  '-752/10395, 5/252',
327
327
  '-101/17325'),
328
- _Rtuple(6, 21, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 6
328
+ _Rtuple(_Rkey(6), 21, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 6
329
329
  '138734126/638512875, -102614/467775, 596/2025, -398/945, 22/45, -1/3',
330
330
  '17749373/425675250, -24562/155925, 1543/4725, -118/315, 1/5',
331
331
  '1882432/8513505, -38068/155925, 152/945, -17/315',
332
332
  '268864/2027025, -752/10395, 5/252',
333
333
  '62464/2027025, -101/17325',
334
334
  '11537/4054050'),
335
- _Rtuple(7, 28, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 7
335
+ _Rtuple(_Rkey(7), 28, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 7
336
336
  '-565017322/1915538625, 138734126/638512875, -102614/467775, 596/2025, -398/945, 22/45, -1/3',
337
337
  '-1969276/58046625, 17749373/425675250, -24562/155925, 1543/4725, -118/315, 1/5',
338
338
  '-58573784/638512875, 1882432/8513505, -38068/155925, 152/945, -17/315',
@@ -340,7 +340,7 @@ _RACoeffs = _Rdict(110, # Rhumb Area Coefficients in matrix Q
340
340
  '-112832/1447875, 62464/2027025, -101/17325',
341
341
  '-4096/289575, 11537/4054050',
342
342
  '-311/525525'),
343
- _Rtuple(8, 36, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 8
343
+ _Rtuple(_Rkey(8), 36, # GEOGRAPHICLIB_RHUMBAREA_ORDER == 8
344
344
  '188270561816/488462349375, -565017322/1915538625, 138734126/638512875, -102614/467775, 596/2025, -398/945, 22/45, -1/3',
345
345
  '2332829602/23260111875, -1969276/58046625, 17749373/425675250, -24562/155925, 1543/4725, -118/315, 1/5',
346
346
  '-41570288/930404475, -58573784/638512875, 1882432/8513505, -38068/155925, 152/945, -17/315',
@@ -350,7 +350,7 @@ _RACoeffs = _Rdict(110, # Rhumb Area Coefficients in matrix Q
350
350
  '4193792/723647925, -311/525525',
351
351
  '1097653/1929727800')
352
352
  )
353
- del _Rdict, _Rtuple
353
+ del _Rdict, _Rkey, _Rtuple
354
354
 
355
355
  __all__ += _ALL_DOCS(Caps)
356
356