Skip to content

Commit 979fc6e

Browse files
Initial release
1 parent c1632d4 commit 979fc6e

File tree

10 files changed

+749
-2
lines changed

10 files changed

+749
-2
lines changed

.gitignore

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
*.so.*
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# poetry
99+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100+
# This is especially recommended for binary packages to ensure reproducibility, and is more
101+
# commonly ignored for libraries.
102+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103+
#poetry.lock
104+
105+
# pdm
106+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107+
#pdm.lock
108+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109+
# in version control.
110+
# https://pdm.fming.dev/#use-with-ide
111+
.pdm.toml
112+
113+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114+
__pypackages__/
115+
116+
# Celery stuff
117+
celerybeat-schedule
118+
celerybeat.pid
119+
120+
# SageMath parsed files
121+
*.sage.py
122+
123+
# Environments
124+
.env
125+
.venv
126+
env/
127+
venv/
128+
ENV/
129+
env.bak/
130+
venv.bak/
131+
132+
# Spyder project settings
133+
.spyderproject
134+
.spyproject
135+
136+
# Rope project settings
137+
.ropeproject
138+
139+
# mkdocs documentation
140+
/site
141+
142+
# mypy
143+
.mypy_cache/
144+
.dmypy.json
145+
dmypy.json
146+
147+
# Pyre type checker
148+
.pyre/
149+
150+
# pytype static type analyzer
151+
.pytype/
152+
153+
# Cython debug symbols
154+
cython_debug/
155+
156+
# PyCharm
157+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159+
# and can be added to the global gitignore or merged into this file. For a more nuclear
160+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161+
#.idea/
162+
163+
# C++ Library
164+
src/ITS/ITU/PSeries/P2108/*.dll
165+
src/ITS/ITU/PSeries/P2108/*.so

.pre-commit-config.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
default_language_version:
2+
python: python3.8
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: check-ast
8+
types: [file, python]
9+
- id: check-case-conflict
10+
- id: check-docstring-first
11+
types: [file, python]
12+
- id: check-merge-conflict
13+
- id: check-yaml
14+
types: [file, yaml]
15+
- id: debug-statements
16+
types: [file, python]
17+
- id: detect-private-key
18+
- id: end-of-file-fixer
19+
- id: trailing-whitespace
20+
- repo: https://github.com/asottile/pyupgrade
21+
rev: v3.15.2
22+
hooks:
23+
- id: pyupgrade
24+
args: ["--py38-plus"]
25+
- repo: https://github.com/pycqa/isort
26+
rev: 5.13.2
27+
hooks:
28+
- id: isort
29+
name: isort (python)
30+
types: [file, python]
31+
args: ["--profile", "black", "--filter-files", "--gitignore"]
32+
- repo: https://github.com/psf/black
33+
rev: 24.4.2
34+
hooks:
35+
- id: black
36+
types: [file, python]
37+
- repo: https://github.com/igorshubovych/markdownlint-cli
38+
rev: v0.40.0
39+
hooks:
40+
- id: markdownlint
41+
types: [file, markdown]
42+
exclude: GitHubRepoPublicReleaseApproval.md

CITATION.cff

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
cff-version: 1.2.0
2+
title: >-
3+
Recommendation ITU-R P.2108-1, U.S. Reference Python
4+
Implementation
5+
message: Please cite this software using these metadata.
6+
type: software
7+
authors:
8+
- given-names: William
9+
family-names: Kozma
10+
name-suffix: Jr
11+
12+
affiliation: >-
13+
U.S. Department of Commerce, National
14+
Telecommunications and Information Administration,
15+
Institute for Telecommunication Sciences
16+
orcid: 'https://orcid.org/0000-0002-7417-4009'
17+
- given-names: Anthony
18+
family-names: Romaniello
19+
name-particle: W.
20+
21+
affiliation: >-
22+
U.S. Department of Commerce, National
23+
Telecommunications and Information Administration,
24+
Institute for Telecommunication Sciences
25+
orcid: 'https://orcid.org/0000-0001-8437-6504'
26+
- name: >-
27+
U.S. Department of Commerce, National
28+
Telecommunications and Information Administration,
29+
Institute for Telecommunications Sciences
30+
address: 325 Broadway
31+
city: Boulder
32+
country: US
33+
post-code: '80305'
34+
region: Colorado
35+
36+
website: 'https://its.ntia.gov'
37+
alias: NTIA/ITS
38+
identifiers:
39+
- type: doi
40+
value: 10.5281/zenodo.7114523
41+
description: TODO PLACEHOLDER how was doi generated, doi given is wrong.
42+
repository-code: 'https://github.com/NTIA/p2108-python'
43+
url: 'https://github.com/NTIA/propagation/wiki'
44+
repository: 'https://github.com/NTIA/p2108'
45+
keywords:
46+
- propagation
47+
- rf
48+
- clutter
49+
- itu
50+
license: 'NTIA Public Domain'
51+
version: 1.0.0
52+
date-released: '2024-05-24'

LICENSE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SOFTWARE DISCLAIMER / RELEASE
2+
3+
This software was developed by employees of the National Telecommunications and Information
4+
Administration (NTIA), an agency of the Federal Government and is provided to you
5+
as a public service. Pursuant to Title 15 United States Code Section 105, works
6+
of NTIA employees are not subject to copyright protection within the United States.
7+
8+
The software is provided by NTIA “AS IS.” NTIA MAKES NO WARRANTY OF ANY KIND, EXPRESS,
9+
IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY,
10+
FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NTIA does
11+
not warrant or make any representations regarding the use of the software or the
12+
results thereof, including but not limited to the correctness, accuracy, reliability
13+
or usefulness of the software.
14+
15+
To the extent that NTIA holds rights in countries other than the United States,
16+
you are hereby granted the non-exclusive irrevocable and unconditional right to
17+
print, publish, prepare derivative works and distribute the NTIA software, in any
18+
medium, or authorize others to do so on your behalf, on a royalty-free basis throughout
19+
the World.
20+
21+
You may improve, modify, and create derivative works of the software or any portion
22+
of the software, and you may copy and distribute such modifications or works. Modified
23+
works should carry a notice stating that you changed the software and should note
24+
the date and nature of any such change.
25+
26+
You are solely responsible for determining the appropriateness of using and distributing
27+
the software and you assume all risks associated with its use, including but not
28+
limited to the risks and costs of program errors, compliance with applicable laws,
29+
damage to or loss of data, programs or equipment, and the unavailability or interruption
30+
of operation. This software is not intended to be used in any situation where a failure
31+
could cause risk of injury or damage to property.
32+
33+
Please provide appropriate acknowledgments of NTIA’s creation of the software in
34+
any copies or derivative works of this software.

README.md

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,91 @@
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

Comments
 (0)