|
| 1 | +# NTIA/ITS Propagation Library Template Python Wrapper # |
| 2 | +<!-- TODO-TEMPLATE Update software name above --> |
| 3 | +<!-- TODO-TEMPLATE: README BADGES |
| 4 | +
|
| 5 | +- The first badge links to the PropLib Wiki and does not need to be edited |
| 6 | +- The second badge automatically displays and links to the most recent GitHub Release. |
| 7 | + - Make sure to update the [gh-releases-badge] and [gh-releases-link] URLs with your repo name |
| 8 | +- The third badge links to the zenodo DOI page. Only include this badge if a DOI exists for a release. |
| 9 | + - Update the [doi-link] using the "id" from https://api.github.com/repos/ntia/{repo_name}. For example, the |
| 10 | + [doi-link] for ITM would be https://zenodo.org/badge/latestdoi/218981682. Using the repository ID in this link |
| 11 | + will automatically make the link always point to the most recent DOI for the repository, so this won't need to be |
| 12 | + edited every time a new release is made. |
| 13 | + - Update the [doi-badge] to include the "all versions" DOI which always points to the latest version. |
| 14 | + This can be found when creating the DOI in zenodo. The slash in the DOI must be replaced with "%2F" to |
| 15 | + render in the badge. For example, the P2108 DOI is 10.5281/zenodo.7114033 which must be input as |
| 16 | + "10.5281%2Fzenodo.7114033" |
| 17 | +- The fourth badge is the Tox GitHub actions status. |
| 18 | + - Update the repository name in [gh-actions-test-badge] and [gh-actions-test-link] |
| 19 | +- The fifth badge displays open GitHub Issues |
| 20 | + - Update the repository name in [gh-issues-badge] |
| 21 | + - Update the repository name in [gh-issues-link] |
| 22 | +--> |
| 23 | +[![NTIA/ITS PropLib][proplib-badge]][proplib-link] |
| 24 | +<!-- |
| 25 | +[![GitHub Release][gh-releases-badge]][gh-releases-link] |
| 26 | +[![DOI][doi-badge]][doi-link] |
| 27 | +[![GitHub Actions Unit Test Status][gh-actions-test-badge]][gh-actions-test-link] |
| 28 | +[![GitHub Issues][gh-issues-badge]][gh-issues-link] |
| 29 | +--> |
| 30 | +[proplib-badge]: https://img.shields.io/badge/PropLib-badge?label=%F0%9F%87%BA%F0%9F%87%B8%20NTIA%2FITS&labelColor=162E51&color=D63E04 |
| 31 | +[proplib-link]: https://ntia.github.io/propagation-library-wiki |
| 32 | +[gh-actions-test-badge]: https://img.shields.io/github/actions/workflow/status/NTIA/TODO-TEMPLATE/tox.yml?branch=main&logo=pytest&logoColor=ffffff&label=Build%2FTests&labelColor=162E51 |
| 33 | +[gh-actions-test-link]: https://github.com/NTIA/TODO-TEMPLATE/actions/workflows/tox.yml |
| 34 | +[gh-releases-badge]: https://img.shields.io/github/v/release/NTIA/TODO-TEMPLATE?logo=github&label=Release&labelColor=162E51&color=D63E04 |
| 35 | +[gh-releases-link]: https://github.com/NTIA/TODO-TEMPLATE/releases |
| 36 | +[gh-issues-badge]: https://img.shields.io/github/issues/NTIA/TODO-TEMPLATE?logo=github&label=Issues&labelColor=162E51 |
| 37 | +[gh-issues-link]: https://github.com/NTIA/TODO-TEMPLATE/issues |
| 38 | +[doi-badge]: https://img.shields.io/badge/{TODO-TEMPLATE-ALL-VERSIONS-DOI}-x?logo=doi&logoColor=ffffff&labelColor=162E51&color=D63E04 |
| 39 | +[doi-link]: https://zenodo.org/badge/latestdoi/{TODO-TEMPLATE-REPOSITORY-ID} |
| 40 | + |
| 41 | +<!-- TODO-TEMPLATE: Replace the below description with one for your software --> |
| 42 | +This code repository is a template repository for Python wrappers in the NTIA/ITS |
| 43 | +Propagation Library (PropLib). This template is intended for developers wishing |
| 44 | +to develop a cross-platform Python interface to a compiled C++ library as part of |
| 45 | +PropLib. Instructions on how to use this repository are found in its |
| 46 | +[GitHub Wiki](https://github.com/NTIA/proplib-template-python/wiki). |
| 47 | + |
| 48 | +Additional template repositories exist for building the C++ base repository and the |
| 49 | +C#/.NET and MATLAB wrappers. See: |
| 50 | + |
| 51 | +- [NTIA/proplib-template](https://github.com/NTIA/proplib-template) |
| 52 | +- [NTIA/proplib-template-dotnet](https://github.com/NTIA/proplib-template-dotnet) |
| 53 | +- [NTIA/proplib-template-matlab](https://github.com/NTIA/proplib-template-matlab) |
| 54 | + |
| 55 | +## Contact ## |
| 56 | + |
| 57 | +For questions about using this template repository, contact <[email protected]> |
| 58 | + |
| 59 | +<!-- TODO-TEMPLATE: Create the README contents. Boilerplate provided below. |
| 60 | +
|
| 61 | +## Getting Started ## |
| 62 | +
|
| 63 | +TODO-TEMPLATE: Update links in this section |
| 64 | +
|
| 65 | +To get started using this model, refer to |
| 66 | +[its page on the **NTIA/ITS Propagation Library Wiki**](https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE/). |
| 67 | +There, you will find installation instructions, usage information, and code |
| 68 | +examples for all supported languages. |
| 69 | +
|
| 70 | +If you're a developer and would like to contribute to or extend this repository, |
| 71 | +please review the guide for contributors [here](CONTRIBUTING.md) or open an |
| 72 | +[issue](https://github.com/NTIA/TODO-TEMPLATE/issues) to start a discussion. |
| 73 | +
|
| 74 | +## Development ## |
| 75 | +
|
| 76 | +This repository contains code which wraps [the C++ shared library](https://github.com/NTIA/TODO-TEMPLATE) |
| 77 | +as an importable Python module. If you wish to contribute to this repository, |
| 78 | +testing your changes will require the inclusion of this shared library. You may retrieve |
| 79 | +this either from the |
| 80 | +[relevant GitHub Releases page](https://github.com/NTIA/TODO-TEMPLATE/releases), or by |
| 81 | +compiling it yourself from the C++ source code. Either way, ensure that the shared library |
| 82 | +(`.dll`, `.dylib`, or `.so` file) is placed in `src/TODO-TEMPLATE/MODEL-NAMESPACE/`, alongside `__init__.py`. |
| 83 | +
|
| 84 | +Below are the steps to build and install the Python package from source, including |
| 85 | +compiling the library from the C++ source code. Working installations of Git and |
| 86 | +Python (3.9 or above) are required. If compiling the shared library, CMake and a C++ compiler |
| 87 | +are also required. |
| 88 | +
|
| 89 | +1. Clone the parent repository, then initialize the Git submodule containing the |
| 90 | +Python wrapper. This repository structure makes test data available to the Python |
| 91 | +wrapper. |
| 92 | +
|
| 93 | + ```cmd |
| 94 | + # Clone the parent repository |
| 95 | + git clone https://github.com/NTIA/TODO-TEMPLATE |
| 96 | + cd TODO-TEMPLATE |
| 97 | +
|
| 98 | + # Initialize Git submodules (wrappers and external dependencies) |
| 99 | + git submodule init |
| 100 | +
|
| 101 | + # Clone the submodules |
| 102 | + git submodule update |
| 103 | + ``` |
| 104 | +
|
| 105 | +1. Compile the C++ library for your platform, following instructions |
| 106 | +[here](https://github.com/NTIA/TODO-TEMPLATE?tab=readme-ov-file#configure-and-build). |
| 107 | +Following these instructions should automatically copy the shared library |
| 108 | +into the location required by the Python wrapper. |
| 109 | +
|
| 110 | + **OR** |
| 111 | +
|
| 112 | + Download the shared library (`.dll`, `.so`, or `.dylib`) from a |
| 113 | + [GitHub Release](https://github.com/NTIA/TODO-TEMPLATE/releases). Then place the |
| 114 | + downloaded file in `src/TODO-TEMPLATE/MODEL-NAMESPACE/` (alongside `__init__.py`). |
| 115 | +
|
| 116 | +1. Install the local package and development dependencies: |
| 117 | +
|
| 118 | + ```cmd |
| 119 | + cd wrap/python |
| 120 | + pip install .[dev] |
| 121 | + ``` |
| 122 | +
|
| 123 | +1. To build the wheel for your platform: |
| 124 | +
|
| 125 | + ```cmd |
| 126 | + hatchling build |
| 127 | + ``` |
| 128 | +
|
| 129 | +### Running Tests ### |
| 130 | +
|
| 131 | +Python unit tests can be run to confirm successful installation. Test data is |
| 132 | +expected to be located in the parent repository. Therefore, if you haven't cloned |
| 133 | +this repository as a submodule (as described above), you will need to first specify |
| 134 | +the location of the test data files in `tests/test_<TODO-TEMPLATE>.py` (using the `TEST_DATA_DIR` |
| 135 | +variable). Then, run the tests with pytest: |
| 136 | +
|
| 137 | +```cmd |
| 138 | +pytest |
| 139 | +``` |
| 140 | +
|
| 141 | +## References ## |
| 142 | +
|
| 143 | +TODO-TEMPLATE: Update references |
| 144 | +
|
| 145 | +* [ITS Propagation Library Wiki](https://ntia.github.io/propagation-library-wiki) |
| 146 | +* [TODO-TEMPLATE Wiki Page](https://ntia.github.io/propagation-library-wiki/models/TODO-TEMPLATE) |
| 147 | +* [`TODO-TEMPLATE` C++ API Reference](https://ntia.github.io/TODO-TEMPLATE) |
| 148 | +* TODO-TEMPLATE: Link supporting documentation such as ITU-R Recommendations, NTIA reports, etc. |
| 149 | +
|
| 150 | +## Contact ## |
| 151 | +
|
| 152 | +For technical questions, contact <[email protected]>. |
| 153 | +
|
| 154 | +--> |
0 commit comments