Coverage for pyrdnap/__pygeodesy.py: 95%

22 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2026-05-08 18:11 -0400

1 

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

3 

4u'''(INTERNAL) C{pyrdnap} access to some private C{pygeodesy} attributes. 

5''' 

6 

7 

8def _PyGeodesy_dir(): 

9 # Adjust sys.path to enable import pygeodesy 

10 d = None 

11 try: 

12 from pygeodesy import version as _v 

13 except ImportError: 

14 import os.path as os_path 

15 import sys # PYCHOK used! 

16 # PYTHONPATH=.../PyRDNAP for development ONLY 

17 p = os_path.abspath(__file__) 

18 p = os_path.dirname(p) # pyrdnap_abspath 

19 p = os_path.dirname(p) # PyRDNAP 

20 g = p.replace('PyRDNAP', 'PyGeodesy') 

21 if g != p and g not in sys.path: 

22 sys.path.insert(0, g) 

23 try: 

24 from pygeodesy import version as _v # PYCHOK redef 

25 d = g 

26 except ImportError: 

27 _v = 'missing' 

28# finally: 

29# try: 

30# sys.path.remove(g) 

31# except ValueError: 

32# pass 

33 

34 def _t(v): 

35 return tuple(map(int, v.split('.'))) # _DOT_ 

36 

37 _r = '26.5.7' 

38 if _v == 'missing' or _t(_v) < _t(_r): 

39 _v = ' %s, need %s or newer' % (_v, _r) 

40 raise ValueError('pygeodesy' + _v) 

41 

42 return d # or None 

43 

44_PyGeodesy_dir = _PyGeodesy_dir() # PYCHOK path or None 

45 

46from pygeodesy.basics import _xinstanceof, _xsubclassof # noqa: F401 

47from pygeodesy.constants import _0_0, _0_0s, _0_5, _1_0, _N_1_0, _2_0, _isNAN # noqa: F401 

48from pygeodesy.datums import _earth_datum # noqa: F401 

49from pygeodesy.ellipsoidalBase import LatLonEllipsoidalBase as _LLEB # noqa: F401 

50from pygeodesy.errors import _xkwds # noqa: F401 

51from pygeodesy.internals import _secs2str, _versions # noqa: F401 

52from pygeodesy.interns import _COMMASPACE_, _DASH_, _datum_, _E_, _height_, _lat_, _lon_, \ 

53 _N_, _NL_, _S_, _SPACE_, _UNDER_, _W_ # noqa: F401 

54from pygeodesy.lazily import _ALL_DOCS, _ALL_OTHER, _FOR_DOCS, import_module # noqa: F401 

55from pygeodesy.named import _NamedBase, _NamedTuple, notOverloaded, _Pass # noqa: F401 

56 

57__all__ = () 

58__version__ = '26.05.07' 

59 

60# **) MIT License 

61# 

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

63# 

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

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

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

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

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

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

70# 

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

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

73# 

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

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

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

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

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

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

80# OTHER DEALINGS IN THE SOFTWARE.