pygeodesy 24.6.9__py2.py3-none-any.whl → 24.7.7__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 (87) hide show
  1. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.7.7.dist-info/RECORD +117 -0
  3. pygeodesy/__init__.py +39 -32
  4. pygeodesy/__main__.py +6 -1
  5. pygeodesy/albers.py +2 -2
  6. pygeodesy/auxilats/__init__.py +1 -1
  7. pygeodesy/auxilats/auxAngle.py +40 -39
  8. pygeodesy/auxilats/auxDLat.py +3 -2
  9. pygeodesy/auxilats/auxLat.py +16 -18
  10. pygeodesy/auxilats/auxily.py +1 -1
  11. pygeodesy/azimuthal.py +10 -10
  12. pygeodesy/basics.py +16 -4
  13. pygeodesy/booleans.py +4 -4
  14. pygeodesy/cartesianBase.py +11 -14
  15. pygeodesy/css.py +14 -18
  16. pygeodesy/datums.py +6 -6
  17. pygeodesy/deprecated/__init__.py +1 -1
  18. pygeodesy/deprecated/classes.py +25 -4
  19. pygeodesy/deprecated/datum.py +3 -3
  20. pygeodesy/deprecated/functions.py +6 -8
  21. pygeodesy/dms.py +23 -27
  22. pygeodesy/ecef.py +4 -4
  23. pygeodesy/elevations.py +4 -4
  24. pygeodesy/ellipsoidalBase.py +23 -28
  25. pygeodesy/ellipsoidalBaseDI.py +19 -23
  26. pygeodesy/ellipsoidalExact.py +3 -3
  27. pygeodesy/ellipsoidalGeodSolve.py +15 -23
  28. pygeodesy/ellipsoidalKarney.py +37 -60
  29. pygeodesy/ellipsoidalNvector.py +38 -44
  30. pygeodesy/ellipsoidalVincenty.py +11 -14
  31. pygeodesy/ellipsoids.py +107 -101
  32. pygeodesy/errors.py +109 -48
  33. pygeodesy/etm.py +32 -44
  34. pygeodesy/formy.py +55 -58
  35. pygeodesy/frechet.py +18 -20
  36. pygeodesy/fsums.py +3 -3
  37. pygeodesy/gars.py +3 -4
  38. pygeodesy/geodesici.py +1696 -0
  39. pygeodesy/geodesicw.py +15 -15
  40. pygeodesy/geodesicx/__init__.py +4 -4
  41. pygeodesy/geodesicx/gx.py +34 -55
  42. pygeodesy/geodesicx/gxbases.py +20 -8
  43. pygeodesy/geodesicx/gxline.py +93 -88
  44. pygeodesy/geodsolve.py +108 -59
  45. pygeodesy/geohash.py +26 -34
  46. pygeodesy/geoids.py +28 -37
  47. pygeodesy/hausdorff.py +17 -18
  48. pygeodesy/heights.py +2 -2
  49. pygeodesy/internals.py +46 -13
  50. pygeodesy/interns.py +2 -2
  51. pygeodesy/karney.py +78 -15
  52. pygeodesy/ktm.py +13 -16
  53. pygeodesy/latlonBase.py +17 -19
  54. pygeodesy/lazily.py +28 -25
  55. pygeodesy/lcc.py +28 -31
  56. pygeodesy/ltp.py +7 -8
  57. pygeodesy/ltpTuples.py +71 -73
  58. pygeodesy/mgrs.py +8 -9
  59. pygeodesy/named.py +19 -10
  60. pygeodesy/nvectorBase.py +9 -10
  61. pygeodesy/osgr.py +9 -9
  62. pygeodesy/points.py +6 -6
  63. pygeodesy/rhumb/__init__.py +1 -1
  64. pygeodesy/rhumb/aux_.py +5 -5
  65. pygeodesy/rhumb/bases.py +30 -31
  66. pygeodesy/rhumb/ekx.py +3 -4
  67. pygeodesy/rhumb/solve.py +21 -22
  68. pygeodesy/solveBase.py +177 -123
  69. pygeodesy/sphericalBase.py +10 -11
  70. pygeodesy/sphericalNvector.py +13 -13
  71. pygeodesy/sphericalTrigonometry.py +86 -97
  72. pygeodesy/streprs.py +4 -34
  73. pygeodesy/triaxials.py +48 -43
  74. pygeodesy/units.py +208 -275
  75. pygeodesy/unitsBase.py +115 -107
  76. pygeodesy/ups.py +26 -31
  77. pygeodesy/utily.py +8 -8
  78. pygeodesy/utm.py +35 -40
  79. pygeodesy/utmups.py +43 -46
  80. pygeodesy/utmupsBase.py +8 -9
  81. pygeodesy/vector3d.py +26 -27
  82. pygeodesy/vector3dBase.py +6 -7
  83. pygeodesy/webmercator.py +19 -21
  84. pygeodesy/wgrs.py +18 -20
  85. PyGeodesy-24.6.9.dist-info/RECORD +0 -116
  86. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/WHEEL +0 -0
  87. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/top_level.txt +0 -0
pygeodesy/ltpTuples.py CHANGED
@@ -11,11 +11,11 @@ L{ChLVYX2Tuple}, L{ChLVyx2Tuple} and L{Footprint5Tuple}.
11
11
  @see: References in module L{ltp}.
12
12
  '''
13
13
 
14
- # from pygeodesy.basics import issubclassof # from .units
14
+ # from pygeodesy.basics import issubclassof # _MODS
15
15
  from pygeodesy.constants import _0_0, _1_0, _90_0, _N_90_0
16
16
  # from pygeodesy.dms import F_D, toDMS # _MODS
17
- from pygeodesy.errors import _TypeError, _TypesError, _xattr, \
18
- _xkwds, _xkwds_item2
17
+ from pygeodesy.errors import _TypeError, _TypesError, _xattr, _xkwds, \
18
+ _xkwds_item2
19
19
  from pygeodesy.fmath import hypot, hypot_
20
20
  from pygeodesy.interns import NN, _4_, _azimuth_, _center_, _COMMASPACE_, \
21
21
  _ecef_, _elevation_, _height_, _lat_, _lon_, \
@@ -29,14 +29,14 @@ from pygeodesy.props import deprecated_method, deprecated_Property_RO, \
29
29
  Property_RO, property_RO
30
30
  from pygeodesy.streprs import Fmt, fstr, strs, _xzipairs
31
31
  from pygeodesy.units import Bearing, Degrees, Degrees_, Height, _isDegrees, \
32
- _isMeter, Lat, Lon, Meter, Meter_, issubclassof
32
+ _isMeter, Lat, Lon, Meter, Meter_
33
33
  from pygeodesy.utily import atan2d, atan2b, sincos2_, sincos2d_, cos, radians
34
34
  from pygeodesy.vector3d import Vector3d
35
35
 
36
36
  # from math import cos, radians # from .utily
37
37
 
38
38
  __all__ = _ALL_LAZY.ltpTuples
39
- __version__ = '24.06.08'
39
+ __version__ = '24.06.28'
40
40
 
41
41
  _aer_ = 'aer'
42
42
  _alt_ = 'alt'
@@ -126,12 +126,12 @@ class _AbcBase(_NamedBase):
126
126
  '''Get the I{local} I{Azimuth, Elevation, slant Range} (AER) components.
127
127
 
128
128
  @kwarg Aer: Class to return AER (L{Aer}) or C{None}.
129
- @kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and
130
- optional, additional B{L{Aer}} keyword arguments,
131
- ignored if B{C{Aer}} is C{None}.
129
+ @kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and optional,
130
+ additional B{L{Aer}} keyword arguments, ignored if
131
+ C{B{Aer} is None}.
132
132
 
133
- @return: AER as an L{Aer} instance or if C{B{Aer} is None},
134
- an L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
133
+ @return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
134
+ L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
135
135
 
136
136
  @raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
137
137
  '''
@@ -141,12 +141,12 @@ class _AbcBase(_NamedBase):
141
141
  '''Get the I{local} I{East, North, Up} (ENU) components.
142
142
 
143
143
  @kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
144
- @kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and
145
- optional, additional B{L{Enu}} keyword arguments,
146
- ignored if C{B{Enu} is None}.
144
+ @kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
145
+ additional B{L{Enu}} keyword arguments, ignored if
146
+ C{B{Enu} is None}.
147
147
 
148
- @return: ENU as an L{Enu} instance or if C{B{Enu} is None},
149
- an L{Enu4Tuple}C{(east, north, up, ltp)}.
148
+ @return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
149
+ L{Enu4Tuple}C{(east, north, up, ltp)}.
150
150
 
151
151
  @raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
152
152
  '''
@@ -156,12 +156,12 @@ class _AbcBase(_NamedBase):
156
156
  '''Get the I{local} I{North, East, Down} (NED) components.
157
157
 
158
158
  @kwarg Ned: Class to return NED (L{Ned}) or C{None}.
159
- @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and
160
- optional, additional B{L{Ned}} keyword arguments,
161
- ignored if B{C{Ned}} is C{None}.
159
+ @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
160
+ additional B{L{Ned}} keyword arguments, ignored if
161
+ C{B{Ned} is None}.
162
162
 
163
- @return: NED as an L{Ned} instance or if C{B{Ned} is None},
164
- an L{Ned4Tuple}C{(north, east, down, ltp)}.
163
+ @return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
164
+ L{Ned4Tuple}C{(north, east, down, ltp)}.
165
165
 
166
166
  @raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
167
167
  '''
@@ -170,14 +170,14 @@ class _AbcBase(_NamedBase):
170
170
  def toXyz(self, Xyz=None, **name_Xyz_kwds):
171
171
  '''Get the local I{X, Y, Z} (XYZ) components.
172
172
 
173
- @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
174
- L{Ned}, L{Aer}) or C{None}.
175
- @kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and
176
- optional, additional B{C{Xyz}} keyword arguments,
177
- ignored if C{B{Xyz} is None}.
173
+ @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu}, L{Ned}, L{Aer})
174
+ or C{None}.
175
+ @kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and optional,
176
+ additional B{C{Xyz}} keyword arguments, ignored if
177
+ C{B{Xyz} is None}.
178
178
 
179
- @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
180
- an L{Xyz4Tuple}C{(x, y, z, ltp)}.
179
+ @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None}, an
180
+ L{Xyz4Tuple}C{(x, y, z, ltp)}.
181
181
 
182
182
  @raise TypeError: Invalid B{C{Xyz}} or B{C{name_Xyz_kwds}}.
183
183
  '''
@@ -209,7 +209,7 @@ class _Abc4Tuple(_NamedTuple):
209
209
  '''(INTERNAL) Convert 4-Tuple to C{Cls} instance.
210
210
  '''
211
211
  kwds = _name1__(Cls_kwds, _or_nameof=self)
212
- _is = issubclassof
212
+ _is = _MODS.basics.issubclassof
213
213
  if Cls is None:
214
214
  n, _ = _name2__(Cls_kwds)
215
215
  r = self.copy(name=n) if n else self
@@ -349,7 +349,7 @@ class Aer(_AbcBase):
349
349
  number of (decimal) digits, unstripped
350
350
  (C{int}), C{B{fmt}='[]'} the enclosing
351
351
  backets format (C{str}) and separator
352
- C{B{sep}=', '} to join (C{str}).
352
+ C{B{sep}=", "} to join (C{str}).
353
353
 
354
354
  @return: This AER as "[degrees360, degrees90, meter]" (C{str}).
355
355
  '''
@@ -572,7 +572,7 @@ class Ned(_AbcBase):
572
572
  number of (decimal) digits, unstripped
573
573
  (C{int}), C{B{fmt}='[]'} the enclosing
574
574
  backets format (C{str}) and separator
575
- C{B{sep}=', '} to join (C{str}).
575
+ C{B{sep}=", "} to join (C{str}).
576
576
 
577
577
  @return: This NED as "[meter, meter, meter]" (C{str}).
578
578
  '''
@@ -659,7 +659,7 @@ class _Vector3d(Vector3d):
659
659
  number of (decimal) digits, unstripped
660
660
  (C{int}), C{B{fmt}='[]'} the enclosing
661
661
  backets format (C{str}) and separator
662
- C{B{sep}=', '} to join (C{str}).
662
+ C{B{sep}=", "} to join (C{str}).
663
663
 
664
664
  @return: This XYZ as "[meter, meter, meter]" (C{str}).
665
665
  '''
@@ -824,18 +824,17 @@ class XyzLocal(_Vector3d):
824
824
 
825
825
  @kwarg Cartesian: Optional class to return C{(x, y, z)} (C{Cartesian})
826
826
  or C{None}.
827
- @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
828
- overriding this C{ltp}.
829
- @kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and
830
- optional, additional B{C{Cartesian}} keyword arguments,
831
- ignored if C{B{Cartesian} is None}.
827
+ @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}), overriding
828
+ this C{ltp}.
829
+ @kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and optional,
830
+ additional B{C{Cartesian}} keyword arguments, ignored if
831
+ C{B{Cartesian} is None}.
832
832
 
833
833
  @return: A B{C{Cartesian}} instance of if C{B{Cartesian} is None}, an
834
- L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
835
- with C{M=None}, always.
834
+ L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
835
+ C{M=None}, always.
836
836
 
837
- @raise TypeError: Invalid B{C{ltp}}, B{C{Cartesian}} or
838
- B{C{name_Cartesian_kwds}}.
837
+ @raise TypeError: Invalid B{C{ltp}}, B{C{Cartesian}} or B{C{name_Cartesian_kwds}}.
839
838
  '''
840
839
  ltp, kwds, n = self._ltp_kwds_name3(ltp, name_Cartesian_kwds)
841
840
  if Cartesian is None:
@@ -851,12 +850,12 @@ class XyzLocal(_Vector3d):
851
850
  '''Get the local I{East, North, Up} (ENU) components.
852
851
 
853
852
  @kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
854
- @kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and
855
- optional, additional B{C{Enu}} keyword arguments,
856
- ignored if C{B{Enu} is None}.
853
+ @kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
854
+ additional B{C{Enu}} keyword arguments, ignored if
855
+ C{B{Enu} is None}.
857
856
 
858
- @return: ENU as an L{Enu} instance or if C{B{Enu} is None},
859
- an L{Enu4Tuple}C{(east, north, up, ltp)}.
857
+ @return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
858
+ L{Enu4Tuple}C{(east, north, up, ltp)}.
860
859
 
861
860
  @raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
862
861
  '''
@@ -865,20 +864,19 @@ class XyzLocal(_Vector3d):
865
864
  def toLatLon(self, LatLon=None, ltp=None, **name_LatLon_kwds):
866
865
  '''Get the geodetic C{(lat, lon, height)} coordinates if this local.
867
866
 
868
- @kwarg LatLon: Optional class to return C{(x, y, z)} (C{LatLon})
869
- or C{None}.
870
- @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
871
- overriding this ENU/NED/AER/XYZ's LTP.
872
- @kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and
873
- optional, additional B{C{LatLon}} keyword arguments,
874
- ignored if C{B{LatLon} is None}.
867
+ @kwarg LatLon: Optional class to return C{(x, y, z)} (C{LatLon}) or
868
+ C{None}.
869
+ @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}), overriding
870
+ this ENU/NED/AER/XYZ's LTP.
871
+ @kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and optional,
872
+ additional B{C{LatLon}} keyword arguments, ignored if
873
+ C{B{LatLon} is None}.
875
874
 
876
875
  @return: An B{C{LatLon}} instance of if C{B{LatLon} is None}, an
877
- L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M,
878
- datum)} with C{M=None}, always.
876
+ L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
877
+ C{M=None}, always.
879
878
 
880
- @raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or
881
- B{C{name_LatLon_kwds}}.
879
+ @raise TypeError: Invalid B{C{LatLon}}, B{C{ltp}} or B{C{name_LatLon_kwds}}.
882
880
  '''
883
881
  ltp, kwds, n = self._ltp_kwds_name3(ltp, name_LatLon_kwds)
884
882
  t = ltp._local2ecef(self, nine=True)
@@ -895,9 +893,9 @@ class XyzLocal(_Vector3d):
895
893
  @kwarg M: Optionally include the rotation matrix (C{bool}).
896
894
  @kwarg name: Optional C{B{name}=NN} (C{str}).
897
895
 
898
- @return: L{Local9Tuple}C{(x, y, z, lat, lon, height, ltp,
899
- ecef, M)} with C{ltp} this C{Ltp}, C{ecef} an
900
- L{Ecef9Tuple} and C{M} L{EcefMatrix} or C{None}.
896
+ @return: L{Local9Tuple}C{(x, y, z, lat, lon, height, ltp, ecef, M)}
897
+ with C{ltp} this C{Ltp}, C{ecef} an L{Ecef9Tuple} and C{M}
898
+ an L{EcefMatrix} or C{None}.
901
899
  '''
902
900
  ltp = self.ltp # see C{self.toLatLon}
903
901
  t = ltp._local2ecef(self, nine=True, M=M)
@@ -909,12 +907,12 @@ class XyzLocal(_Vector3d):
909
907
  '''Get the local I{North, East, Down} (Ned) components.
910
908
 
911
909
  @kwarg Ned: Class to return NED (L{Ned}) or C{None}.
912
- @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and
913
- optional, additional B{C{Ned}} keyword arguments,
914
- ignored if C{B{Ned} is None}.
910
+ @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
911
+ additional B{C{Ned}} keyword arguments, ignored if
912
+ C{B{Ned} is None}.
915
913
 
916
- @return: NED as an L{Ned} instance or if C{B{Ned} is None},
917
- an L{Ned4Tuple}C{(north, east, down, ltp)}.
914
+ @return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
915
+ L{Ned4Tuple}C{(north, east, down, ltp)}.
918
916
 
919
917
  @raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
920
918
  '''
@@ -923,14 +921,14 @@ class XyzLocal(_Vector3d):
923
921
  def toXyz(self, Xyz=None, **name_Xyz_kwds):
924
922
  '''Get the local I{X, Y, Z} (XYZ) components.
925
923
 
926
- @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
927
- L{Ned}, L{Aer}) or C{None}.
928
- @kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and
929
- optional, additional B{C{Xyz}} keyword arguments,
930
- ignored if C{B{Xyz} is None}.
924
+ @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu}, L{Ned}, L{Aer})
925
+ or C{None}.
926
+ @kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and optional,
927
+ additional B{C{Xyz}} keyword arguments, ignored if
928
+ C{B{Xyz} is None}.
931
929
 
932
- @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
933
- an L{Xyz4Tuple}C{(x, y, z, ltp)}.
930
+ @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None}, an
931
+ L{Xyz4Tuple}C{(x, y, z, ltp)}.
934
932
 
935
933
  @raise TypeError: Invalid B{C{Xyz}} or B{C{name_EXyz_kwds}}.
936
934
  '''
@@ -1183,7 +1181,7 @@ class Local9Tuple(_NamedTuple):
1183
1181
  @kwarg Aer: Class to return AER (L{Aer}) or C{None}.
1184
1182
  @kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and optional,
1185
1183
  additional B{L{Aer}} keyword arguments, ignored if
1186
- B{C{Aer}} is C{None}.
1184
+ C{B{Aer} is None}.
1187
1185
 
1188
1186
  @return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
1189
1187
  L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
@@ -1247,7 +1245,7 @@ class Local9Tuple(_NamedTuple):
1247
1245
  @kwarg Ned: Class to return NED (L{Ned}) or C{None}.
1248
1246
  @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
1249
1247
  additional B{L{Ned}} keyword arguments, ignored if
1250
- B{C{Ned}} is C{None}.
1248
+ C{B{Ned} is None}.
1251
1249
 
1252
1250
  @return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
1253
1251
  L{Ned4Tuple}C{(north, east, down, ltp)}.
pygeodesy/mgrs.py CHANGED
@@ -55,7 +55,7 @@ from pygeodesy.utm import toUtm8, _to3zBlat, Utm, _UTM_ZONE_MAX, _UTM_ZONE_MIN
55
55
  # from pygeodesy.utmupsBase import _UTM_ZONE_MAX, _UTM_ZONE_MIN # from .utm
56
56
 
57
57
  __all__ = _ALL_LAZY.mgrs
58
- __version__ = '24.06.04'
58
+ __version__ = '24.06.11'
59
59
 
60
60
  _AN_ = 'AN' # default south pole grid tile and band B
61
61
  _AtoPx_ = _AtoZnoIO_.tillP
@@ -596,18 +596,17 @@ def toMgrs(utmups, Mgrs=Mgrs, **name_Mgrs_kwds):
596
596
  @arg utmups: A UTM or UPS coordinate (L{Utm}, L{Etm} or L{Ups}).
597
597
  @kwarg Mgrs: Optional class to return the MGRS grid reference
598
598
  (L{Mgrs}) or C{None}.
599
- @kwarg name_Mgrs_kwds: Optional C{B{name}=NN} (C{str}) and
600
- optional, additional B{C{Mgrs}} keyword arguments,
601
- ignored if C{B{Mgrs} is None}.
599
+ @kwarg name_Mgrs_kwds: Optional C{B{name}=NN} (C{str}) and optional,
600
+ additional B{C{Mgrs}} keyword arguments, ignored if
601
+ C{B{Mgrs} is None}.
602
602
 
603
- @return: The MGRS grid reference as B{C{Mgrs}} or if C{B{Mgrs}
604
- is None} as an L{Mgrs6Tuple}C{(zone, EN, easting,
605
- northing, band, datum)}.
603
+ @return: The MGRS grid reference as B{C{Mgrs}} or if C{B{Mgrs} is
604
+ None} as an L{Mgrs6Tuple}C{(zone, EN, easting, northing,
605
+ band, datum)}.
606
606
 
607
607
  @raise MGRSError: Invalid B{C{utmups}}.
608
608
 
609
- @raise TypeError: If B{C{utmups}} is not L{Utm} nor L{Etm}
610
- nor L{Ups}.
609
+ @raise TypeError: If B{C{utmups}} is not L{Utm}, L{Etm} nor L{Ups}.
611
610
  '''
612
611
  # _MODS.utmups.utmupsValidate(utmups, MGRS=True, Error-MGRSError)
613
612
  _xinstanceof(Utm, Ups, utmups=utmups) # Utm, Etm, Ups
pygeodesy/named.py CHANGED
@@ -34,7 +34,7 @@ from pygeodesy.streprs import attrs, Fmt, lrstrip, pairs, reprs, unstr
34
34
  # from pygeodesy.units import _toUnit # _MODS
35
35
 
36
36
  __all__ = _ALL_LAZY.named
37
- __version__ = '24.06.10'
37
+ __version__ = '24.06.24'
38
38
 
39
39
  _COMMANL_ = _COMMA_ + _NL_
40
40
  _COMMASPACEDOT_ = _COMMASPACE_ + _DOT_
@@ -72,6 +72,15 @@ class ADict(dict):
72
72
  '''
73
73
  return self.toRepr()
74
74
 
75
+ def __setattr__(self, name, value):
76
+ '''Set the value of a I{known} item by B{C{name}}.
77
+ '''
78
+ try:
79
+ if self[name] != value:
80
+ self[name] = value
81
+ except KeyError:
82
+ dict.__setattr__(self, name, value)
83
+
75
84
  def __str__(self):
76
85
  '''Default C{str(self)}.
77
86
  '''
@@ -241,15 +250,16 @@ class _Named(object):
241
250
  # _update_all(d)
242
251
  return d
243
252
 
244
- def _instr(self, name, prec, *attrs, **fmt_props_kwds):
245
- '''(INTERNAL) Format, used by C{Conic}, C{Ellipsoid}, C{Transform}, C{Triaxial}.
253
+ def _instr(self, *attrs, **fmt_prec_props_sep_name__kwds):
254
+ '''(INTERNAL) Format, used by C{Conic}, C{Ellipsoid}, C{Geodesic...}, C{Transform}, C{Triaxial}.
246
255
  '''
247
- def _fmt_props_kwds(fmt=Fmt.F, props=(), **kwds):
248
- return fmt, props, kwds
256
+ def _fmt_prec_props_kwds(fmt=Fmt.F, prec=6, props=(), sep=_COMMASPACE_, **kwds):
257
+ return fmt, prec, props, sep, kwds
249
258
 
250
- fmt, props, kwds = _fmt_props_kwds(**fmt_props_kwds)
259
+ name, kwds = _name2__(**fmt_prec_props_sep_name__kwds)
260
+ fmt, prec, props, sep, kwds = _fmt_prec_props_kwds(**kwds)
251
261
 
252
- t = () if name is None else (Fmt.EQUAL(name=repr(self._name__(name))),)
262
+ t = () if name is None else (Fmt.EQUAL(name=repr(name or self.name)),)
253
263
  if attrs:
254
264
  t += pairs(((a, getattr(self, a)) for a in attrs),
255
265
  prec=prec, ints=True, fmt=fmt)
@@ -258,7 +268,7 @@ class _Named(object):
258
268
  prec=prec, ints=True)
259
269
  if kwds:
260
270
  t += pairs(kwds, prec=prec)
261
- return _COMMASPACE_.join(t)
271
+ return sep.join(t) if sep else t
262
272
 
263
273
  @property_RO
264
274
  def iteration(self): # see .karney.GDict
@@ -1090,8 +1100,7 @@ class _NamedTuple(tuple, _Named):
1090
1100
  '''Yield the items, each as a C{2-tuple (name, value}) with the
1091
1101
  value wrapped as an instance of its L{units} class.
1092
1102
 
1093
- @kwarg Error: Optional C{B{Error}=UnitError} to raise for
1094
- L{units} issues.
1103
+ @kwarg Error: Optional C{B{Error}=UnitError} to raise.
1095
1104
 
1096
1105
  @raise Error: Invalid C{Named-Tuple} item or L{units} class.
1097
1106
 
pygeodesy/nvectorBase.py CHANGED
@@ -14,7 +14,7 @@ and published under the same MIT Licence**, see U{Vector-based geodesy
14
14
  from pygeodesy.constants import EPS, EPS1, EPS_2, R_M, _2_0, _N_2_0
15
15
  # from pygeodesy.datums import _spherical_datum # from .formy
16
16
  from pygeodesy.errors import IntersectionError, _ValueError, VectorError, \
17
- _xkwds, _xkwds_pop2
17
+ _xattrs, _xkwds, _xkwds_pop2
18
18
  from pygeodesy.fmath import fdot, fidw, hypot_ # PYCHOK fdot shared
19
19
  from pygeodesy.fsums import Fsum, fsumf_
20
20
  from pygeodesy.formy import _isequalTo, n_xyz2latlon, n_xyz2philam, \
@@ -30,7 +30,7 @@ from pygeodesy.namedTuples import Trilaterate5Tuple, Vector3Tuple, \
30
30
  Vector4Tuple, map1
31
31
  from pygeodesy.props import deprecated_method, Property_RO, property_doc_, \
32
32
  property_RO, _update_all
33
- from pygeodesy.streprs import Fmt, hstr, unstr, _xattrs
33
+ from pygeodesy.streprs import Fmt, hstr, unstr
34
34
  from pygeodesy.units import Bearing, Height, Radius_, Scalar
35
35
  from pygeodesy.utily import sincos2d, _unrollon, _unrollon3
36
36
  from pygeodesy.vector3d import Vector3d, _xyzhdlln4
@@ -38,7 +38,7 @@ from pygeodesy.vector3d import Vector3d, _xyzhdlln4
38
38
  from math import fabs, sqrt
39
39
 
40
40
  __all__ = _ALL_LAZY.nvectorBase
41
- __version__ = '24.06.06'
41
+ __version__ = '24.06.12'
42
42
 
43
43
 
44
44
  class NvectorBase(Vector3d): # XXX kept private
@@ -53,10 +53,9 @@ class NvectorBase(Vector3d): # XXX kept private
53
53
 
54
54
  @arg x_xyz: X component of vector (C{scalar}) or (3-D) vector
55
55
  (C{Nvector}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
56
- @kwarg y: Y component of vector (C{scalar}), ignored if B{C{x_xyz}} is not
57
- C{scalar}, otherwise same units as B{C{x_xyz}}.
58
- @kwarg z: Z component of vector (C{scalar}), ignored if B{C{x_xyz}} is not
59
- C{scalar}, otherwise same units as B{C{x_xyz}}.
56
+ @kwarg y: Y component of vector (C{scalar}), required if B{C{x_xyz}} is
57
+ C{scalar} and same units as B{C{x_xyz}}, ignored otherwise.
58
+ @kwarg z: Z component of vector (C{scalar}), like B{C{y}}.
60
59
  @kwarg h: Optional height above surface (C{meter}).
61
60
  @kwarg datum: Optional, I{pass-thru} datum (L{Datum}).
62
61
  @kwarg ll_name: Optional C{B{name}=NN} (C{str}) and optional, original
@@ -346,7 +345,7 @@ class NvectorBase(Vector3d): # XXX kept private
346
345
  def toVector3d(self, norm=True):
347
346
  '''Convert this n-vector to a 3-D vector, I{ignoring height}.
348
347
 
349
- @kwarg norm: Normalize the 3-D vector (C{bool}).
348
+ @kwarg norm: If C{True}, normalize the 3-D vector (C{bool}).
350
349
 
351
350
  @return: The (normalized) vector (L{Vector3d}).
352
351
  '''
@@ -366,7 +365,7 @@ class NvectorBase(Vector3d): # XXX kept private
366
365
 
367
366
  @return: Normalized vector (C{Nvector}).
368
367
  '''
369
- return _xattrs(Vector3d.unit(self, ll=ll), _under(_h_))
368
+ return _xattrs(Vector3d.unit(self, ll=ll), self, _under(_h_))
370
369
 
371
370
  @Property_RO
372
371
  def xyzh(self):
@@ -572,7 +571,7 @@ def sumOf(nvectors, Vector=None, h=None, **Vector_kwds):
572
571
  arguments, ignored if C{B{Vector} is None}.
573
572
 
574
573
  @return: Vectorial sum (B{C{Vector}}) or a L{Vector4Tuple}C{(x, y,
575
- z, h)} if B{C{Vector}} is C{None}.
574
+ z, h)} if C{B{Vector} is None}.
576
575
 
577
576
  @raise VectorError: No B{C{nvectors}}.
578
577
  '''
pygeodesy/osgr.py CHANGED
@@ -46,14 +46,14 @@ from pygeodesy.namedTuples import EasNor2Tuple, LatLon2Tuple, \
46
46
  from pygeodesy.props import Property_RO, property_RO
47
47
  from pygeodesy.streprs import _EN_WIDE, enstr2, _enstr2m3, Fmt, \
48
48
  _resolution10, unstr, _xzipairs
49
- from pygeodesy.units import Easting, Lam_, Lat, Lon, Northing, \
50
- Phi_, Scalar, _10um, _100km
49
+ from pygeodesy.units import Easting, Lamd, Lat, Lon, Northing, \
50
+ Phid, Scalar, _10um, _100km
51
51
  from pygeodesy.utily import degrees90, degrees180, sincostan3, truncate
52
52
 
53
53
  from math import cos, fabs, radians, sin, sqrt
54
54
 
55
55
  __all__ = _ALL_LAZY.osgr
56
- __version__ = '24.05.31'
56
+ __version__ = '24.06.15'
57
57
 
58
58
  _equivalent_ = 'equivalent'
59
59
  _OSGR_ = 'OSGR'
@@ -108,7 +108,7 @@ class _NG(object):
108
108
 
109
109
  @Property_RO
110
110
  def lam0(self): # True origin longitude C{radians}
111
- return Lam_(self.lon0)
111
+ return Lamd(self.lon0)
112
112
 
113
113
  @Property_RO
114
114
  def lat0(self): # True origin latitude, 49°N
@@ -160,7 +160,7 @@ class _NG(object):
160
160
 
161
161
  @Property_RO
162
162
  def phi0(self): # True origin latitude C{radians}
163
- return Phi_(self.lat0)
163
+ return Phid(self.lat0)
164
164
 
165
165
  def reverse(self, osgr): # convert C{osgr} to (ellipsoidal} LatLon, as I{Karney}'s
166
166
  # U{Reverse<https://GeographicLib.SourceForge.io/C++/doc/OSGB_8hpp_source.html>}
@@ -296,7 +296,7 @@ class Osgr(_NamedBase):
296
296
  @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
297
297
  arguments, ignored if C{B{LatLon} is None}.
298
298
 
299
- @return: A B{C{LatLon}} instance or if B{C{LatLon}} is C{None}
299
+ @return: A B{C{LatLon}} instance or if C{B{LatLon} is None}
300
300
  a L{LatLonDatum3Tuple}C{(lat, lon, datum)}.
301
301
 
302
302
  @note: While OS grid references are based on the OSGB36 datum,
@@ -520,8 +520,8 @@ def parseOSGR(strOSGR, Osgr=Osgr, **name_Osgr_kwds):
520
520
  optional, additional B{C{Osgr}} keyword arguments,
521
521
  ignored if C{B{Osgr} is None}.
522
522
 
523
- @return: An (B{C{Osgr}}) instance or if B{C{Osgr}} is
524
- C{None} an L{EasNor2Tuple}C{(easting, northing)}.
523
+ @return: An (B{C{Osgr}}) instance or if C{B{Osgr} is None}, an
524
+ L{EasNor2Tuple}C{(easting, northing)}.
525
525
 
526
526
  @raise OSGRError: Invalid B{C{strOSGR}}.
527
527
  '''
@@ -598,7 +598,7 @@ def toOsgr(latlon, lon=None, kTM=False, datum=_WGS84, Osgr=Osgr, # MCCABE 14
598
598
  and additional B{C{Osgr}} keyword arguments,
599
599
  ignored if C{B{Osgr} is None}.
600
600
 
601
- @return: An (B{C{Osgr}}) instance or if B{C{Osgr}} is C{None}
601
+ @return: An (B{C{Osgr}}) instance or if C{B{Osgr} is None}
602
602
  an L{EasNor2Tuple}C{(easting, northing)}.
603
603
 
604
604
  @note: If L{isint}C{(B{prec})} both easting and northing are
pygeodesy/points.py CHANGED
@@ -62,7 +62,7 @@ from pygeodesy.utily import atan2b, degrees90, degrees180, degrees2m, \
62
62
  from math import cos, fabs, fmod as _fmod, radians, sin
63
63
 
64
64
  __all__ = _ALL_LAZY.points
65
- __version__ = '24.06.06'
65
+ __version__ = '24.06.15'
66
66
 
67
67
  _ilat_ = 'ilat'
68
68
  _ilon_ = 'ilon'
@@ -391,7 +391,7 @@ class _Array2LatLon(_Basequence): # immutable, on purpose
391
391
  # check the attr indices
392
392
  for n, (ai, i) in enumerate(ais):
393
393
  if not isint(i):
394
- raise _IsnotError(int.__name__, **{ai: i})
394
+ raise _IsnotError(int, **{ai: i})
395
395
  i = int(i)
396
396
  if not 0 <= i < shape[1]:
397
397
  raise _ValueError(ai, i)
@@ -959,8 +959,8 @@ def areaOf(points, adjust=True, radius=R_M, wrap=True):
959
959
  the B{C{points}} (C{bool}).
960
960
 
961
961
  @return: Approximate area (I{square} C{meter}, same units as
962
- B{C{radius}} or C{radians} I{squared} if B{C{radius}}
963
- is C{None}).
962
+ B{C{radius}} or C{radians} I{squared} if C{B{radius}
963
+ is None}).
964
964
 
965
965
  @raise PointsError: Insufficient number of B{C{points}}
966
966
 
@@ -992,8 +992,8 @@ def boundsOf(points, wrap=False, LatLon=None): # was=True
992
992
  @kwarg LatLon: Optional class to return the C{bounds}
993
993
  corners (C{LatLon}) or C{None}.
994
994
 
995
- @return: A L{Bounds2Tuple}C{(latlonSW, latlonNE)} as
996
- B{C{LatLon}}s if B{C{LatLon}} is C{None} a
995
+ @return: A L{Bounds2Tuple}C{(latlonSW, latlonNE)}, each
996
+ a B{C{LatLon}} or if C{B{LatLon} is None}, a
997
997
  L{Bounds4Tuple}C{(latS, lonW, latN, lonE)}.
998
998
 
999
999
  @raise PointsError: Insufficient number of B{C{points}}
@@ -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.05.24'
12
+ __version__ = '24.06.18'
13
13
 
14
14
  if _unLazy0: # or _isfrozen
15
15
  from pygeodesy.rhumb.aux_ import RhumbAux, RhumbLineAux
pygeodesy/rhumb/aux_.py CHANGED
@@ -47,7 +47,7 @@ from pygeodesy.rhumb.bases import RhumbBase, RhumbLineBase, \
47
47
  from math import ceil as _ceil, fabs, radians
48
48
 
49
49
  __all__ = _ALL_LAZY.rhumb_aux_
50
- __version__ = '24.05.29'
50
+ __version__ = '24.06.11'
51
51
 
52
52
  # DIGITS = (sizeof(real) * 8) bits
53
53
  # = (ctypes.sizeof(ctypes.c_double(1.0)) * 8) bits
@@ -74,14 +74,14 @@ class RhumbAux(RhumbBase):
74
74
  @kwarg a_earth: This rhumb's earth model (L{Datum}, L{Ellipsoid},
75
75
  L{Ellipsoid2}, L{a_f2Tuple}, 2-tuple C{(a, f)}) or
76
76
  the (equatorial) radius (C{meter}, conventionally).
77
- @kwarg f: The ellipsoid's flattening (C{scalar}), iff B{C{a_earth}} is
78
- C{scalar}, ignored otherwise.
77
+ @kwarg f: The ellipsoid's flattening (C{scalar}), required if B{C{a_earth}}
78
+ is C{scalar}, ignored otherwise.
79
79
  @kwarg exact: If C{True}, use the exact expressions for the I{Auxiliary
80
80
  Latitudes}, otherwise use the I{Fourier} series expansion
81
81
  (C{bool}), see also property C{exact}.
82
82
  @kwarg TMorder_name: Optional C{B{name}=NN} (C{str}) and optional
83
- keyword argument C{B{TMorder}=6} for the order of
84
- the L{KTransverseMercator}, see property C{TMorder}.
83
+ keyword argument C{B{TMorder}=6}, the order of the
84
+ L{KTransverseMercator}, see property C{TMorder}.
85
85
 
86
86
  @raise ImportError: Package C{numpy} not found or not installed, only
87
87
  required for area C{S12} when C{B{exact} is True}.