Coverage for pygeodesy/__init__.py: 98%

193 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-03-25 15:01 -0400

1 

2# -*- coding: utf-8 -*- 

3 

4u'''A pure Python implementation of geodesy tools for various ellipsoidal and spherical earth models 

5using precision exact, elliptic, trigonometric, vector-based, iterative and approximate methods for 

6geodetic (lat-/longitude), geocentric (U{ECEF<https://WikiPedia.org/wiki/ECEF>} cartesian), local (U{LTP 

7<https://WikiPedia.org/wiki/Local_tangent_plane_coordinates>}) and certain U{triaxial ellipsoidal 

8<https://GeographicLib.SourceForge.io/1.44/triaxial.html>} coordinates. 

9 

10Transcoded in part from U{JavaScript originals<https://GitHub.com/ChrisVeness/geodesy>} by I{Chris Veness (C) 

112005-2025} and from several U{C++ classes<https://GeographicLib.SourceForge.io/C++/doc/annotated.html>} by I{Charles 

12F. F. Karney (C) 2008-2025} and published under the same U{MIT License<https://OpenSource.org/licenses/MIT>}**. 

13 

14There are four modules for ellipsoidal earth models, C{ellipsoidalExact}, C{-Karney}, C{-Vincenty} and C{-Nvector} 

15and two for spherical ones, C{sphericalTrigonometry} and C{-Nvector}. Each module provides a geodetic B{C{LatLon}} 

16and a geocentric B{C{Cartesian}} class with methods and functions to compute distance, surface area, perimeter, 

17forward and reverse azimuth, initial and final bearing, intermediate and nearest points, intersections of geodesic, 

18great circle and rhumb lines, circle intersections and secants, U{3-point resections 

19<https://WikiPedia.org/wiki/Position_resection_and_intersection>}, triangulation, trilateration (by intersection, 

20by overlap and in 3-D), among other things. 

21 

22Also included are modules for conversions to and from U{Cassini-Soldner 

23<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1CassiniSoldner.html>}, 

24U{ECEF<https://WikiPedia.org/wiki/ECEF>} (Earth-Centered, Earth-Fixed cartesian), U{UTM 

25<https://www.Movable-Type.co.UK/scripts/latlong-utm-mgrs.html>} (Universal Transverse Mercator 

26and U{Exact<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1TransverseMercatorExact.html>}), 

27U{UPS<https://WikiPedia.org/wiki/Universal_polar_stereographic_coordinate_system>} (Universal Polar 

28Stereographic) and U{Web Mercator<https://WikiPedia.org/wiki/Web_Mercator>} (Pseudo-Mercator) coordinates, 

29U{MGRS<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1MGRS.html>} (Military Grid Reference 

30System, UTM I{and} UPS) and U{OSGR<https://www.Movable-Type.co.UK/scripts/latlong-os-gridref.html>} (British 

31Ordinance Survery Grid Reference) grid references, U{TRF<http://ITRF.ENSG.IGN.Fr>} (Terrestrial Reference 

32Frames) and modules to encode and decode U{EPSG<https://EPSG.org>}, U{Geohashes 

33<https://www.Movable-Type.co.UK/scripts/geohash.html>}, U{Georefs (WGRS) 

34<https://WikiPedia.org/wiki/World_Geographic_Reference_System>} and U{Garefs (GARS) 

35<https://WikiPedia.org/wiki/Global_Area_Reference_System>}. 

36 

37Other modules provide U{Albers equal-area 

38<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1AlbersEqualArea.html>} projections, U{equidistant 

39<https://GeographicLib.SourceForge.io/C++/doc/classGeographicLib_1_1AzimuthalEquidistant.html>} and other I{azimuthal} 

40projections, Lambert I{conformal conic} projections and positions, functions to clip paths or polygons of C{LatLon} 

41points using the U{Cohen-Sutherland<https://WikiPedia.org/wiki/Cohen-Sutherland_algorithm>}, 

42U{Forster-Hormann-Popa<https://www.ScienceDirect.com/science/article/pii/S259014861930007X>}, 

43U{Greiner-Hormann<http://www.inf.USI.CH/hormann/papers/Greiner.1998.ECO.pdf>}, 

44U{Liang-Barsky<https://www.CS.Helsinki.FI/group/goa/viewing/leikkaus/intro.html>} and 

45U{Sutherland-Hodgman<https://WikiPedia.org/wiki/Sutherland-Hodgman_algorithm>} methods, 

46functions to U{simplify<https://Bost.Ocks.org/mike/simplify>} or linearize a path of C{LatLon} 

47points (or a U{NumPy array<https://docs.SciPy.org/doc/numpy/reference/generated/numpy.array.html>}), 

48including implementations of the U{Ramer-Douglas-Peucker<https://WikiPedia.org/wiki/ 

49Ramer-Douglas-Peucker_algorithm>}, the U{Visvalingam-Whyatt<https://hydra.Hull.ac.UK/ 

50resources/hull:8338>} and the U{Reumann-Witkam<https://psimpl.SourceForge.net/reumann-witkam.html>} 

51algorithms and modified versions of the former. 

52 

53Plus modules and classes to U{interpolate<https://docs.SciPy.org/doc/scipy/reference/interpolate.html>} the 

54L{height<pygeodesy.heights>} of C{LatLon} points and L{Geoid<pygeodesy.geoids>} models, to compute various U{Fréchet 

55<https://WikiPedia.org/wiki/Frechet_distance>} or U{Hausdorff<https://WikiPedia.org/wiki/Hausdorff_distance>} 

56distances or to perform I{boolean} operations between (composite) polygons of C{LatLon} points. 

57 

58For further details see the U{documentation<https://mrJean1.GitHub.io/PyGeodesy>}, the descriptions of 

59U{Latitude/Longitude<https://www.Movable-Type.co.UK/scripts/latlong.html>}, U{Vincenty 

60<https://www.Movable-Type.co.UK/scripts/latlong-vincenty.html>} and U{Vector-based 

61<https://www.Movable-Type.co.UK/scripts/latlong-vectors.html>} geodesy, the original U{JavaScript source 

62<https://GitHub.com/ChrisVeness/geodesy>} or U{docs<https://www.Movable-Type.co.UK/scripts/geodesy/docs>} 

63and I{Karney}'s Python U{geographiclib<https://PyPI.org/project/geographiclib>} and C++ U{GeographicLib 

64<https://GeographicLib.SourceForge.io/C++/doc/index.html>}. 

65 

66Installation 

67============ 

68 

69To install C{pygeodesy}, type C{python[3] -m pip install pygeodesy} or C{python[3] -m easy_install 

70pygeodesy} in a terminal or command window. 

71 

72If the wheel C{pygeodesy-yy.m.d-py2.py3-none-any.whl} is missing in U{PyPI Download files<https:// 

73PyPI.org/project/pygeodesy/#files>}, download the file from U{GitHub/dist<https://GitHub.com/mrJean1/ 

74PyGeodesy/tree/master/dist>}. Install that with C{python[3] -m pip install <path-to-downloaded-wheel>} 

75and verify with C{python[3] -m pygeodesy}. 

76 

77Alternatively, download C{pygeodesy-yy.m.d.tar.gz} from U{PyPI<https://PyPI.org/project/pygeodesy>} 

78or U{GitHub<https://GitHub.com/mrJean1/PyGeodesy>}, C{unzip} the downloaded file, C{cd} to 

79directory C{pygeodesy-yy.m.d} and type C{python[3] setup.py install}. 

80 

81To run all C{pygeodesy} tests, type C{python[3] test/run.py} or type C{python[3] test/unitTestSuite.py} 

82before or after installation. 

83 

84Dependencies 

85============ 

86 

87Installation of I{Karney}'s Python package U{geographiclib<https://PyPI.org/project/geographiclib>} 

88is optional, but required for module L{ellipsoidalKarney}, L{azimuthal} classes L{EquidistantKarney} 

89and L{GnomonicKarney} and the L{HeightIDWkarney} interpolator. 

90 

91Both U{numpy<https://PyPI.org/project/numpy>} and U{scipy<https://PyPI.org/project/scipy>} must be 

92installed for most L{Geoid...<pygeodesy.geoids>} and L{Height...<pygeodesy.heights>} interpolators, 

93except L{GeoidKarney} and the L{HeightIDW...<pygeodesy.heights>} ones. 

94 

95Functions and C{LatLon} methods L{circin6}, L{circum3}, L{circum4_} and L{soddy4} and functions 

96L{triaxum5} and L{trilaterate3d2} require U{numpy<https://PyPI.org/project/numpy>} to be installed, 

97modules L{auxilats} and L{rhumb} may need U{numpy<https://PyPI.org/project/numpy>}. 

98 

99Modules L{ellipsoidalGeodSolve} and L{geodsolve} and L{azimuthal} classes L{EquidistantGeodSolve} 

100and L{GnomonicGeodSolve} depend on I{Karney}'s C++ utility U{GeodSolve 

101<https://GeographicLib.SourceForge.io/C++/doc/GeodSolve.1.html>} to be executable and set with 

102env variable C{PYGEODESY_GEODSOLVE} or with property L{Ellipsoid.geodsolve}. 

103 

104Triaxial geodesic classes L{Geodesic3Solve} and L{GeodesicLine3Solve} in module L{geod3solve} need 

105I{Karney}'s C++ utility U{Geod3Solve<https://GeographicLib.SourceForge.io/C++/doc/Geod3Solve.1.html>} 

106to be executable and set with env variable C{PYGEODESY_GEOD3SOLVE} or with property 

107L{Geodesic3Solve.Geod3Solve<geod3solve._Geodesic3SolveBase.Geod3Solve>}. 

108 

109Class L{Intersectool} in module L{geodesici} needs I{Karney}'s C++ utility U{IntersectTool 

110<https://GeographicLib.SourceForge.io/C++/doc/IntersectTool.1.html>} to be executable and set with 

111env variable C{PYGEODESY_INTERSECTTOOL} or with property L{Intersectool.IntersectTool 

112<geodesici.Intersectool.IntersectTool>}. 

113 

114To compare C{MGRS} results from modules L{mgrs} and C{testMgrs} with I{Karney}'s C++ utility 

115U{GeoConvert<https://GeographicLib.SourceForge.io/C++/doc/GeoConvert.1.html>}, the latter must 

116be executable and set with env variable C{PYGEODESY_GEOCONVERT}. 

117 

118Module L{rhumb.solve} needs I{Karney}'s C++ utility U{RhumbSolve 

119<https://GeographicLib.SourceForge.io/C++/doc/RhumbSolve.1.html>} to be executable and set with 

120env variable C{PYGEODESY_RHUMBSOLVE} or with property L{Ellipsoid.rhumbsolve}. 

121 

122Documentation 

123============= 

124 

125In addition to the C{pygeodesy} package, the U{pygeodesy<https://PyPI.org/project/pygeodesy>} 

126U{distribution files<https://GitHub.com/mrJean1/PyGeodesy/tree/master/dist>} contain the tests, 

127the test results (on macOS only) and the complete U{documentation<https://mrJean1.GitHub.io/PyGeodesy>} 

128(generated by U{Epydoc<https://PyPI.org/project/epydoc>} using command line: 

129C{epydoc --html --no-private --no-source --name=pygeodesy --url=... -v pygeodesy}). 

130 

131Tests 

132===== 

133 

134The tests ran with Python 3.14.3 (with U{geographiclib<https://PyPI.org/project/geographiclib>} 2.1), 

135Python 3.13.12 (with U{geographiclib<https://PyPI.org/project/geographiclib>} 2.1), 

136U{numpy<https://PyPI.org/project/numpy>} 2.3.3, U{scipy<https://PyPI.org/project/scipy>} 1.16.2, 

137U{GeoConvert<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7 and 

138U{GeodSolve<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7), 

139Python 3.12.10 (with U{geographiclib<https://PyPI.org/project/geographiclib>} 2.0, 

140U{numpy<https://PyPI.org/project/numpy>} 2.1.0, U{scipy<https://PyPI.org/project/scipy>} 1.14.1, 

141U{GeodSolve<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7, 

142U{GeodS3olve<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7, 

143U{IntersectTool<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7 and 

144U{RhumbSolve<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7), 

145Python 3.11.9 (with U{geographiclib<https://PyPI.org/project/geographiclib>} 2.0, 

146U{numpy<https://PyPI.org/project/numpy>} 1.24.2 and U{scipy<https://PyPI.org/project/scipy>} 1.10.1), 

147and with Python 2.7.18 (with U{geographiclib<https://PyPI.org/project/geographiclib>} 1.50, 

148U{numpy<https://PyPI.org/project/numpy>} 1.16.6, U{scipy<https://PyPI.org/project/scipy>} 1.2.2, 

149U{GeoConvert<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7, 

150U{GeodSolve<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7, 

151U{Geod3Solve<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7, 

152U{IntersectTool<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7 and 

153U{RhumbSolve<https://GeographicLib.SourceForge.io/C++/doc/utilities.html>} 2.7), all in 64-bit on 

154macOS 26.3 Tahoe. 

155 

156All tests ran with and without C{lazy import} for Python 3 and with command line option C{-W default} and 

157env variable C{PYGEODESY_WARNINGS=on} for all Python versions. The results of those tests are included in 

158the distribution files. 

159 

160Test coverage has been measured with U{coverage<https://PyPI.org/project/coverage>} 7.10.7 using Python 

1613.14.3, 3.13.12 and 3.12.10. The complete coverage report in HTML and a PDF summary are included in the 

162distribution files. 

163 

164Python 3.14.3, 3.13.12, 3.12.10 and 3.11.9 run on Apple Si M4 (C{arm64}), I{natively}. Python 2.7.18 runs 

165on Intel (C{x86_64}) or Intel I{emulation} ("C{arm64_x86_64}", see function L{machine<pygeodesy.machine>}). 

166 

167The tests also ran with Python 3.14.3 (and U{geographiclib<https://PyPI.org/project/geographiclib>} 2.1) on 

168U{Debian 12<https://Cirrus-CI.com/github/mrJean1/PyGeodesy/master>} in 64-bit only, with Python 3.13.12 (and 

169U{geographiclib<https://PyPI.org/project/geographiclib>} 2.0) on U{Windows 2019Server 

170<https://CI.AppVeyor.com/project/mrJean1/pygeodesy>} in 64-bit only and with Python 2.7.18 (and U{geographiclib 

171<https://PyPI.org/project/geographiclib>} 1.52) on U{Windows 10<https://CI.AppVeyor.com/project/mrJean1/pygeodesy>} 

172in 64- and 32-bit. 

173 

174A single-File and single-Directory application with C{pygeodesy} has been bundled using U{PyInstaller 

175<https://PyPI.org/project/pyinstaller>} 3.4 and 64-bit Python 3.7.3 on macOS 10.13.6 High Sierra. 

176 

177Previously, the tests were run with Python 3.13.0-9, 3.12.0-7, 3.11.2-5, 3.10.1-7, 3.9.6, 3.9.1, 3.8.7, 3.7.1, 2.7.15, 

178U{PyPy<https://PyPy.org>} 7.3.12 (Python 3.10.12), 7.3.1 (Python 3.6.9) and U{PyPy<https://PyPy.org>} 7.1.1 (Python 

1792.7.13) (and U{geographiclib <https://PyPI.org/project/geographiclib>} 1.52, U{numpy<https://PyPI.org/project/numpy>} 

1801.16.3, 1.16.4, 1.16.6, 1.19.0, 1.19.4, 1.19.5 or 1.22.4 and U{scipy<https://PyPI.org/project/scipy>} 1.2.1, 1.4.1, 

1811.5.2 or 1.8.1) on U{Ubuntu 16.04<https://Travis-CI.com/mrJean1/PyGeodesy>}, with Python 3.10.0-1, 3.9.0-5, 3.8.0-6, 

1823.7.2-6, 3.7.0, 3.6.2-5, 3.5.3, 2.7.13-17, 2.7.10 and 2.6.9 (and U{numpy<https://PyPI.org/project/numpy>} 1.19.0, 

1831.16.5, 1.16.2, 1.15.2, 1.14.0, 1.13.1, 1.8.0rc1 or 1.6.2 and U{scipy<https://PyPI.org/project/scipy>} 1.5.0), U{PyPy 

184<https://PyPy.org>} 7.3.0 (Python 2.7.13 and 3.6.9), U{PyPy<https://PyPy.org>} 6.0.0 (Python 2.7.13 and 3.5.3) 

185and U{Intel-Python<https://software.Intel.com/en-us/distribution-for-python>} 3.5.3 (and U{numpy 

186<https://PyPI.org/project/numpy>} 1.11.3) on macOS 15.0-6 Sequoia, 14.0-6.1 Sonoma, 13.0-5.2 Ventura, 12.1-6 Monterey, 

18711.0-5.2-6.1 Big Sur (aka 10.16), 10.15.3, 10.15.5-7 Catalina, 10.14 Mojave, 10.13.6 High Sierra and 10.12 Sierra, 

188MacOS X 10.11 El Capitan and/or MacOS X 10.10 Yosemite, with U{Pythonista<https://OMZ-Software.com/pythonista>}3.2 

189(with geographiclib 1.50 or 1.49 and numpy 1.8.0) on iOS 14.4.2, 11.4.1, 12.0-3 on iPad4, iPhone6, iPhone10 and/or 

190iPhone12, with U{Pythonista<https://OMZ-Software.com/pythonista>} 3.1 on iOS 10.3.3, 11.0.3, 11.1.2 and 11.3 on iPad4, 

191all in 64-bit only and with 32-bit Python 2.7.14 on Windows Server 2012R2, Windows 10 Pro and with 32-bit Python 2.6.6 

192on Windows XP SP3. 

193 

194Notes 

195===== 

196 

197All Python source code has been statically U{checked<https://GitHub.com/ActiveState/code/tree/master/recipes/Python/ 

198546532_PyChecker_postprocessor>} with U{Ruff<https://GitHub.com/astral-sh/ruff>} using Python 3.13.12 and with 

199U{PyChecker<https://PyPI.org/project/pychecker>}, U{PyFlakes<https://PyPI.org/project/pyflakes>}, U{PyCodeStyle 

200<https://PyPI.org/project/pycodestyle>} (formerly Pep8) and U{McCabe<https://PyPI.org/project/mccabe>} using Python 

2012.7.18, both in 64-bit on macOS 26.3 Tahoe. 

202 

203For a summary of all I{Karney}-based functionality in C{pygeodesy}, see module U{karney 

204<https://mrJean1.GitHub.io/PyGeodesy/docs/pygeodesy.karney-module.html>}. 

205 

206In Python 2, symbols L{S_DEG}, L{S_MIN}, L{S_SEC}, L{S_RAD} and L{S_SEP} may be multi-byte, non-ascii 

207characters and if so, I{not} C{unicode}. 

208 

209Env variables 

210============= 

211 

212The following environment variables are observed by C{pygeodesy}: 

213 

214 - C{PYGEODESY_EXCEPTION_CHAINING} - see module L{errors<pygeodesy.errors>}. 

215 - C{PYGEODESY_FMT_FORM} - see module L{dms<pygeodesy.dms>}. 

216 - C{PYGEODESY_FSUM_F2PRODUCT} - see module L{fsums<pygeodesy.fsums>} and method L{f2product<pygeodesy.Fsum.f2product>}. 

217 - C{PYGEODESY_FSUM_NONFINITES} - see module L{fsums<pygeodesy.fsums>} and method L{nonfinites<pygeodesy.Fsum.nonfinites>}. 

218 - C{PYGEODESY_FSUM_RESIDUAL} - see module L{fsums<pygeodesy.fsums>} and method L{RESIDUAL<pygeodesy.Fsum.RESIDUAL>}. 

219 - C{PYGEODESY_GEOCONVERT} - see module L{mgrs<pygeodesy.mgrs>}. 

220 - C{PYGEODESY_GEODSOLVE} - see module L{geodsolve<pygeodesy.geodsolve>}. 

221 - C{PYGEODESY_GEOD3SOLVE} - see module L{geod3solve<pygeodesy.geod3solve>}. 

222 - C{PYGEODESY_INTERSECTTOOL} - see module L{geodesici<pygeodesy.geodesici>}. 

223 - C{PYGEODESY_LAZY_IMPORT} - see module L{lazily<pygeodesy.lazily>} and variable L{isLazy<pygeodesy.isLazy>}. 

224 - C{PYGEODESY_NOTIMPLEMENTED} - C{__special__} methods return C{NotImplemented} if set to "std". 

225 - C{PYGEODESY_RHUMBSOLVE} - see module L{rhumb.solve<pygeodesy.rhumb.solve>}. 

226 - C{PYGEODESY_UPS_POLES} - see modules L{ups<pygeodesy.ups>} and L{mgrs<pygeodesy.mgrs>}. 

227 

228and these to specify standard or I{named} C{repr}esentations: 

229 

230 - C{PYGEODESY_AZIMUTH_STD_REPR} - see method L{Azimuth<pygeodesy.Azimuth>}C{.__repr__}. 

231 - C{PYGEODESY_BEARING_STD_REPR} - see method L{Bearing<pygeodesy.Bearing>}C{.__repr__}. 

232 - C{PYGEODESY_BOOL_STD_REPR} - see method L{Bool<pygeodesy.Bool>}C{.__repr__}. 

233 - C{PYGEODESY_DEGREES_STD_REPR} - see method L{Degrees<pygeodesy.Degrees>}C{.__repr__}. 

234 - C{PYGEODESY_EPOCH_STD_REPR} - see method L{Float<pygeodesy.Epoch>}C{.__repr__}. 

235 - C{PYGEODESY_FLOAT_STD_REPR} - see method L{Float<pygeodesy.Float>}C{.__repr__}. 

236 - C{PYGEODESY_INT_STD_REPR} - see method L{Int<pygeodesy.Int>}C{.__repr__}. 

237 - C{PYGEODESY_METER_STD_REPR} - see method L{Meter<pygeodesy.Meter>}C{.__repr__}. 

238 - C{PYGEODESY_RADIANS_STD_REPR} - see method L{Radians<pygeodesy.Radians>}C{.__repr__}. 

239 - C{PYGEODESY_STR_STD_REPR} - see method L{Str<pygeodesy.Str>}C{.__repr__}. 

240 

241plus during development: 

242 

243 - C{PYGEODESY_FOR_DOCS} - for extended documentation by C{epydoc}. 

244 - C{PYGEODESY_GEOGRAPHICLIB} - see module L{karney<pygeodesy.karney>}. 

245 - C{PYGEODESY_WARNINGS} - see module L{props<pygeodesy.props>} and function L{DeprecationWarnings<pygeodesy.DeprecationWarnings>}. 

246 - C{PYGEODESY_XPACKAGES} - see module L{basics<pygeodesy.basics>}. 

247 - C{PYTHONDEVMODE} - see modules L{errors<pygeodesy.errors>} and L{props<pygeodesy.props>}. 

248 

249and: 

250 

251 - C{PYGEODESY_INIT__ALL__} - Set env variable C{PYGEODESY_INIT__ALL__} to anything other than C{"__all__"} to avoid 

252 importing all C{pygeodesy} modules unnecessarily (in Python 2 or with C{PYGEODESY_LAZY_IMPORT} turned off in Python 

253 3). However, to import a C{pygeodesy} item, the item name must be qualified with the C{module} name, for example 

254 C{ from pygeodesy.ellipsoidalExact import LatLon } or C{ from pygeodesy.deprecated import collins } 

255 

256License 

257======= 

258 

259**) U{Copyright (C) 2016-2026 -- mrJean1 at Gmail -- All Rights Reserved.<https://OpenSource.org/licenses/MIT>} 

260 

261C{Permission is hereby granted, free of charge, to any person obtaining a copy of this software 

262and associated documentation files (the "Software"), to deal in the Software without restriction, 

263including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 

264and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 

265subject to the following conditions:} 

266 

267C{The above copyright notice and this permission notice shall be included in all copies or substantial 

268portions of the Software.} 

269 

270C{THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 

271NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 

272IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 

273WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 

274SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.} 

275 

276@newfield example: Example, Examples 

277 

278@var EPS: System's M{epsilon} ≈ 2.22044604925e-16 (C{float}). 

279@var EPS0: M{EPS**2} ≈ 4.9e-32 for near-zero comparison 

280@var EPS02: M{EPS**4} ≈ 2.4e-63 for near-zero squared comparison 

281@var EPS1: M{1 - EPS} ≈ 0.9999999999999998 (C{float}). 

282@var EPS2: M{EPS * 2} ≈ 4.440892098501e-16 (C{float}). 

283@var EPS_2: M{EPS / 2} ≈ 1.110223024625e-16 (C{float}). 

284@var EPS4: M{EPS * 4} ≈ 8.881784197001e-16 (C{float}). 

285@var EPS8: M{EPS * 8} ≈ 1.776356839400e-15 (C{float}). 

286 

287@var F_D: Format degrees as unsigned "deg°" with symbol, plus compass point suffix C{N, S, E} or C{W} (C{str}). 

288@var F_DM: Format degrees as unsigned "deg°min′" with symbols, plus suffix (C{str}). 

289@var F_DMS: Format degrees as unsigned "deg°min′sec″" with symbols, plus suffix (C{str}). 

290@var F_DEG: Format degrees as unsigned "[D]DD" I{without} symbol, plus suffix (C{str}). 

291@var F_MIN: Format degrees as unsigned "[D]DDMM" I{without} symbols, plus suffix (C{str}). 

292@var F_SEC: Format degrees as unsigned "[D]DDMMSS" I{without} symbols, plus suffix (C{str}). 

293@var F_D60: Format degrees as unsigned "[D]DD.MMSS" C{sexagecimal} I{without} symbols, plus suffix (C{str}). 

294@var F__E: Format degrees as unsigned "%E" I{without} symbols, plus suffix (C{str}). 

295@var F__F: Format degrees as unsigned "%F" I{without} symbols, plus suffix (C{str}). 

296@var F__G: Format degrees as unsigned "%G" I{without} symbols, plus suffix (C{str}). 

297@var F_RAD: Convert degrees to radians and format as unsigned "RR" with symbol, plus suffix (C{str}). 

298 

299@var F_D_: Format degrees as signed "-/deg°" with symbol, I{without} suffix (C{str}). 

300@var F_DM_: Format degrees as signed "-/deg°min′" with symbols, I{without} suffix (C{str}). 

301@var F_DMS_: Format degrees as signed "-/deg°min′sec″" with symbols, I{without} suffix (C{str}). 

302@var F_DEG_: Format degrees as signed "-/[D]DD" I{without} symbol, I{without} suffix (C{str}). 

303@var F_MIN_: Format degrees as signed "-/[D]DDMM" I{without} symbols, I{without} suffix (C{str}). 

304@var F_SEC_: Format degrees as signed "-/[D]DDMMSS" I{without} symbols, I{without} suffix (C{str}). 

305@var F_D60_: Format degrees as signed "-/[D]DD.MMSS" C{sexagecimal} I{without} symbols, I{without} suffix (C{str}). 

306@var F__E_: Format degrees as signed "-/%E" I{without} symbols, I{without} suffix (C{str}). 

307@var F__F_: Format degrees as signed "-/%F" I{without} symbols, I{without} suffix (C{str}). 

308@var F__G_: Format degrees as signed "-/%G" I{without} symbols, I{without} suffix (C{str}). 

309@var F_RAD_: Convert degrees to radians and format as signed "-/RR" I{without} symbol, I{without} suffix (C{str}). 

310 

311@var F_D__: Format degrees as signed "-/+deg°" with symbol, I{without} suffix (C{str}). 

312@var F_DM__: Format degrees as signed "-/+deg°min′" with symbols, I{without} suffix (C{str}). 

313@var F_DMS__: Format degrees as signed "-/+deg°min′sec″" with symbols, I{without} suffix (C{str}). 

314@var F_DEG__: Format degrees as signed "-/+[D]DD" I{without} symbol, I{without} suffix (C{str}). 

315@var F_MIN__: Format degrees as signed "-/+[D]DDMM" I{without} symbols, without suffix (C{str}). 

316@var F_SEC__: Format degrees as signed "-/+[D]DDMMSS" I{without} symbols, I{without} suffix (C{str}). 

317@var F_D60__: Format degrees as signed "-/+[D]DD.MMSS" C{sexagecimal} I{without} symbols, I{without} suffix (C{str}). 

318@var F__E__: Format degrees as signed "-/+%E" I{without} symbols, I{without} suffix (C{str}). 

319@var F__F__: Format degrees as signed "-/+%F" I{without} symbols, I{without} suffix (C{str}). 

320@var F__G__: Format degrees as signed "-/+%G" I{without} symbols, I{without} suffix (C{str}). 

321@var F_RAD__: Convert degrees to radians and format as signed "-/+RR" I{without} symbol, I{without} suffix (C{str}). 

322 

323@var DIG: System's M{float decimal digits} = 15 (C{int}). 

324@var INF: Infinity (C{float}), see functions L{isinf<pygeodesy.isinf>} and L{isfinite<pygeodesy.isfinite>} and C{NINF}. 

325@var INT0: C{int(0)}, missing Z-components, C{if B{z}=B{INT0}}, see functions L{isint0<pygeodesy.isint0>}, L{meeus2<pygeodesy.meeus2>} 

326@var MANT_DIG: System's M{float mantissa bits} = 53 (C{int}). 

327@var MAX: System's M{float max} ≈ 1.798e+308 (C{float}). 

328@var MIN: System's M{float min} ≈ 2.225e-308 (C{float}). 

329@var NAN: Not-A-Number (C{float}), see function L{isnan<pygeodesy.isnan>}. 

330@var NEG0: Negative 0.0 (C{float}), see function L{isneg0<pygeodesy.isneg0>}. 

331@var NINF: Negative infinity (C{float}), see function L{isninf<pygeodesy.isninf>} and C{INF}. 

332@var NN: Empty (C{str}), U{I{Nomen Nescio}<https://Wiktionary.org/wiki/N.N.>}. 

333 

334@var OVERFLOW: Object representing C{overflow} (1 / L{EPS0<pygeodesy.constants.EPS0>} = 4.9e+32). 

335 

336@var PI: Constant M{math.pi} (C{float}). 

337@var PI2: Two PI, M{PI * 2}, aka I{Tau} (C{float}). 

338@var PI_2: Half PI, M{PI / 2} (C{float}). 

339@var PI3: Three PI, M{PI * 3} (C{float}). 

340@var PI3_2: One and a half PI, M{PI * 3 / 2} (C{float}). 

341@var PI_3: One third PI, M{PI / 3} (C{float}). 

342@var PI4: Four PI, M{PI * 4} (C{float}). 

343@var PI_4: Quarter PI, M{PI / 4} (C{float}). 

344@var PI_6: One sixth PI, M{PI / 6} (C{float}). 

345 

346@var R_MA: Equatorial earth radius (C{meter}), WGS84, EPSG:3785. 

347@var R_MB: Polar earth radius (C{meter}), WGS84, EPSG:3785. 

348@var R_M: Mean (spherical) earth radius (C{meter}). 

349@var R_KM: Mean (spherical) earth radius (C{Km}, kilometer). 

350@var R_NM: Mean (spherical) earth radius (C{NM}, nautical miles). 

351@var R_SM: Mean (spherical) earth radius (C{SM}, statute miles). 

352@var R_FM: Former FAI-Sphere earth radius (C{meter}). 

353@var R_GM: Average earth radius, distance to geoid surface (C{meter}) 

354@var R_QM: Earth' (triaxial) quadratic mean radius (C{meter}) 

355@var R_VM: Aviation/Navigation earth radius (C{meter}). 

356 

357@var S_DEG: Degrees symbol, default C{"°"} 

358@var S_MIN: Minutes symbol, default C{"′"} aka I{PRIME} 

359@var S_SEC: Seconds symbol, default C{"″"} aka I{DOUBLE_PRIME} 

360@var S_RAD: Radians symbol, default C{""} aka L{NN<pygeodesy.NN>} 

361@var S_DMS: If C{True}, include, otherwise cancel all DMS symbols, default C{True}. 

362@var S_SEP: Separator between C{deg°|min′|sec″|suffix}, default C{""} aka L{NN<pygeodesy.NN>} 

363 

364@var Conics: Registered, predefined L{conics<pygeodesy.Conic>} (C{enum-like}). 

365@var Datums: Registered, predefined L{datums<pygeodesy.Datum>} (C{enum-like}). 

366@var Ellipsoids: Registered, predefined L{ellipsoids<pygeodesy.Ellipsoid>} (C{enum-like}). 

367@var RefFrames: Registered, predefined L{reference frames<pygeodesy.RefFrame>} (C{enum-like}). 

368@var Transforms: Registered, predefined L{transforms<pygeodesy.Transform>} (C{enum-like}). 

369@var Triaxials: Registered, predefined L{triaxial ellipsoids<pygeodesy.Triaxial>} (C{enum-like}). 

370@var Triaxial3s: Registered, predefined L{triaxial3 ellipsoids<pygeodesy.Triaxial3>} (C{enum-like}). 

371 

372@var isLazy: Lazy import setting (C{int} 0, 1, 2 or 3+) from C{env} variable C{PYGEODESY_LAZY_IMPORT}, or C{None} if C{lazy import} is not supported or not enabled, or C{False} if initializing C{lazy import} failed. 

373 

374@var pygeodesy_abspath: Fully qualified C{pygeodesy} directory name (C{str}). 

375 

376@var version: Normalized C{pygeodesy} version (C{str}). 

377''' 

378 

379import os.path as _os_path 

380import sys as _sys 

381 

382_init__all__ = True 

383# <https://PyInstaller.ReadTheDocs.io/en/stable/runtime-information.html> 

384_isfrozen = getattr(_sys, 'frozen', False) 

385pygeodesy_abspath = _os_path.dirname(_os_path.abspath(__file__)) # _sys._MEIPASS + '/pygeodesy' 

386_pygeodesy_ = __package__ or _os_path.basename(pygeodesy_abspath) 

387 

388if _isfrozen: # avoid lazy import 

389 _lazy_import2 = None 

390else: 

391 # setting __path__ should ... 

392 __path__ = [pygeodesy_abspath] 

393 try: # ... make this import work, ... 

394 import pygeodesy.lazily as _ 

395 except ImportError: # ... if it doesn't, extend _sys.path to include 

396 # this very directory such that all public and private sub-modules 

397 # can be imported (by epydoc, checked by PyChecker, etc.) 

398 _sys.path.insert(0, pygeodesy_abspath) # XXX __path__[0] 

399 

400 try: # lazily requires Python 3.7+, see lazily.__doc__ 

401 from pygeodesy.lazily import _init__all__, _lazy_import2 # PYCHOK expected 

402 _, __getattr__ = _lazy_import2(_pygeodesy_) # PYCHOK expected 

403 

404 except (ImportError, NotImplementedError): # LazyImportError 

405 _lazy_import2 = None 

406 

407if _init__all__ and not _lazy_import2: # import and set __all__ 

408 

409 # import all public modules and export as such 

410 import pygeodesy.albers as albers # noqa: F401 

411 import pygeodesy.angles as angles # noqa: F401 

412 import pygeodesy.auxilats as auxilats # noqa: F401 

413 import pygeodesy.azimuthal as azimuthal # noqa: F401 

414 import pygeodesy.basics as basics # noqa: F401 

415 import pygeodesy.booleans as booleans # noqa: F401 

416 import pygeodesy.cartesianBase as cartesianBase # noqa: F401 INTERNAL 

417 import pygeodesy.clipy as clipy # noqa: F401 

418 import pygeodesy.constants as constants # noqa: F401 

419 import pygeodesy.css as css # noqa: F401 

420 import pygeodesy.datums as datums # noqa: F401 

421 import pygeodesy.deprecated as deprecated # noqa: F401 

422 import pygeodesy.dms as dms # noqa: F401 

423 import pygeodesy.ecef as ecef # noqa: F401 

424 import pygeodesy.ecefLocals as ecefLocals # noqa: F401 

425 import pygeodesy.elevations as elevations # noqa: F401 

426 import pygeodesy.ellipses as ellipses # noqa: F401 

427 import pygeodesy.ellipsoidalBase as ellipsoidalBase # noqa: F401 INTERNAL 

428 import pygeodesy.ellipsoidalBaseDI as ellipsoidalBaseDI # noqa: F401 INTERNAL 

429 import pygeodesy.ellipsoidalExact as ellipsoidalExact # noqa: F401 

430 import pygeodesy.ellipsoidalGeodSolve as ellipsoidalGeodSolve # noqa: F401 

431 import pygeodesy.ellipsoidalKarney as ellipsoidalKarney # noqa: F401 

432 import pygeodesy.ellipsoidalNvector as ellipsoidalNvector # noqa: F401 

433 import pygeodesy.ellipsoidalVincenty as ellipsoidalVincenty # noqa: F401 

434 import pygeodesy.ellipsoids as ellipsoids # noqa: F401 

435 import pygeodesy.elliptic as elliptic # noqa: F401 

436 import pygeodesy.epsg as epsg # noqa: F401 

437 import pygeodesy.etm as etm # noqa: F401 

438 import pygeodesy.errors as errors # noqa: F401 

439 import pygeodesy.fmath as fmath # noqa: F401 

440 import pygeodesy.formy as formy # noqa: F401 

441 import pygeodesy.frechet as frechet # noqa: F401 

442 import pygeodesy.fstats as fstats # noqa: F401 

443 import pygeodesy.fsums as fsums # noqa: F401 

444 import pygeodesy.gars as gars # noqa: F401 

445 import pygeodesy.geodesici as geodesici # noqa: F401 

446 import pygeodesy.geodesicw as geodesicw # noqa: F401 

447 import pygeodesy.geodesicx as geodesicx # noqa: F401 

448 import pygeodesy.geodsolve as geodsolve # noqa: F401 

449 import pygeodesy.geod3solve as geod3solve # noqa: F401 

450 import pygeodesy.geohash as geohash # noqa: F401 

451 import pygeodesy.geoids as geoids # noqa: F401 

452 import pygeodesy.hausdorff as hausdorff # noqa: F401 

453 import pygeodesy.heights as heights # noqa: F401 

454 import pygeodesy.internals as internals # noqa: F401 

455 import pygeodesy.interns as interns # noqa: F401 

456 import pygeodesy.iters as iters # noqa: F401 

457 import pygeodesy.karney as karney # noqa: F401 

458 import pygeodesy.ktm as ktm # noqa: F401 

459 import pygeodesy.latlonBase as latlonBase # noqa: F401 INTERNAL 

460 import pygeodesy.lazily as lazily # noqa: F401 

461 import pygeodesy.lcc as lcc # noqa: F401 

462 import pygeodesy.ltp as ltp # noqa: F401 

463 import pygeodesy.ltpTuples as ltpTuples # noqa: F401 

464 import pygeodesy.mgrs as mgrs # noqa: F401 

465 import pygeodesy.named as named # noqa: F401 

466 import pygeodesy.namedTuples as namedTuples # noqa: F401 

467 import pygeodesy.nvectorBase as nvectorBase # noqa: F401 INTERNAL 

468 import pygeodesy.osgr as osgr # noqa: F401 

469 import pygeodesy.points as points # noqa: F401 

470 import pygeodesy.props as props # noqa: F401 

471 import pygeodesy.resections as resections # noqa: F401 

472 import pygeodesy.rhumb as rhumb # noqa: F401 

473 import pygeodesy.simplify as simplify # noqa: F401 

474 import pygeodesy.sphericalBase as sphericalBase # noqa: F401 INTERNAL 

475 import pygeodesy.sphericalNvector as sphericalNvector # noqa: F401 

476 import pygeodesy.sphericalTrigonometry as sphericalTrigonometry # noqa: F401 

477 import pygeodesy.solveBase as solveBase # noqa: F401 

478 import pygeodesy.streprs as streprs # noqa: F401 

479 import pygeodesy.trf as trf # noqa: F401 

480 import pygeodesy.triaxials as triaxials # noqa: F401 

481 import pygeodesy.units as units # noqa: F401 

482 import pygeodesy.unitsBase as unitsBase # noqa: F401 INTERNAL 

483 import pygeodesy.ups as ups # noqa: F401 

484 import pygeodesy.utily as utily # noqa: F401 

485 import pygeodesy.utm as utm # noqa: F401 

486 import pygeodesy.utmups as utmups # noqa: F401 

487 import pygeodesy.utmupsBase as utmupsBase # noqa: F401 INTERNAL 

488 import pygeodesy.vector2d as vector2d # noqa: F401 

489 import pygeodesy.vector3d as vector3d # noqa: F401 

490 import pygeodesy.vector3dBase as vector3dBase # noqa: F401 INTERNAL 

491 import pygeodesy.webmercator as webmercator # noqa: F401 

492 import pygeodesy.wgrs as wgrs # noqa: F401 

493 

494 # lift all public classes, constants, functions, etc. but ONLY 

495 # from the following modules ... (see also David Beazley's 

496 # talk <https://DaBeaz.com/modulepackage/index.html>) ... BUT 

497 # NOT modules ellipsoidal*, epsg, gars, geohash, spherical*, 

498 # vector and wgrs ... in order keep those as modules ONLY 

499 from pygeodesy.albers import * # noqa: F403 

500 from pygeodesy.angles import * # noqa: F403 

501 from pygeodesy.azimuthal import * # noqa: F403 

502# from pygeodesy.auxilats import * # noqa: F403 

503 from pygeodesy.basics import * # noqa: F403 

504 from pygeodesy.booleans import * # noqa: F403 

505 from pygeodesy.cartesianBase import * # noqa: F403 INTERNAL 

506 from pygeodesy.clipy import * # noqa: F403 

507 from pygeodesy.constants import * # noqa: F403 

508 from pygeodesy.css import * # noqa: F403 

509 from pygeodesy.datums import * # noqa: F403 

510 from pygeodesy.deprecated import * # noqa: F403 DEPRECATED 

511 from pygeodesy.dms import * # noqa: F403 

512 from pygeodesy.ecef import * # noqa: F403 

513# from pygeodesy.ecefLocals import * # noqa: F403 

514 from pygeodesy.elevations import * # noqa: F403 

515 from pygeodesy.ellipses import * # noqa: F403 

516# from pygeodesy.ellipsoidalBase import * # noqa: F403 INTERNAL 

517# from pygeodesy.ellipsoidalBaseDI import * # noqa: F403 INTERNAL 

518# from pygeodesy.ellipsoidalExact import * # noqa: F403 

519# from pygeodesy.ellipsoidalGeodSolve import * # noqa: F403 

520# from pygeodesy.ellipsoidalKarney import * # noqa: F403 

521# from pygeodesy.ellipsoidalNvector import * # noqa: F403 

522 from pygeodesy.ellipsoidalVincenty import * # noqa: F403 

523 from pygeodesy.ellipsoids import * # noqa: F403 

524 from pygeodesy.elliptic import * # noqa: F403 

525 from pygeodesy.epsg import * # noqa: F403 

526 from pygeodesy.etm import * # noqa: F403 

527 from pygeodesy.errors import * # noqa: F403 

528 from pygeodesy.fmath import * # noqa: F403 

529 from pygeodesy.formy import * # noqa: F403 

530 from pygeodesy.frechet import * # noqa: F403 

531 from pygeodesy.fstats import * # noqa: F403 

532 from pygeodesy.fsums import * # noqa: F403 

533 from pygeodesy.gars import * # noqa: F403 

534 from pygeodesy.geodesici import * # noqa: F403 

535 from pygeodesy.geodesicw import * # noqa: F403 

536 from pygeodesy.geodesicx import * # noqa: F403 

537 from pygeodesy.geodsolve import * # noqa: F403 

538 from pygeodesy.geod3solve import * # noqa: F403 

539 from pygeodesy.geohash import * # noqa: F403 

540 from pygeodesy.geoids import * # noqa: F403 

541 from pygeodesy.hausdorff import * # noqa: F403 

542 from pygeodesy.heights import * # noqa: F403 

543 from pygeodesy.internals import * # noqa: F403 

544 from pygeodesy.interns import * # noqa: F403 

545 from pygeodesy.iters import * # noqa: F403 

546 from pygeodesy.karney import * # noqa: F403 

547 from pygeodesy.ktm import * # noqa: F403 

548 from pygeodesy.latlonBase import * # noqa: F403 INTERNAL 

549 from pygeodesy.lazily import * # noqa: F403 

550 from pygeodesy.lcc import * # noqa: F403 

551 from pygeodesy.ltp import * # noqa: F403 

552 from pygeodesy.ltpTuples import * # noqa: F403 

553 from pygeodesy.mgrs import * # noqa: F403 

554 from pygeodesy.named import * # noqa: F403 

555 from pygeodesy.namedTuples import * # noqa: F403 

556 from pygeodesy.nvectorBase import * # noqa: F403 INTERNAL 

557 from pygeodesy.osgr import * # noqa: F403 

558 from pygeodesy.points import * # noqa: F403 

559 from pygeodesy.props import * # noqa: F403 

560 from pygeodesy.resections import * # noqa: F403 

561 from pygeodesy.rhumb import * # noqa: F403 

562 from pygeodesy.simplify import * # noqa: F403 

563# from pygeodesy.sphericalBase import * # noqa: F403 INTERNAL 

564# from pygeodesy.sphericalNvector import * # noqa: F403 

565# from pygeodesy.sphericalTrigonometry import * # noqa: F403 

566# from pygeodesy.solveBase import * # noqa: F403 INTERNAL 

567 from pygeodesy.streprs import * # noqa: F403 

568 from pygeodesy.trf import * # noqa: F403 

569 from pygeodesy.triaxials import * # noqa: F403 

570# from pygeodesy.triaxials.bases import * # noqa: F403 

571# from pygeodesy.triaxials.conformals import * # noqa: F403 

572# from pygeodesy.triaxials.spheres import * # noqa: F403 

573# from pygeodesy.triaxials.triaxial3 import * # noqa: F403 

574# from pygeodesy.triaxials.triaxial5 import * # noqa: F403 

575 from pygeodesy.units import * # noqa: F403 

576 from pygeodesy.unitsBase import * # noqa: F403 Float, ... 

577 from pygeodesy.ups import * # noqa: F403 

578 from pygeodesy.utily import * # noqa: F403 

579 from pygeodesy.utm import * # noqa: F403 

580 from pygeodesy.utmups import * # noqa: F403 

581# from pygeodesy.utmupsBase import * # noqa: F403 INTERNAL 

582 from pygeodesy.vector2d import * # noqa: F403 

583 from pygeodesy.vector3d import * # noqa: F403 

584 from pygeodesy.vector3dBase import * # noqa: F403 INTERNAL 

585 from pygeodesy.webmercator import * # noqa: F403 

586 from pygeodesy.wgrs import * # noqa: F403 

587 

588 def _all(globalocals): 

589 from pygeodesy.internals import _headof, _DOT_ # PYCHOK expected 

590 from pygeodesy.interns import NN as _NN, _attribute_, _COMMASPACE_, \ 

591 _module_, _s_ # PYCHOK expected 

592 from pygeodesy.streprs import Fmt as _Fmt # PYCHOK expected 

593 # collect all public module and attribute names and check 

594 # that modules are imported from this package, 'pygeodesy' 

595 # (but the latter only when not bundled with PyInstaller or 

596 # Py2Exe, since the file-layout is different. Courtesy of 

597 # GilderGeek<https://GitHub.com/mrJean1/PyGeodesy/issues/31>) 

598 ns = list(lazily._ALL_INIT) 

599# XXX ps = () if _isfrozen else set([_pygeodesy_] + __name__.split(_DOT_)) 

600 for mod, attrs in lazily._all_enums(): 

601 mod = _headof(_headof(mod)) 

602 if mod not in globalocals: 

603 t = _DOT_(_pygeodesy_, mod) 

604 raise ImportError('missing %s%s: %s' % (_module_, _NN, t)) 

605 ns.append(mod) 

606 # check that all other public attrs do exist 

607 if attrs and isinstance(attrs, tuple): 

608 attrs = lazily._ALL_ATTRS(attrs) 

609 t = tuple(a for a in attrs if a not in globalocals) 

610 if t: 

611 s = _Fmt.SQUARE(_s_, len(t)) if len(t) > 1 else _NN 

612 t = _COMMASPACE_.join(_DOT_(_pygeodesy_, mod, a) for a in t) 

613 raise ImportError('missing %s%s: %s' % (_attribute_, s, t)) 

614 ns.extend(attrs) 

615# XXX if ps: # check that mod is a _pygeodesy_ module 

616# XXX m = globalocals[mod] # assert(typename(m) == mod) 

617# XXX f = getattr(m, _dunder_file_, _NN) 

618# XXX d = _os_path.dirname(_os_path.abspath(f)) if f else pygeodesy_abspath 

619# XXX p = getattr(m, _dunder_package_, _NN) or _pygeodesy_ 

620# XXX if p not in ps or d != pygeodesy_abspath: 

621# XXX t = '%s from %r' % (_DOT_(p, mod), f or p) 

622# XXX raise ImportError('foreign %s: %s' % (_module_, t)) 

623 return tuple(set(ns)) # remove duplicates 

624 

625 __all__ = _all(globals()) # or locals() 

626else: 

627 __all__ = () 

628 _init__all__ = False 

629 

630from pygeodesy.internals import _version2, _DOT_ # noqa: E402 

631# from pygeodesy.interns import _DOT_ # from .internals 

632__version__ = '26.03.26' 

633# see setup.py for similar logic 

634version = _DOT_(*_version2(__version__, n=3)) 

635 

636del _DOT_, _lazy_import2, _os_path, _sys, _version2 

637 

638# **) MIT License 

639# 

640# Copyright (C) 2016-2026 -- mrJean1 at Gmail -- All Rights Reserved. 

641# 

642# Permission is hereby granted, free of charge, to any person obtaining a 

643# copy of this software and associated documentation files (the "Software"), 

644# to deal in the Software without restriction, including without limitation 

645# the rights to use, copy, modify, merge, publish, distribute, sublicense, 

646# and/or sell copies of the Software, and to permit persons to whom the 

647# Software is furnished to do so, subject to the following conditions: 

648# 

649# The above copyright notice and this permission notice shall be included 

650# in all copies or substantial portions of the Software. 

651# 

652# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 

653# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 

654# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 

655# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 

656# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 

657# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 

658# OTHER DEALINGS IN THE SOFTWARE.