|
1 | | -# p2108-python |
2 | | -# p2108-python |
| 1 | +# Recommendation ITU-R P.2108-1: U.S. Reference Implementation |
| 2 | + |
| 3 | +[![GitHub release (latest SemVer)][latest-release-semver-badge]][github-releases] |
| 4 | +[![GitHub issues][github-issue-count-badge]][github-issues] |
| 5 | +[![Code style: black][code-style-badge]][code-style-repo] |
| 6 | + |
| 7 | +[latest-release-semver-badge]: https://img.shields.io/github/v/release/NTIA/p2108-python?display_name=tag&sort=semver |
| 8 | +[github-releases]: https://github.com/NTIA/p2108-python/releases |
| 9 | +[code-style-badge]: https://img.shields.io/badge/code%20style-black-000000.svg |
| 10 | +[code-style-repo]: https://github.com/psf/black |
| 11 | +[github-issue-count-badge]: https://img.shields.io/github/issues/NTIA/p2108-python |
| 12 | +[github-issues]: https://github.com/NTIA/p2108-python/issues |
| 13 | + |
| 14 | +Python® wrapper for U.S. Reference Software Implementation of Recommendation ITU-R |
| 15 | +P.2108. This Recommendation contains three methods for the prediction of clutter |
| 16 | +loss: Height Gain Terminal Correction Model, Terrestrial Statistical Model, and |
| 17 | +Aeronautical Statistical Model. The software implements Section 3 of Annex 1 of |
| 18 | +the Recommendation. |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +For an overview of the available functions of this model, view the |
| 23 | +[NTIA/ITS Propagation Library Wiki](https://github.com/NTIA/propagation/wiki/P2108). |
| 24 | +Additionally, Python-specific usage information and examples are available |
| 25 | +[here](https://github.com/NTIA/propagation/wiki/P2108-(Python)). |
| 26 | + |
| 27 | +## Development |
| 28 | + |
| 29 | +This repository contains code which wraps [the C++ source](https://github.com/NTIA/p2108) |
| 30 | +as an importable Python module. The development workflow assumes that you work |
| 31 | +within a cloned copy of the [parent repository](https://github.com/NTIA/p2108). |
| 32 | +Below are the steps to build and install the Python package from source, including |
| 33 | +compiling the library from the C++ source code. Working installations of Git and |
| 34 | +Python (3.8 or above) are required. |
| 35 | + |
| 36 | +1. Clone the parent repository, then initialize the Git submodule containing the |
| 37 | +Python wrapper. |
| 38 | + |
| 39 | + ```cmd |
| 40 | + # Clone the parent repository: |
| 41 | + git clone https://github.com/NTIA/p2108 |
| 42 | + cd p2108 |
| 43 | + |
| 44 | + # Then run one of the following: |
| 45 | + git submodule init wrap/python # Only the Python wrapper |
| 46 | + git submodule init # All available wrappers |
| 47 | + |
| 48 | + # Finally, to clone the submodule(s): |
| 49 | + git submodule update |
| 50 | + ``` |
| 51 | + |
| 52 | +1. Compile the C++ library for your platform using CMake: |
| 53 | + |
| 54 | + ```cmd |
| 55 | + # From the cloned repository |
| 56 | + mkdir build |
| 57 | + cmake -S . -B build |
| 58 | + cmake --build build |
| 59 | + ``` |
| 60 | +
|
| 61 | + When the CMake build command is run, the compiled library will be copied |
| 62 | + into place where needed to build the Python package (alongside `__init__.py`). |
| 63 | +
|
| 64 | +1. Install the local package, and development dependencies: |
| 65 | +
|
| 66 | + ```cmd |
| 67 | + cd wrap/python |
| 68 | + pip install .[dev] |
| 69 | + ``` |
| 70 | +
|
| 71 | + This will install the Python package itself along with development dependencies |
| 72 | + for pre-commit hooks, building distributable packages, and running unit tests. |
| 73 | +
|
| 74 | +1. (Optional) Run unit tests to confirm successfull installation. Test data is |
| 75 | +used from the parent repository. |
| 76 | +
|
| 77 | + ```cmd |
| 78 | + pytest . |
| 79 | + ``` |
| 80 | +
|
| 81 | +## License |
| 82 | +
|
| 83 | +See [LICENSE](LICENSE.md). |
| 84 | +
|
| 85 | +"Python" and the Python logos are trademarks or registered trademarks of the Python |
| 86 | +Software Foundation, used by the National Telecommunications and Information Administration |
| 87 | +with permission from the Foundation. |
| 88 | +
|
| 89 | +## Contact |
| 90 | +
|
| 91 | +For technical questions about the NTIA/ITS Propagation Library, contact <[email protected]>. |
0 commit comments