Coverage for pyrdnap / __pygeodesy.py: 97%
30 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-06-26 11:46 -0400
« prev ^ index » next coverage.py v7.14.0, created at 2026-06-26 11:46 -0400
2# -*- coding: utf-8 -*-
4u'''(INTERNAL) C{pyrdnap} access to some private C{pygeodesy} attributes.
5'''
6_requires = '26.6.12' # in README.rst, requirements.txt, setup.py
9def _PyGeodesy_dir(requires):
10 # Adjust sys.path to enable import pygeodesy
11 d = None
12 try:
13 from pygeodesy import version as _v
14 except ImportError:
15 import os.path as os_path
16 import sys # PYCHOK used!
17 # PYTHONPATH=.../PyRDNAP for development ONLY
18 p = os_path.abspath(__file__)
19 p = os_path.dirname(p) # pyrdnap_abspath
20 p = os_path.dirname(p) # PyRDNAP
21 g = p.replace('PyRDNAP', 'PyGeodesy')
22 if g != p and g not in sys.path:
23 sys.path.insert(0, g)
24 try:
25 from pygeodesy import version as _v # PYCHOK redef
26 d = g
27 except ImportError:
28 _v = 'missing'
29# finally:
30# try:
31# sys.path.remove(g)
32# except ValueError:
33# pass
35 def _t(v):
36 return tuple(map(int, v.split('.'))) # _DOT_
38 if _v == 'missing' or _t(_v) < _t(requires):
39 _v = ' %s, need %s or newer' % (_v, requires)
40 raise ImportError('pygeodesy' + _v)
42 return d # or None
44_PyGeodesy_dir = _PyGeodesy_dir(_requires) # PYCHOK path or None
46from pygeodesy.basics import _xinstanceof, _xsubclassof # noqa: F401
47from pygeodesy.constants import (_0_0, _0_0s, _0_5, _1_0, _2_0, # noqa: F401
48 _isNAN, _isNAN0) # noqa: F401
49from pygeodesy.datums import _earth_datum # noqa: F401
50from pygeodesy.ellipsoidalBase import LatLonEllipsoidalBase as _LLEB # noqa: F401
51from pygeodesy.errors import _ValueError, _xkwds # noqa: F401
52from pygeodesy.internals import machine, _secs2str, _versions # noqa: F401
53from pygeodesy.interns import (_COMMASPACE_, _DASH_, _datum_, # noqa: F401
54 _EQUAL_, _height_, _lat_, _lon_, # noqa: F401
55 _NAN_, _NL_, _SPACE_, _STAR_) # noqa: F401
56from pygeodesy.lazily import _ALL_DOCS, _ALL_OTHER, _FOR_DOCS, import_module # noqa: F401
57from pygeodesy.named import _NamedBase, _NamedTuple, _Pass # noqa: F401
58from pygeodesy.streprs import Fmt # noqa: F401
61class RDNAPError(_ValueError):
62 '''Error raised for C{RD}, C{NAP}, unzip and other issues.
63 '''
64 pass
67def _all_OTHER(*objs): # PYCHOK shared
68 # collect all __all__ lists or tuples
69 _all = _ALL_OTHER(*objs)
70 _all__all__.extend(_all)
71 return _all
73_all__all__ = [] # PYCHOK in .__init__
75__all__ = _all_OTHER(machine, RDNAPError)
76__version__ = '26.06.18'
79# **) MIT License
80#
81# Copyright (C) 2026-2026 -- mrJean1 at Gmail -- All Rights Reserved.
82#
83# Permission is hereby granted, free of charge, to any person obtaining a
84# copy of this software and associated documentation files (the "Software"),
85# to deal in the Software without restriction, including without limitation
86# the rights to use, copy, modify, merge, publish, distribute, sublicense,
87# and/or sell copies of the Software, and to permit persons to whom the
88# Software is furnished to do so, subject to the following conditions:
89#
90# The above copyright notice and this permission notice shall be included
91# in all copies or substantial portions of the Software.
92#
93# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
94# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
95# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
96# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
97# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
98# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
99# OTHER DEALINGS IN THE SOFTWARE.