pygeodesy 24.8.24__py2.py3-none-any.whl → 24.9.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 (49) hide show
  1. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/METADATA +7 -7
  2. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/RECORD +49 -48
  3. pygeodesy/__init__.py +7 -5
  4. pygeodesy/__main__.py +46 -47
  5. pygeodesy/auxilats/_CX_4.py +104 -181
  6. pygeodesy/auxilats/_CX_6.py +152 -277
  7. pygeodesy/auxilats/_CX_8.py +211 -438
  8. pygeodesy/auxilats/_CX_Rs.py +222 -0
  9. pygeodesy/auxilats/__init__.py +2 -2
  10. pygeodesy/auxilats/__main__.py +30 -38
  11. pygeodesy/auxilats/auxLat.py +28 -36
  12. pygeodesy/auxilats/auxily.py +30 -50
  13. pygeodesy/basics.py +24 -14
  14. pygeodesy/booleans.py +13 -14
  15. pygeodesy/clipy.py +7 -7
  16. pygeodesy/constants.py +44 -31
  17. pygeodesy/deprecated/__init__.py +1 -1
  18. pygeodesy/deprecated/functions.py +9 -1
  19. pygeodesy/elliptic.py +154 -88
  20. pygeodesy/errors.py +32 -5
  21. pygeodesy/etm.py +71 -59
  22. pygeodesy/fmath.py +125 -96
  23. pygeodesy/fstats.py +8 -12
  24. pygeodesy/fsums.py +802 -355
  25. pygeodesy/geodesici.py +6 -5
  26. pygeodesy/geodesicx/_C4_24.py +1 -3
  27. pygeodesy/geodesicx/_C4_27.py +1 -3
  28. pygeodesy/geodesicx/_C4_30.py +1 -3
  29. pygeodesy/geodesicx/__init__.py +1 -1
  30. pygeodesy/geodesicx/__main__.py +44 -46
  31. pygeodesy/geodesicx/gxarea.py +3 -3
  32. pygeodesy/geodesicx/gxbases.py +32 -18
  33. pygeodesy/internals.py +50 -9
  34. pygeodesy/interns.py +3 -2
  35. pygeodesy/karney.py +79 -60
  36. pygeodesy/ktm.py +4 -4
  37. pygeodesy/lazily.py +10 -5
  38. pygeodesy/mgrs.py +47 -42
  39. pygeodesy/named.py +4 -1
  40. pygeodesy/points.py +3 -3
  41. pygeodesy/props.py +7 -6
  42. pygeodesy/resections.py +2 -2
  43. pygeodesy/rhumb/__init__.py +1 -1
  44. pygeodesy/rhumb/aux_.py +42 -60
  45. pygeodesy/sphericalNvector.py +4 -4
  46. pygeodesy/sphericalTrigonometry.py +2 -2
  47. pygeodesy/triaxials.py +3 -3
  48. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/WHEEL +0 -0
  49. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/top_level.txt +0 -0
pygeodesy/geodesici.py CHANGED
@@ -28,8 +28,9 @@ from __future__ import division as _; del _ # PYCHOK semicolon
28
28
  from pygeodesy.basics import _copy, _enumereverse, map1, \
29
29
  _xinstanceof, _xor
30
30
  from pygeodesy.constants import EPS, INF, INT0, PI, PI2, PI_4, \
31
- _0_0, _0_5, _1_0, _1_5, _2_0, _3_0, \
32
- _90_0, isfinite
31
+ _0_0, _0_5, _1_0, _1_5, _2_0, \
32
+ _3_0, _64_0, _90_0, isfinite, \
33
+ _EPSjam # PYCHOK used!
33
34
  from pygeodesy.ellipsoids import _EWGS84, Fmt, unstr
34
35
  from pygeodesy.errors import GeodesicError, IntersectionError, _an, \
35
36
  _xgeodesics, _xkwds_get, _xkwds_kwds, \
@@ -56,7 +57,7 @@ from pygeodesy.utily import sincos2, atan2, fabs, radians
56
57
  # from math import atan2, ceil as _ceil, fabs, radians # .fsums, .utily
57
58
 
58
59
  __all__ = _ALL_LAZY.geodesici
59
- __version__ = '24.07.25'
60
+ __version__ = '24.08.28'
60
61
 
61
62
  _0t = 0, # int
62
63
  _1_1t = -1, +1
@@ -1237,7 +1238,7 @@ class Intersector(_IntersectBase):
1237
1238
  return sx, zx, sAx, sBx
1238
1239
 
1239
1240
  def _polarB3(self, lats=False): # PYCHOK no cover
1240
- latx = 64.0
1241
+ latx = _64_0
1241
1242
  lat = _90_0 - latx
1242
1243
  if self.f:
1243
1244
  _d, _pD2 = fdot, self._polarDist2
@@ -1393,7 +1394,7 @@ class Intersector(_IntersectBase):
1393
1394
 
1394
1395
  @Property_RO
1395
1396
  def _Tol(self): # convergence tolerance
1396
- return self._cHalf * pow(EPS, 0.75) # _0_75
1397
+ return self._cHalf * _EPSjam
1397
1398
 
1398
1399
  def toStr(self, **prec_sep_name): # PYCHOK signature
1399
1400
  '''Return this C{Intersector} as string.
@@ -13,7 +13,7 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
13
13
  from pygeodesy.geodesicx.gxbases import _Gfloats, _f, _f2
14
14
 
15
15
  __all__ = ()
16
- __version__ = '23.08.19'
16
+ __version__ = '24.09.04'
17
17
 
18
18
  _g = _Gfloats(24)
19
19
  _coeffs_24 = _g(( # GEOGRAPHICLIB_GEODESICEXACT_ORDER == 24
@@ -1672,8 +1672,6 @@ _coeffs_24 = _g(( # GEOGRAPHICLIB_GEODESICEXACT_ORDER == 24
1672
1672
  # C4[23], coeff of eps^23, polynomial in n of order 0
1673
1673
  _f(1 << 41), _f(0xc5e28ed2c935ab), # PYCHOK exported
1674
1674
  )) # 2900 / 2708
1675
- if __name__ == '__main__':
1676
- _g.prints()
1677
1675
  del _g, _Gfloats, _f, _f2
1678
1676
 
1679
1677
  # **) MIT License
@@ -13,7 +13,7 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
13
13
  from pygeodesy.geodesicx.gxbases import _Gfloats, _f, _f2
14
14
 
15
15
  __all__ = ()
16
- __version__ = '23.08.19'
16
+ __version__ = '24.09.04'
17
17
 
18
18
  _g = _Gfloats(27)
19
19
  _coeffs_27 = _g(( # GEOGRAPHICLIB_GEODESICEXACT_ORDER == 27
@@ -2368,8 +2368,6 @@ _coeffs_27 = _g(( # GEOGRAPHICLIB_GEODESICEXACT_ORDER == 27
2368
2368
  # C4[26], coeff of eps^26, polynomial in n of order 0
2369
2369
  _f(1 << 48), _f2(2126, 0x8c0e9e949456f), # PYCHOK exported
2370
2370
  )) # 4032 / 3764
2371
- if __name__ == '__main__':
2372
- _g.prints()
2373
2371
  del _g, _Gfloats, _f, _f2
2374
2372
 
2375
2373
  # **) MIT License
@@ -30,7 +30,7 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
30
30
  from pygeodesy.geodesicx.gxbases import _Gfloats, _f, _f2
31
31
 
32
32
  __all__ = ()
33
- __version__ = '23.08.19'
33
+ __version__ = '24.09.04'
34
34
 
35
35
  _g = _Gfloats(30)
36
36
  _coeffs_30 = _g(( # GEOGRAPHICLIB_GEODESICEXACT_ORDER == 30
@@ -3273,8 +3273,6 @@ _coeffs_30 = _g(( # GEOGRAPHICLIB_GEODESICEXACT_ORDER == 30
3273
3273
  # C4[29], coeff of eps^29, polynomial in n of order 0
3274
3274
  _f(1 << 53), _f2(88602, 0xec373d36a45df), # PYCHOK exported
3275
3275
  )) # 5425 / 5107
3276
- if __name__ == '__main__':
3277
- _g.prints()
3278
3276
  del _g, _Gfloats, _f, _f2
3279
3277
 
3280
3278
 
@@ -23,7 +23,7 @@ from pygeodesy.karney import Caps, GeodesicError
23
23
  from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY
24
24
 
25
25
  __all__ = _ALL_LAZY.geodesicx + _ALL_DOCS(Caps, GeodesicError)
26
- __version__ = '24.07.09'
26
+ __version__ = '24.09.06'
27
27
 
28
28
  # **) MIT License
29
29
  #
@@ -5,65 +5,63 @@ u'''Print L{geodesicx} version, etc. using C{python -m pygeodesy.geodesicx}.
5
5
  '''
6
6
 
7
7
  __all__ = ()
8
- __version__ = '24.05.31'
8
+ __version__ = '24.09.06'
9
9
 
10
10
 
11
- def _C4stats(nC4=None): # PYCHOK no cover
12
- '''(INTERNAL) Get the C{C4} stats.
13
- '''
14
- from pygeodesy import GeodesicExact, geodesicx
15
-
16
- gX = GeodesicExact(C4order=nC4)
17
- cs = geodesicx.gx._C4coeffs(gX.C4order)
18
- ss = set(cs) # without duplicates
19
- pc = '%.1f%%' % (len(ss) * 100.0 / len(cs))
20
- cx = gX._C4x
21
- return dict(C4order=gX.C4order, C4len=len(cs), C4set=len(ss), C4set_len=pc, C4x=len(cx))
22
-
23
-
24
- def _main(): # PYCHOK no cover
25
-
26
- import os.path as os_path
11
+ def _main(**C4order): # PYCHOK no cover
27
12
 
28
13
  try:
29
- from pygeodesy import geodesicx as _gx, GeodesicError, \
30
- GeodesicSolve, printf, pygeodesy_abspath
31
- from pygeodesy.internals import _Pythonarchine, _usage
32
- from pygeodesy.interns import _COMMASPACE_, _DOT_, _SPACE_, _version_
33
- from pygeodesy.streprs import Fmt
34
-
35
- def _dot_attr(name, value):
36
- return Fmt.DOT(Fmt.EQUAL(name, value))
37
-
38
- s = tuple(sorted(_C4stats().items()))
39
- p = [_dot_attr(*t) for t in (((_version_, _gx.__version__),) + s)]
40
-
41
- def _name_version(pkg):
42
- return _SPACE_(pkg.__name__, pkg.__version__)
43
-
44
- v = _Pythonarchine()
14
+ from pygeodesy import GeodesicExact, geodesicx
15
+ from pygeodesy.internals import _fper, _name_version, \
16
+ printf, _sizeof, _versions
17
+ from pygeodesy.interns import _COMMASPACE_, _EQUAL_
45
18
  try:
46
- import geographiclib
47
- v.append(_name_version(geographiclib))
19
+ import numpy
48
20
  except ImportError:
49
- pass
21
+ numpy = None
22
+
23
+ gX = GeodesicExact(**C4order)
24
+ cs = geodesicx.gx._C4coeffs(gX.C4order)
25
+ n = len(cs)
26
+ u = n if numpy else len(set(cs))
27
+ z = cs.nbytes if numpy else _sizeof(cs)
28
+ p = dict(C4order=gX.C4order, C4n=n, C4u=u,
29
+ C4u_n=_fper(u, n), C4x=len(gX._C4x),
30
+ C4t=type(cs).__name__, C4z=z)
31
+ p = list(_EQUAL_(*t) for t in p.items())
32
+ if numpy:
33
+ p.append(_name_version(numpy))
50
34
  try:
51
- g = GeodesicSolve()
52
- v.append(g.version)
53
- except GeodesicError:
35
+ import geographiclib
36
+ p.append(_name_version(geographiclib))
37
+ except ImportError:
54
38
  pass
55
39
 
56
- g = _gx.__name__
57
- x = os_path.basename(pygeodesy_abspath)
58
- if not g.startswith(x):
59
- g = _DOT_(x, g)
60
- printf('%s%s (%s)', g, _COMMASPACE_.join(p), _COMMASPACE_.join(v))
40
+ g = _name_version(geodesicx)
41
+ printf('%s: %s (%s)', g, _COMMASPACE_.join(p), _versions())
61
42
 
62
43
  except ImportError:
63
- printf(_usage(__file__))
44
+ from pygeodesy.internals import _usage
45
+ print(_usage(__file__))
46
+
47
+
48
+ from sys import argv # .internals._isPyChecker
49
+ _main(C4order=int(argv[1])) if len(argv) == 2 and argv[1].isdigit() else _main()
50
+
51
+ # % python3.13 -m pygeodesy.geodesicx 30
52
+ # pygeodesy.geodesicx 24.09.06: C4order=30, C4n=5425, C4u=5107, C4u_n=94.1%, C4x=465, C4t=tuple, C4z=166008 (pygeodesy 24.9.6 Python 3.13.0rc1 64bit arm64 macOS 14.6.1)
53
+ # % python3.12 -m pygeodesy.geodesicx 30
54
+ # pygeodesy.geodesicx 24.09.06: C4order=30, C4n=5425, C4u=5425, C4u_n=100.0%, C4x=465, C4t=ndarray, C4z=43400, numpy 2.1.0, geographiclib 2.0 (pygeodesy 24.9.6 Python 3.12.5 64bit arm64 macOS 14.6.1)
64
55
 
56
+ # % python3.13 -m pygeodesy.geodesicx 27
57
+ # pygeodesy.geodesicx 24.09.06: C4order=27, C4n=4032, C4u=3764, C4u_n=93.4%, C4x=378, C4t=tuple, C4z=122632 (pygeodesy 24.9.6 Python 3.13.0rc1 64bit arm64 macOS 14.6.1)
58
+ # % python3.12 -m pygeodesy.geodesicx 27
59
+ # pygeodesy.geodesicx 24.09.06: C4order=27, C4n=4032, C4u=4032, C4u_n=100.0%, C4x=378, C4t=ndarray, C4z=32256, numpy 2.1.0, geographiclib 2.0 (pygeodesy 24.9.6 Python 3.12.5 64bit arm64 macOS 14.6.1)
65
60
 
66
- _main()
61
+ # % python3.13 -m pygeodesy.geodesicx 24
62
+ # pygeodesy.geodesicx 24.09.06: C4order=24, C4n=2900, C4u=2708, C4u_n=93.4%, C4x=300, C4t=tuple, C4z=88232 (pygeodesy 24.9.6 Python 3.13.0rc1 64bit arm64 macOS 14.6.1)
63
+ # % python3.12 -m pygeodesy.geodesicx 24
64
+ # pygeodesy.geodesicx 24.09.06: C4order=24, C4n=2900, C4u=2900, C4u_n=100.0%, C4x=300, C4t=ndarray, C4z=23200, numpy 2.1.0, geographiclib 2.0 (pygeodesy 24.9.6 Python 3.12.5 64bit arm64 macOS 14.6.1)
67
65
 
68
66
  # **) MIT License
69
67
  #
@@ -21,7 +21,7 @@ from pygeodesy.basics import isodd, unsigned0
21
21
  from pygeodesy.constants import NAN, _0_0, _0_5, _720_0
22
22
  # from pygeodesy.interns import _COMMASPACE_ # from .lazily
23
23
  from pygeodesy.karney import Area3Tuple, _diff182, GeodesicError, \
24
- _norm180, _remainder, _sum2_
24
+ _norm180, _remainder, _sum3
25
25
  from pygeodesy.lazily import _ALL_DOCS, printf, _COMMASPACE_
26
26
  from pygeodesy.named import ADict, callername, _NamedBase, pairs
27
27
  from pygeodesy.props import Property, Property_RO, property_RO
@@ -30,7 +30,7 @@ from pygeodesy.props import Property, Property_RO, property_RO
30
30
  from math import fmod as _fmod
31
31
 
32
32
  __all__ = ()
33
- __version__ = '24.08.13'
33
+ __version__ = '24.09.04'
34
34
 
35
35
 
36
36
  class GeodesicAreaExact(_NamedBase):
@@ -451,7 +451,7 @@ class _Accumulator(_NamedBase):
451
451
  @return: Current C{sum}.
452
452
  '''
453
453
  self._n += 1
454
- self._s, self._t = _sum2_(self._s, self._t, y)
454
+ self._s, self._t, _ = _sum3(self._s, self._t, y)
455
455
  return self._s # current .Sum()
456
456
 
457
457
  def Negate(self):
@@ -9,17 +9,18 @@ U{GeographicLib<https://GeographicLib.SourceForge.io>} documentation.
9
9
  '''
10
10
 
11
11
  from pygeodesy.basics import isodd, _MODS
12
- from pygeodesy.constants import _EPSmin as _TINY, _0_0, _100_0
12
+ from pygeodesy.constants import _EPSmin as _TINY, _0_0
13
13
  from pygeodesy.errors import _or, _xkwds_item2
14
14
  from pygeodesy.fmath import hypot as _hypot
15
+ # from pygeodesy.interns import _numpy_ # _MODS
15
16
  from pygeodesy.karney import _CapsBase, GeodesicError, _2cos2x, \
16
- _norm2, _sincos2d, _sum2_
17
- # from pygeodesy.lazily import _MODS, printf # .basics, _MODS
17
+ _norm2, _sincos2d, _sum3
18
+ # from pygeodesy.lazily import _ALL_MODS as _MODS # from .basics
18
19
 
19
20
  from math import fabs, ldexp as _ldexp
20
21
 
21
22
  __all__ = ()
22
- __version__ = '24.06.16'
23
+ __version__ = '24.09.07'
23
24
 
24
25
  # valid C{nC4}s and C{C4order}s, see _xnC4 below
25
26
  _nC4s = {24: 2900, 27: 4032, 30: 5425}
@@ -44,7 +45,7 @@ class _GeodesicBase(_CapsBase): # in .geodsolve
44
45
 
45
46
 
46
47
  class _Gfloats(dict):
47
- '''(INTERNAL) Uniquify floats.
48
+ '''(INTERNAL) Numpy or "Unique" floats.
48
49
  '''
49
50
  n = 0 # total number of floats
50
51
  nC4 = 0
@@ -53,16 +54,16 @@ class _Gfloats(dict):
53
54
  self.nC4 = nC4
54
55
 
55
56
  def __call__(self, fs):
56
- '''Return a tuple of "uniquified" floats.
57
+ '''Return a C{numpy.array} or C{tuple} of C{float}s.
57
58
  '''
59
+ np = _MODS.imported(_MODS.interns._numpy_)
60
+ if np: # use numpy, already imported
61
+ cs = np.array(fs, dtype=float)
62
+ else:
63
+ _f = self.setdefault # avoid duplicates
64
+ cs = tuple(_f(f, f) for f in map(float, fs)) # PYCHOK as attr
58
65
  self.n += len(fs)
59
- _f = self.setdefault
60
- return tuple(_f(f, f) for f in map(float, fs)) # PYCHOK as attr
61
-
62
- def prints(self):
63
- n, u = self.n, len(self.keys())
64
- d = (n - u) * _100_0 / n
65
- _MODS.lazily.printf('_CX_%d: n=%d, u=%d, d=%.1f%%', self.nC4, n, u, d) # XXX
66
+ return cs
66
67
 
67
68
 
68
69
  def _cosSeries(c4s, sx, cx): # PYCHOK shared .geodesicx.gx and -.gxline
@@ -75,15 +76,28 @@ def _cosSeries(c4s, sx, cx): # PYCHOK shared .geodesicx.gx and -.gxline
75
76
  _c4 = c4.pop
76
77
  if isodd(len(c4)):
77
78
  y0 = _c4()
78
- _s2 = _sum2_
79
79
  while c4:
80
80
  # y1 = ar * y0 - y1 + c4.pop()
81
81
  # y0 = ar * y1 - y0 + c4.pop()
82
- y1, t1 = _s2(ar * y0, ar * t0, -y1, -t1, _c4())
83
- y0, t0 = _s2(ar * y1, ar * t1, -y0, -t0, _c4())
82
+ y1, t1, _ = _sum3(-y1, -t1, ar * y0, ar * t0, _c4())
83
+ y0, t0, _ = _sum3(-y0, -t0, ar * y1, ar * t1, _c4())
84
84
  # s = (y0 - y1) * cx
85
- s, _ = _s2(cx * y0, _0_0, cx * t0, -cx * y1, -cx * t1)
86
- return s
85
+ s, t, _ = _sum3(cx * y0, _0_0, cx * t0, -cx * y1, -cx * t1)
86
+ return s + t
87
+
88
+ # Y0, Y1 = Fsum(), Fsum()
89
+ # ar = _2cos2x(cx, sx)
90
+ # c4 = list(c4s)
91
+ # _c4 = c4.pop
92
+ # if isodd(len(c4)):
93
+ # Y0 += _c4()
94
+ # while c4:
95
+ # # y1 = ar * y0 - y1 + c4.pop()
96
+ # # y0 = ar * y1 - y0 + c4.pop()
97
+ # Y1 = Y0 * ar - Y1 + _c4()
98
+ # Y0 = Y1 * ar - Y0 + _c4()
99
+ # # s = (y0 - y1) * cx
100
+ # return float((Y0 - Y1) * cx)
87
101
 
88
102
 
89
103
  _f = float # in _f2 and .geodesicx._C4_24, _27 and _30
pygeodesy/internals.py CHANGED
@@ -207,6 +207,13 @@ class _MODS_Base(object):
207
207
  l3.insert(0, pypy)
208
208
  return l3
209
209
 
210
+ @_Property_RO
211
+ def _Str_Bytes(self):
212
+ '''Get all C{str} and C{bytes} types.
213
+ '''
214
+ import pygeodesy.basics as m
215
+ return m._Strs + m._Bytes # + (range, map)
216
+
210
217
  @_Property_RO
211
218
  def streprs(self):
212
219
  '''Get module C{pygeodesy.streprs}, I{once}.
@@ -254,6 +261,12 @@ def _enquote(strs, quote=_QUOTE2_, white=NN): # in .basics, .solveBase
254
261
  return strs
255
262
 
256
263
 
264
+ def _fper(p, q, per=100.0, prec=1):
265
+ '''Format a percentage C{B{p} * B{per} / B{q}} (C{str}).
266
+ '''
267
+ return '%.*f%%' % (prec, (float(p) * per / float(q)))
268
+
269
+
257
270
  def _headof(name):
258
271
  '''(INTERNAL) Get the head name of qualified C{name} or the C{name}.
259
272
  '''
@@ -292,6 +305,13 @@ def _isNix(): # in test/bases.py
292
305
  return _MODS.nix2[0]
293
306
 
294
307
 
308
+ def _isPyChecker():
309
+ '''(INTERNAL) Is C{PyChecker} running? (C{bool}).
310
+ '''
311
+ # .../pychecker/checker.py --limit 0 --stdlib pygeodesy/<mod>/<name>.py
312
+ return _sys.argv[0].endswith('/pychecker/checker.py')
313
+
314
+
295
315
  def _isPyPy(): # in test/bases.py
296
316
  '''(INTERNAL) Is this C{PyPy}? (C{bool})
297
317
  '''
@@ -343,12 +363,30 @@ def machine():
343
363
  return _MODS.bits_machine2[1]
344
364
 
345
365
 
366
+ def _Math_K_2():
367
+ '''(INTERNAL) Return the I{Karney} Math setting.
368
+ '''
369
+ return _MODS.karney._wrapped.Math_K_2
370
+
371
+
346
372
  def _name_version(pkg):
347
373
  '''(INTERNAL) Return C{pskg.__name__ + ' ' + .__version__}.
348
374
  '''
349
375
  return _SPACE_(pkg.__name__, pkg.__version__)
350
376
 
351
377
 
378
+ def _name_binary(path):
379
+ '''(INTERNAL) Return C{(basename + ' ' + version)} of an executable.
380
+ '''
381
+ if path:
382
+ try:
383
+ _, r = _MODS.solveBase._popen2((path, '--version'))
384
+ return _SPACE_(_os_path.basename(path), r.split()[-1])
385
+ except (IndexError, IOError, OSError):
386
+ pass
387
+ return NN
388
+
389
+
352
390
  def _osversion2(sep=NN): # in .lazily, test/bases.versions
353
391
  '''(INTERNAL) Get the O/S name and release as C{2-list} or C{str}.
354
392
  '''
@@ -463,15 +501,17 @@ def _secs2str(secs): # in .geoids, ../test/bases.py
463
501
  return t
464
502
 
465
503
 
466
- def _sizeof(obj):
504
+ def _sizeof(obj, deep=True):
467
505
  '''(INTERNAL) Recursively size an C{obj}ect.
468
506
 
469
- @return: The C{obj} size in bytes (C{int}),
470
- ignoring class attributes and
471
- counting duplicates only once or
472
- C{None}.
507
+ @kwarg deep: If C{True}, include the size of all
508
+ C{.__dict__.values()} (C{bool}).
473
509
 
474
- @note: With C{PyPy}, the size is always C{None}.
510
+ @return: The C{obj} size in bytes (C{int}), ignoring
511
+ class attributes and counting instances only
512
+ once or C{None}.
513
+
514
+ @note: With C{PyPy}, the returned size is always C{None}.
475
515
  '''
476
516
  try:
477
517
  _zB = _sys.getsizeof
@@ -491,9 +531,10 @@ def _sizeof(obj):
491
531
  if isinstance(o, dict):
492
532
  z += _zR(s, o.keys())
493
533
  z += _zR(s, o.values())
494
- elif _isiterablen(o): # not map, ...
534
+ elif _isiterablen(o) and not \
535
+ isinstance(o, _MODS._Str_Bytes):
495
536
  z += _zR(s, o)
496
- else:
537
+ elif deep:
497
538
  try: # size instance' attr values only
498
539
  z += _zR(s, o.__dict__.values())
499
540
  except AttributeError: # None, int, etc.
@@ -611,7 +652,7 @@ def _versions(sep=_SPACE_):
611
652
 
612
653
 
613
654
  __all__ = tuple(map(_dunder_nameof, (machine, print_, printf)))
614
- __version__ = '24.08.24'
655
+ __version__ = '24.09.04'
615
656
 
616
657
  if _dunder_ismain(__name__): # PYCHOK no cover
617
658
 
pygeodesy/interns.py CHANGED
@@ -200,6 +200,7 @@ _distant_ = _Prefix('distant') # PYCHOK OK
200
200
  _doesn_t_exist_ = "doesn't exist" # PYCHOK OK
201
201
  _DOT_ = Str_('.') # PYCHOK OK
202
202
  _dunder_name_ = '__name__' # PYCHOK _DUNDER_(NN, _name_, NN)
203
+ _duplicate_ = 'duplicate' # PYCHOK OK
203
204
  _e_ = 'e' # PYCHOK OK
204
205
  _E_ = 'E' # PYCHOK OK
205
206
  _earth_ = 'earth' # PYCHOK OK
@@ -347,7 +348,7 @@ _Python_ = _Python_('Python') # PYCHOK singleton
347
348
  _python_ = 'python' # PYCHOK OK
348
349
  _QUOTE1_ = "'" # PYCHOK OK
349
350
  _QUOTE2_ = '"' # PYCHOK OK
350
- # _QUOTE3_ = "'''" # PYCHOK OK
351
+ _QUOTE3_ = "'''" # PYCHOK OK
351
352
  # _QUOTE6_ = '"""' # PYCHOK OK
352
353
  _R_ = 'R' # PYCHOK OK
353
354
  _radians_ = 'radians' # PYCHOK OK
@@ -440,7 +441,7 @@ _LR_PAIRS = {_LANGLE_: _RANGLE_,
440
441
 
441
442
  __all__ = (_NN_, # NOT MISSING!
442
443
  Str_.__name__) # classes
443
- __version__ = '24.08.22'
444
+ __version__ = '24.08.30'
444
445
 
445
446
  if __name__ == '__main__':
446
447