Coverage for pybelbg / __init__.py: 100%
22 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-07-31 12:43 -0400
« prev ^ index » next coverage.py v7.14.0, created at 2026-07-31 12:43 -0400
2# -*- coding: utf-8 -*-
4u'''A pure Python implementation of the C{Belgian hybrid quasi-geoid} U{hBG18
5<https://DOI.org/10.5880/isg.2018.003>} with several Belgian C{Lambert 2018},
6C{-1972s} and C{-1950} conic projections to convert between geodetic lat-,
7longitudes and (ellipsoidal) height and local easting, northing and (orthometric)
8height based on bilinear interpolation of quasi-geoid C{hBG18} heights.
9'''
10import os.path as os_path
11import sys
13# _isfrozen = getattr(_sys, 'frozen', False)
14pybelbg_abspath = os_path.dirname(os_path.abspath(__file__)) # _sys._MEIPASS + '/pyrdnap'
15_pybelbg_ = __package__ or os_path.basename(pybelbg_abspath)
17# setting __path__ should ...
18__path__ = [pybelbg_abspath]
19try: # ... make this import work, ...
20 import pybelbg.__pygeodesy as _ # noqa: F401
21except ImportError: # ... if it doesn't, extend sys.path to include
22 # this very directory such that all public and private sub-modules
23 # can be imported (by epydoc, checked by PyChecker, etc.)
24 if pybelbg_abspath not in sys.path:
25 sys.path.insert(0, pybelbg_abspath) # XXX __path__[0]
27try: # PYCHOK pygeodesy
28 from pybelbg.__pygeodesy import * # noqa: F403
29except (AttributeError, ImportError) as x:
30 raise AssertionError(str(x))
32from pybelbg.belbgs import * # noqa: F403
35def _all__init__(*names): # deleted below
36 from pybelbg.__pygeodesy import _all__all__ # PYCHOK ...
37 _all__all__.extend(names)
38 _all__all__[:] = sorted(_all__all__) # set(_all__all__)
39 return _all__all__
42def _versions(): # in .__main__, .v_self, .test/bases
43 # Get the pyrdnap, pygeodesy, Python ... versions (C{str}).
44 from pybelbg.__pygeodesy import _SPACE_, _versions as _pygeodesy_versions # PYCHOK ...
45 v = __version__.replace('.0', '.')
46 l_ = [_pybelbg_, v] + _pygeodesy_versions(None)
47 return _SPACE_.join(l_) # PYCHOK shadows?
50__all__ = _all__init__('pybelbg_abspath')
51__version__ = '26.07.31'
52# del _all__init__
54# **) MIT License
55#
56# Copyright (C) 2026-2026 -- mrJean1 at Gmail -- All Rights Reserved.
57#
58# Permission is hereby granted, free of charge, to any person obtaining a
59# copy of this software and associated documentation files (the "Software"),
60# to deal in the Software without restriction, including without limitation
61# the rights to use, copy, modify, merge, publish, distribute, sublicense,
62# and/or sell copies of the Software, and to permit persons to whom the
63# Software is furnished to do so, subject to the following conditions:
64#
65# The above copyright notice and this permission notice shall be included
66# in all copies or substantial portions of the Software.
67#
68# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
69# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
71# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
72# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
73# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
74# OTHER DEALINGS IN THE SOFTWARE.