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.
- {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/METADATA +7 -7
- {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/RECORD +49 -48
- pygeodesy/__init__.py +7 -5
- pygeodesy/__main__.py +46 -47
- pygeodesy/auxilats/_CX_4.py +104 -181
- pygeodesy/auxilats/_CX_6.py +152 -277
- pygeodesy/auxilats/_CX_8.py +211 -438
- pygeodesy/auxilats/_CX_Rs.py +222 -0
- pygeodesy/auxilats/__init__.py +2 -2
- pygeodesy/auxilats/__main__.py +30 -38
- pygeodesy/auxilats/auxLat.py +28 -36
- pygeodesy/auxilats/auxily.py +30 -50
- pygeodesy/basics.py +24 -14
- pygeodesy/booleans.py +13 -14
- pygeodesy/clipy.py +7 -7
- pygeodesy/constants.py +44 -31
- pygeodesy/deprecated/__init__.py +1 -1
- pygeodesy/deprecated/functions.py +9 -1
- pygeodesy/elliptic.py +154 -88
- pygeodesy/errors.py +32 -5
- pygeodesy/etm.py +71 -59
- pygeodesy/fmath.py +125 -96
- pygeodesy/fstats.py +8 -12
- pygeodesy/fsums.py +802 -355
- pygeodesy/geodesici.py +6 -5
- pygeodesy/geodesicx/_C4_24.py +1 -3
- pygeodesy/geodesicx/_C4_27.py +1 -3
- pygeodesy/geodesicx/_C4_30.py +1 -3
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +44 -46
- pygeodesy/geodesicx/gxarea.py +3 -3
- pygeodesy/geodesicx/gxbases.py +32 -18
- pygeodesy/internals.py +50 -9
- pygeodesy/interns.py +3 -2
- pygeodesy/karney.py +79 -60
- pygeodesy/ktm.py +4 -4
- pygeodesy/lazily.py +10 -5
- pygeodesy/mgrs.py +47 -42
- pygeodesy/named.py +4 -1
- pygeodesy/points.py +3 -3
- pygeodesy/props.py +7 -6
- pygeodesy/resections.py +2 -2
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/aux_.py +42 -60
- pygeodesy/sphericalNvector.py +4 -4
- pygeodesy/sphericalTrigonometry.py +2 -2
- pygeodesy/triaxials.py +3 -3
- {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/top_level.txt +0 -0
pygeodesy/booleans.py
CHANGED
|
@@ -24,10 +24,10 @@ from pygeodesy.errors import ClipError, _IsnotError, _TypeError, \
|
|
|
24
24
|
from pygeodesy.fmath import favg, hypot, hypot2
|
|
25
25
|
# from pygeodesy.fsums import fsum1 # _MODS
|
|
26
26
|
from pygeodesy.interns import NN, _BANG_, _clip_, _clipid_, _COMMASPACE_, \
|
|
27
|
-
_composite_, _DOT_,
|
|
28
|
-
|
|
29
|
-
_points_, _SPACE_, _too_, _X_,
|
|
30
|
-
_B_, _d_, _R_ # PYCHOK used!
|
|
27
|
+
_composite_, _DOT_, _duplicate_, _e_, \
|
|
28
|
+
_ELLIPSIS_, _few_, _height_, _lat_, _LatLon_, \
|
|
29
|
+
_lon_, _not_, _points_, _SPACE_, _too_, _X_, \
|
|
30
|
+
_x_, _B_, _d_, _R_ # PYCHOK used!
|
|
31
31
|
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
|
|
32
32
|
from pygeodesy.latlonBase import LatLonBase, \
|
|
33
33
|
LatLon2Tuple, Property_RO, property_RO
|
|
@@ -43,7 +43,7 @@ from pygeodesy.utily import fabs, _unrollon, _Wrap
|
|
|
43
43
|
# from math import fabs # from .utily
|
|
44
44
|
|
|
45
45
|
__all__ = _ALL_LAZY.booleans
|
|
46
|
-
__version__ = '24.
|
|
46
|
+
__version__ = '24.09.23'
|
|
47
47
|
|
|
48
48
|
_0_EPS = EPS # near-zero, positive
|
|
49
49
|
_EPS_0 = -EPS # near-zero, negative
|
|
@@ -51,12 +51,11 @@ _1_EPS = _1_0 + EPS # near-one, over
|
|
|
51
51
|
_EPS_1 = _1_0 - EPS # near-one, under
|
|
52
52
|
_10EPS = EPS * 10 # see ._2Abs, ._10eps
|
|
53
53
|
|
|
54
|
-
_alpha_
|
|
55
|
-
_boolean_
|
|
56
|
-
_case_
|
|
57
|
-
_corners_
|
|
58
|
-
|
|
59
|
-
_open_ = 'open'
|
|
54
|
+
_alpha_ = 'alpha'
|
|
55
|
+
_boolean_ = 'boolean'
|
|
56
|
+
_case_ = 'case'
|
|
57
|
+
_corners_ = 'corners'
|
|
58
|
+
_open_ = 'open'
|
|
60
59
|
|
|
61
60
|
|
|
62
61
|
def _Enum(txt, enum): # PYCHOK unused
|
|
@@ -1118,7 +1117,7 @@ class _CompositeBase(_Named):
|
|
|
1118
1117
|
|
|
1119
1118
|
def _sum1(self, _a_p, *args, **kwds): # in .karney, .points
|
|
1120
1119
|
# Sum the area or perimeter of all clips
|
|
1121
|
-
return _MODS.fsums.fsum1((_a_p(c, *args, **kwds) for c in self._clips)
|
|
1120
|
+
return _MODS.fsums.fsum1((_a_p(c, *args, **kwds) for c in self._clips))
|
|
1122
1121
|
|
|
1123
1122
|
def _sum2(self, LL, _a_p, *args, **kwds): # in .sphericalNvector, -Trigonometry
|
|
1124
1123
|
# Sum the area or perimeter of all clips
|
|
@@ -1128,7 +1127,7 @@ class _CompositeBase(_Named):
|
|
|
1128
1127
|
for v in clip:
|
|
1129
1128
|
yield _LL(v.lat, v.lon) # datum=Sphere
|
|
1130
1129
|
|
|
1131
|
-
return _MODS.fsums.fsum1((_a_p(_lls(c), *args, **kwds) for c in self._clips)
|
|
1130
|
+
return _MODS.fsums.fsum1((_a_p(_lls(c), *args, **kwds) for c in self._clips))
|
|
1132
1131
|
|
|
1133
1132
|
def toLatLon(self, LatLon=None, closed=False, **LatLon_kwds):
|
|
1134
1133
|
'''Yield all (non-duplicate) points and intersections
|
|
@@ -1188,7 +1187,7 @@ class _CompositeFHP(_CompositeBase):
|
|
|
1188
1187
|
n, b = v, v._label
|
|
1189
1188
|
if b in L.RIGHT_LEFT_ON: # next chain
|
|
1190
1189
|
while True:
|
|
1191
|
-
n._label = None # n.__dict__
|
|
1190
|
+
n._label = None # _xkwds_pop(n.__dict__, _label=None)
|
|
1192
1191
|
n = n._next
|
|
1193
1192
|
if n is v or n._label is not L.ON_ON: # n._label and ...
|
|
1194
1193
|
break
|
pygeodesy/clipy.py
CHANGED
|
@@ -15,22 +15,22 @@ from __future__ import division as _; del _ # PYCHOK semicolon
|
|
|
15
15
|
# from pygeodesy.basics import len2 # from .fmath
|
|
16
16
|
from pygeodesy.constants import EPS, _0_0, _1_0
|
|
17
17
|
from pygeodesy.errors import _AssertionError, ClipError, PointsError
|
|
18
|
-
from pygeodesy.fmath import fabs, len2
|
|
19
|
-
from pygeodesy.fsums import
|
|
18
|
+
from pygeodesy.fmath import fabs, len2, Fsum
|
|
19
|
+
# from pygeodesy.fsums import Fsum # from .fmath
|
|
20
20
|
from pygeodesy.interns import NN, _clipid_, _convex_, _DOT_, _end_, _few_, \
|
|
21
21
|
_fi_, _height_, _i_, _invalid_, _j_, _lat_, \
|
|
22
22
|
_lon_, _near_, _not_, _points_, _start_, _too_
|
|
23
23
|
from pygeodesy.iters import _imdex2, points2
|
|
24
24
|
from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS
|
|
25
|
-
from pygeodesy.named import _Named, _NamedTuple, _Pass
|
|
25
|
+
from pygeodesy.named import _Named, _NamedTuple, _Pass, Property_RO
|
|
26
26
|
from pygeodesy.points import areaOf, boundsOf, isconvex_, LatLon_
|
|
27
|
-
# from pygeodesy.props import Property_RO # from .
|
|
27
|
+
# from pygeodesy.props import Property_RO # from .named
|
|
28
28
|
from pygeodesy.units import Bool, FIx, HeightX, Lat, Lon, Number_
|
|
29
29
|
|
|
30
30
|
# from math import fabs # from .fmath
|
|
31
31
|
|
|
32
32
|
__all__ = _ALL_LAZY.clipy
|
|
33
|
-
__version__ = '23.
|
|
33
|
+
__version__ = '23.09.20'
|
|
34
34
|
|
|
35
35
|
_fj_ = 'fj'
|
|
36
36
|
_original_ = 'original'
|
|
@@ -576,10 +576,10 @@ class _SH(_Named):
|
|
|
576
576
|
x, dx = p1.lon, self._dx
|
|
577
577
|
fy = float(p2.lat - y)
|
|
578
578
|
fx = float(p2.lon - x)
|
|
579
|
-
d = fy * dx - fx * dy
|
|
579
|
+
d = fy * dx - fx * dy # fdot((fx, fy), dx, -dy)
|
|
580
580
|
if fabs(d) < EPS: # PYCHOK no cover
|
|
581
581
|
raise _AssertionError(self._DOT_(self.intersect.__name__))
|
|
582
|
-
d =
|
|
582
|
+
d = Fsum(self._xy, -y * dx, x * dy).fover(d)
|
|
583
583
|
y += d * fy
|
|
584
584
|
x += d * fx
|
|
585
585
|
return _SHlli(y, x, p1.classof, edge)
|
pygeodesy/constants.py
CHANGED
|
@@ -13,9 +13,9 @@ from pygeodesy.basics import _copysign, isbool, iscomplex, isint, _0_0
|
|
|
13
13
|
from pygeodesy.errors import _xError, _xError2, _xkwds_get1, _xkwds_item2
|
|
14
14
|
# from pygeodesy.internals import _0_0 # from .basics
|
|
15
15
|
from pygeodesy.interns import _INF_, _NAN_, _UNDER_
|
|
16
|
-
|
|
16
|
+
from pygeodesy.lazily import _ALL_MODS as _MODS, _ALL_LAZY
|
|
17
17
|
# from pygeodesy.streprs import Fmt # from .unitsBase
|
|
18
|
-
from pygeodesy.unitsBase import Float, Int, Radius,
|
|
18
|
+
from pygeodesy.unitsBase import Float, Int, Radius, Fmt
|
|
19
19
|
|
|
20
20
|
from math import fabs, isinf, isnan, pi as _pi, sqrt
|
|
21
21
|
try:
|
|
@@ -24,7 +24,7 @@ except ImportError: # Python 2-
|
|
|
24
24
|
_inf, _nan = float(_INF_), float(_NAN_)
|
|
25
25
|
|
|
26
26
|
__all__ = _ALL_LAZY.constants
|
|
27
|
-
__version__ = '24.
|
|
27
|
+
__version__ = '24.09.24'
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
def _copysign_0_0(y):
|
|
@@ -100,7 +100,7 @@ def float0_(*xs):
|
|
|
100
100
|
yield float(x) if x else _0_0
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
def _float0(f): # in .resections, .vector3dBase, ...
|
|
103
|
+
def _float0(f): # in .auxilats.auxily, .resections, .vector3dBase, ...
|
|
104
104
|
'''(INTERNAL) Return C{float(B{f})} or C{INT0}.
|
|
105
105
|
'''
|
|
106
106
|
if f:
|
|
@@ -181,6 +181,7 @@ _10_0 = _float( 10) # PYCHOK expected
|
|
|
181
181
|
_16_0 = _float( 16) # PYCHOK expected
|
|
182
182
|
_32_0 = _float( 32) # PYCHOK expected
|
|
183
183
|
_60_0 = _float( 60) # PYCHOK expected
|
|
184
|
+
_64_0 = _float( 64) # PYCHOK expected
|
|
184
185
|
_90_0 = _float( 90) # PYCHOK expected
|
|
185
186
|
_100_0 = _float( 100) # PYCHOK expected
|
|
186
187
|
_180_0 = _float( 180) # PYCHOK expected
|
|
@@ -224,30 +225,30 @@ except ImportError: # PYCHOK no cover
|
|
|
224
225
|
MIN_EXP = Int(MIN_EXP =_log2(MIN)) # -307 base 10
|
|
225
226
|
# RADIX = Int(Radix =2) # base
|
|
226
227
|
|
|
227
|
-
EPS0 = _Float( EPS0
|
|
228
|
-
EPS02 = _Float( EPS02
|
|
229
|
-
EPS_2 = _Float( EPS_2
|
|
230
|
-
EPS1 = _Float( EPS1
|
|
231
|
-
EPS2 = _Float( EPS2
|
|
232
|
-
EPS4 = _Float( EPS4
|
|
233
|
-
# _1EPS = _Float(_1EPS
|
|
234
|
-
_1_EPS = _Float(_1_EPS
|
|
235
|
-
# _2_EPS = _Float(_2_EPS
|
|
236
|
-
_EPS2e4 = _Float(_EPS2e4
|
|
237
|
-
_EPS4e8 = _Float(_EPS4e8
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
228
|
+
EPS0 = _Float( EPS0 = EPS**2) # PYCHOK near-/non-zero comparison 4.930381e-32, or EPS or EPS_2
|
|
229
|
+
EPS02 = _Float( EPS02 = EPS**4) # PYCHOK near-zero-squared comparison 2.430865e-63
|
|
230
|
+
EPS_2 = _Float( EPS_2 = EPS / _2_0) # PYCHOK ≈ 1.110223024625e-16
|
|
231
|
+
EPS1 = _Float( EPS1 =_1_0 - EPS) # PYCHOK ≈ 0.9999999999999998
|
|
232
|
+
EPS2 = _Float( EPS2 = EPS * _2_0) # PYCHOK ≈ 4.440892098501e-16
|
|
233
|
+
EPS4 = _Float( EPS4 = EPS * _4_0) # PYCHOK ≈ 8.881784197001e-16
|
|
234
|
+
# _1EPS = _Float(_1EPS =_1_0 + EPS) # PYCHOK ≈ 1.0000000000000002
|
|
235
|
+
_1_EPS = _Float(_1_EPS =_1_0 / EPS) # PYCHOK = 4503599627370496.0
|
|
236
|
+
# _2_EPS = _Float(_2_EPS =_2_0 / EPS) # PYCHOK = 9007199254740992.0
|
|
237
|
+
_EPS2e4 = _Float(_EPS2e4= EPS2 * 1.e4) # PYCHOK ≈ 4.440892098501e-12
|
|
238
|
+
_EPS4e8 = _Float(_EPS4e8= EPS4 * 1.e8) # PYCHOK ≈ 8.881784197001e-08
|
|
239
|
+
_EPSjam = _Float(_EPSjam= pow(EPS, 0.75)) # PYCHOK = 1.818989403546e-12
|
|
240
|
+
_EPSmin = _Float(_EPSmin= sqrt(MIN)) # PYCHOK = 1.49166814624e-154
|
|
241
|
+
_EPSqrt = _Float(_EPSqrt= sqrt(EPS)) # PYCHOK = 1.49011611938e5-08
|
|
242
|
+
_EPStol = _Float(_EPStol=_EPSqrt * _0_1) # PYCHOK = 1.49011611938e5-09 == sqrt(EPS * _0_01)
|
|
243
|
+
|
|
244
|
+
_89_999 = _Float(_89_999=_90_0 * EPS1) # just below 90.0
|
|
243
245
|
# <https://Numbers.Computation.Free.FR/Constants/Miscellaneous/digits.html>
|
|
244
|
-
_1__90 = _Float(_1__90
|
|
245
|
-
_2__PI = _Float(_2__PI
|
|
246
|
+
_1__90 = _Float(_1__90 =_1_0 / _90_0) # PYCHOK = 0.011_111_111_111_111_111_111_111_111_111_111_111_111_111_111_11111
|
|
247
|
+
_2__PI = _Float(_2__PI =_2_0 / _pi) # PYCHOK = 0.636_619_772_367_581_343_075_535_053_490_057_448_137_838_582_96182
|
|
246
248
|
|
|
247
|
-
_1_16th = _Float(_1_16th
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
_1_6th = _Float(_1_6th =_1_0 / _6_0) # PYCHOK in .fmath
|
|
249
|
+
_1_16th = _Float(_1_16th=_1_0 / _16_0) # PYCHOK in .ellipsoids, .karney
|
|
250
|
+
_1_3rd = _Float(_1_3rd =_1_0 / _3_0) # PYCHOK in .fmath
|
|
251
|
+
_1_6th = _Float(_1_6th =_1_0 / _6_0) # PYCHOK in .fmath
|
|
251
252
|
|
|
252
253
|
_K0_UTM = _Float(_K0_UTM = 0.9996) # PYCHOK in .etm, .ktm, .utm, UTM scale at central meridian
|
|
253
254
|
# sqrt(2) <https://WikiPedia.org/wiki/Square_root_of_2>
|
|
@@ -319,20 +320,30 @@ def isclose(a, b, rel_tol=1e-12, abs_tol=EPS0):
|
|
|
319
320
|
return _isclose(a, b, rel_tol=rel_tol, abs_tol=abs_tol)
|
|
320
321
|
|
|
321
322
|
|
|
323
|
+
try:
|
|
324
|
+
from cmath import isfinite as _iscfinite
|
|
325
|
+
except ImportError: # Python 3.1-
|
|
326
|
+
|
|
327
|
+
def _iscfinite(x): # PYCHOK not self?
|
|
328
|
+
'''Mimick Python 3.2+ C{cmath.isfinite}.
|
|
329
|
+
'''
|
|
330
|
+
return _isfinite(x.real) and _isfinite(x.imag)
|
|
331
|
+
|
|
322
332
|
try:
|
|
323
333
|
from math import isfinite as _isfinite # in .ellipsoids, ...
|
|
324
334
|
except ImportError: # Python 3.1-
|
|
325
335
|
|
|
326
|
-
def _isfinite(x):
|
|
336
|
+
def _isfinite(x): # PYCHOK not self?
|
|
327
337
|
'''Mimick Python 3.2+ C{math.isfinite}.
|
|
328
338
|
'''
|
|
329
339
|
return not (isinf(x) or isnan(x))
|
|
330
340
|
|
|
331
341
|
|
|
332
342
|
def isfinite(obj):
|
|
333
|
-
'''Check a finite C{scalar}
|
|
343
|
+
'''Check a finite C{scalar}, C{complex}, ... value.
|
|
334
344
|
|
|
335
|
-
@arg obj: Value (C{scalar}
|
|
345
|
+
@arg obj: Value (C{scalar}, C{complex}, an L{Fsum} or
|
|
346
|
+
L{Fsum2Tuple}).
|
|
336
347
|
|
|
337
348
|
@return: C{False} if B{C{obj}} is C{INF}, C{NINF}
|
|
338
349
|
or C{NAN}, C{True} otherwise.
|
|
@@ -343,7 +354,9 @@ def isfinite(obj):
|
|
|
343
354
|
return (obj not in _INF_NAN_NINF) and _isfinite(obj)
|
|
344
355
|
except Exception as x:
|
|
345
356
|
if iscomplex(obj): # _isfinite(complex) thows TypeError
|
|
346
|
-
return
|
|
357
|
+
return _iscfinite(obj)
|
|
358
|
+
if _MODS.fsums._isFsumTuple(obj): # OverflowError
|
|
359
|
+
return obj.is_finite()
|
|
347
360
|
raise _xError(x, Fmt.PAREN(isfinite.__name__, obj))
|
|
348
361
|
|
|
349
362
|
|
|
@@ -441,7 +454,7 @@ def isnon0(x, eps0=EPS0):
|
|
|
441
454
|
def _off90(lat):
|
|
442
455
|
'''(INTERNAL) Off 90.0 for .gars and .wgrs.
|
|
443
456
|
'''
|
|
444
|
-
return max(min(lat,
|
|
457
|
+
return max(min(lat, _89_999), -_89_999)
|
|
445
458
|
|
|
446
459
|
|
|
447
460
|
try:
|
pygeodesy/deprecated/__init__.py
CHANGED
|
@@ -27,7 +27,7 @@ __all__ = (_ALL_DEPRECATED.deprecated_bases +
|
|
|
27
27
|
_ALL_DEPRECATED.deprecated_classes +
|
|
28
28
|
_ALL_DEPRECATED.deprecated_consterns +
|
|
29
29
|
_ALL_DEPRECATED.deprecated_functions)
|
|
30
|
-
__version__ = '24.
|
|
30
|
+
__version__ = '24.09.19'
|
|
31
31
|
|
|
32
32
|
if _unLazy0:
|
|
33
33
|
from pygeodesy.deprecated import bases, datum, nvector, rhumbBase, \
|
|
@@ -14,7 +14,7 @@ from pygeodesy.props import deprecated_function
|
|
|
14
14
|
from pygeodesy.units import Number_, Scalar_
|
|
15
15
|
|
|
16
16
|
__all__ = _ALL_DEPRECATED.deprecated_functions
|
|
17
|
-
__version__ = '24.
|
|
17
|
+
__version__ = '24.09.19'
|
|
18
18
|
|
|
19
19
|
_WGS84 = _UTM = object()
|
|
20
20
|
|
|
@@ -193,6 +193,14 @@ def fStrzs(floatstr): # PYCHOK no cover
|
|
|
193
193
|
return _MODS.streprs.fstrzs(floatstr)
|
|
194
194
|
|
|
195
195
|
|
|
196
|
+
@deprecated_function
|
|
197
|
+
def Fsum2product(*xs, **kwds):
|
|
198
|
+
'''DEPRECATED on 2024.09.19, use L{Fsum}C{(*B{xs}, B{f2product}=True, ...)}.'''
|
|
199
|
+
F = _MODS.fsums.Fsum(**kwds)
|
|
200
|
+
_ = F.f2product(True)
|
|
201
|
+
return F._facc_args(xs, up=False) if xs else F
|
|
202
|
+
|
|
203
|
+
|
|
196
204
|
@deprecated_function
|
|
197
205
|
def hypot3(x, y, z): # PYCHOK no cover
|
|
198
206
|
'''DEPRECATED, use function L{pygeodesy.hypot_}.'''
|