Skip to content

Commit 1a06d57

Browse files
Merge pull request #3 from NTIA/pre-publish-revisions
Minor revisions prior to publication
2 parents a568286 + 9f0d085 commit 1a06d57

16 files changed

+367
-131
lines changed

.github/workflows/buildwheels.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Action builds a universal (Win32/Win64/macOS-universal/Linux-x64) Python wheel
2+
# from the source code, using Hatchling, and uploads it as an artifact. This wheel
3+
# can then be distributed with new releases. The action is triggered by pushes into `main`
4+
# or pull_requests into `main` or `dev` (for testing). To aid in releases, the workflow is
5+
# also triggered when new SemVer tags are created. This action handles downloading all
6+
# shared library files and including them in the resulting wheel.
7+
name: Build Wheels
8+
9+
on:
10+
workflow_dispatch:
11+
push:
12+
branches:
13+
- main
14+
tags:
15+
- 'v[0-9]+.*'
16+
pull_request:
17+
branches:
18+
- main
19+
- dev
20+
21+
env:
22+
LIBRARY_BASE_REPO: NTIA/p2108
23+
LIBRARY_RELEASE_TAG: v1.0-rc.1
24+
LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/'
25+
26+
jobs:
27+
build_wheel:
28+
name: Build a universal, cross-platform wheel
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check out repository
32+
uses: actions/checkout@v4
33+
with:
34+
submodules: true
35+
36+
# Only the binaries required for the current platform are downloaded. Note that the distributed
37+
# wheel for proplib python packages includes all binaries, so that the wheel is inherently cross-platform.
38+
- name: Download required ${{ env.LIBRARY_RELEASE_TAG }} Windows binaries
39+
uses: robinraju/release-downloader@v1
40+
with:
41+
repository: ${{ env.LIBRARY_BASE_REPO }}
42+
tag: ${{ env.LIBRARY_RELEASE_TAG }}
43+
fileName: '*.dll'
44+
tarBall: false
45+
zipBall: false
46+
out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }}
47+
48+
- name: Download required ${{ env.LIBRARY_RELEASE_TAG }} Linux binaries
49+
uses: robinraju/release-downloader@v1
50+
with:
51+
repository: ${{ env.LIBRARY_BASE_REPO }}
52+
tag: ${{ env.LIBRARY_RELEASE_TAG }}
53+
fileName: '*.so'
54+
tarBall: false
55+
zipBall: false
56+
out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }}
57+
58+
- name: Download required ${{ env.LIBRARY_RELEASE_TAG }} macOS binaries
59+
uses: robinraju/release-downloader@v1
60+
with:
61+
repository: ${{ env.LIBRARY_BASE_REPO }}
62+
tag: ${{ env.LIBRARY_RELEASE_TAG }}
63+
fileName: '*.dylib'
64+
tarBall: false
65+
zipBall: false
66+
out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }}
67+
68+
- name: Set up Python
69+
uses: actions/setup-python@v5
70+
with:
71+
python-version: '3.13'
72+
73+
- name: Install build dependencies
74+
run: pip install hatchling
75+
76+
- name: Build wheels
77+
run: hatchling build
78+
79+
- uses: actions/upload-artifact@v4
80+
with:
81+
name: Universal Wheel (.whl)
82+
path: dist/*.whl

.github/workflows/cff-validator.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Validate CITATION.cff
2+
3+
on:
4+
push:
5+
branches: ["main", "dev"]
6+
paths:
7+
- 'CITATION.cff'
8+
- '.github/workflows/cff-validator.yml'
9+
pull_request:
10+
branches: ["main", "dev"]
11+
paths:
12+
- 'CITATION.cff'
13+
- '.github/workflows/cff-validator.yml'
14+
workflow_dispatch:
15+
16+
jobs:
17+
Validate-CITATION-cff:
18+
runs-on: ubuntu-latest
19+
name: Validate CITATION.cff
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
- name: Validate CITATION.cff
27+
uses: dieghernan/cff-validator@v4

.github/workflows/pytest.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Test with pytest
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
- dev
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
15+
cancel-in-progress: true
16+
17+
env:
18+
LIBRARY_BASE_REPO: NTIA/p2108
19+
LIBRARY_RELEASE_TAG: v1.0-rc.1
20+
LIBRARY_DESTINATION_DIRECTORY: 'src/ITS/ITU/PSeries/P2108/'
21+
22+
jobs:
23+
run-all-tests:
24+
name: ${{ matrix.platform.os-name }} / Py${{ matrix.py }}
25+
runs-on: ${{ matrix.platform.os-runner }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
platform:
30+
- os-name: 'Windows (64-bit)'
31+
os-runner: 'windows-latest'
32+
arch-id: 'x64'
33+
release-file-pattern: '*-x64.dll'
34+
- os-name: 'Windows (32-bit)'
35+
os-runner: 'windows-latest'
36+
arch-id: 'x86'
37+
release-file-pattern: '*-x86.dll'
38+
- os-name: 'macOS (intel/x64)'
39+
os-runner: 'macos-13'
40+
arch-id: 'x64'
41+
release-file-pattern: '*.dylib'
42+
- os-name: 'macOS (apple/arm64)'
43+
os-runner: 'macos-latest'
44+
arch-id: 'arm64'
45+
release-file-pattern: '*.dylib'
46+
- os-name: 'Linux (Ubuntu)'
47+
os-runner: 'ubuntu-latest'
48+
arch-id: 'x64'
49+
release-file-pattern: '*.so'
50+
py: # Python versions to test on all platforms
51+
- "3.9"
52+
- "3.10"
53+
- "3.11"
54+
- "3.12"
55+
steps:
56+
- name: Check out repository
57+
uses: actions/checkout@v4
58+
with:
59+
submodules: true
60+
61+
# Cache key is unique to the combination of runner OS + architecture (matrix.arch-id) + release tag
62+
- name: Restore ${{ env.LIBRARY_RELEASE_TAG }} binaries from cache if available
63+
id: cache-restore
64+
uses: actions/cache@v4
65+
with:
66+
key: ${{ runner.os }}-${{ matrix.platform.arch-id }}-${{ env.LIBRARY_RELEASE_TAG }}
67+
path: ${{ env.LIBRARY_DESTINATION_DIRECTORY}}/${{ matrix.platform.release-file-pattern }}
68+
69+
# Only the binaries required for the current platform are downloaded. Note that the distributed
70+
# wheel for proplib python packages includes all binaries, so that the wheel is inherently cross-platform.
71+
- name: Download required ${{ env.LIBRARY_RELEASE_TAG }} binaries
72+
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' }}
73+
uses: robinraju/release-downloader@v1
74+
with:
75+
repository: ${{ env.LIBRARY_BASE_REPO }}
76+
tag: ${{ env.LIBRARY_RELEASE_TAG }}
77+
fileName: ${{ matrix.platform.release-file-pattern }}
78+
tarBall: false
79+
zipBall: false
80+
out-file-path: ${{ env.LIBRARY_DESTINATION_DIRECTORY }}
81+
82+
- name: Set up Python ${{ matrix.py }}
83+
uses: actions/setup-python@v5
84+
with:
85+
architecture: ${{ matrix.platform.arch-id }}
86+
python-version: ${{ matrix.py }}
87+
cache: 'pip'
88+
89+
- name: Install dependencies for testing
90+
run: python -m pip install -e .[tests]
91+
92+
- name: Run pytest
93+
run: pytest --cov-report=term-missing --no-cov-on-fail --cov

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tests/data"]
2+
path = tests/data
3+
url = https://github.com/NTIA/p2108-test-data

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: end-of-file-fixer
1717
- id: trailing-whitespace
1818
- repo: https://github.com/asottile/pyupgrade
19-
rev: v3.19.0
19+
rev: v3.19.1
2020
hooks:
2121
- id: pyupgrade
2222
args: ["--py39-plus"]
@@ -33,7 +33,7 @@ repos:
3333
- id: black
3434
types: [file, python]
3535
- repo: https://github.com/igorshubovych/markdownlint-cli
36-
rev: v0.42.0
36+
rev: v0.43.0
3737
hooks:
3838
- id: markdownlint
3939
types: [file, markdown]

.zenodo.json

+30-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
{
2+
"upload_type": "software",
3+
"publication_date": "2024-12-11",
4+
"title": "Recommendation ITU-R P.2108, Python Wrapper",
25
"creators": [
36
{
4-
"orcid": "TODO-TEMPLATE",
7+
"name": "Romaniello, Anthony W.",
58
"affiliation": "U.S. Department of Commerce, National Telecommunications and Information Administration, Institute for Telecommunication Sciences",
6-
"name": "TODO-TEMPLATE"
9+
"orcid": "0000-0001-8437-6504"
710
}
811
],
9-
"license": "NTIA Public Domain",
10-
"title": "TODO-TEMPLATE, Python Wrapper",
11-
"upload_type": "software",
12-
"version": "TODO-TEMPLATE",
13-
"keywords": ["TODO-TEMPLATE"],
14-
"communities": [
15-
{"identifier": "its-proplib"}
16-
]
12+
"description": "This repository contains a Python wrapper for the NTIA/ITS implementation of Recommendation ITU-R P.2108. This Recommendation contains three methods for the prediction of clutter loss: Height Gain Terminal Correction Model, Terrestrial Statistical Model, and Aeronautical Statistical Model. The software implements Section 3 of Annex 1 of the Recommendation. This Python package wraps the NTIA/ITS C++ implementation.",
13+
"keywords": [
14+
"clutter",
15+
"ITU",
16+
"ITU-R",
17+
"propagation"
18+
],
19+
"related_identifiers": [
20+
{
21+
"identifier": "https://github.com/NTIA/p2108",
22+
"relation": "isSupplementTo",
23+
"resource_type": "software"
24+
},
25+
{
26+
"identifier": "https://github.com/NTIA/p2108-test-data",
27+
"relation": "isSupplementedBy",
28+
"resource_type": "dataset"
29+
},
30+
{
31+
"identifier": "https://ntia.github.io/propagation-library-wiki/models/P2108/",
32+
"relation": "isDocumentedBy",
33+
"resource_type": "softwaredocumentation"
34+
}
35+
],
36+
"version": "1.0.0"
1737
}

CITATION.cff

+5-23
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
cff-version: 1.2.0
22
title: >-
3-
Recommendation ITU-R P.2108-1, U.S. Reference Python
4-
Implementation
3+
Recommendation ITU-R P.2108, Python Wrapper
54
message: Please cite this software using these metadata.
65
type: software
76
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
7+
- given-names: Anthony W.
188
family-names: Romaniello
19-
name-particle: W.
209
2110
affiliation: >-
2211
U.S. Department of Commerce, National
@@ -26,27 +15,20 @@ authors:
2615
- name: >-
2716
U.S. Department of Commerce, National
2817
Telecommunications and Information Administration,
29-
Institute for Telecommunications Sciences
18+
Institute for Telecommunication Sciences
3019
address: 325 Broadway
3120
city: Boulder
3221
country: US
3322
post-code: '80305'
3423
region: Colorado
24+
alias: NTIA/ITS
3525
3626
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.
4227
repository-code: 'https://github.com/NTIA/p2108-python'
43-
url: 'https://github.com/NTIA/propagation/wiki'
44-
repository: 'https://github.com/NTIA/p2108'
28+
url: 'https://ntia.github.io/propagation-library-wiki/models/P2108/'
4529
keywords:
4630
- propagation
4731
- rf
4832
- clutter
4933
- itu
50-
license: 'NTIA Public Domain'
5134
version: 1.0.0
52-
date-released: '2024-05-24'

GitHubRepoPublicReleaseApproval.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# GitHub Repository Public Release Approval
2+
3+
**Project Name:** NTIA/OSM Research and Development
4+
5+
**Software Name:** Recommendation ITU-R P.2108, Python Wrapper
6+
7+
The project identified above, which is contained within the repository this
8+
document is stored in, has met the following criteria for public release:
9+
10+
1. [ ] The project, including the test criteria, meets the requirements defined
11+
in the ITS Software Development Publication Policy for making a repository public.
12+
The major pre-established criteria for publication are listed below, and the check
13+
mark next to each attests that the criterion has been met.
14+
* [ ] Unit tests are available and the software has been tested against the unit tests.
15+
* [ ] The software can be compiled and/or used on Windows, macOS, and Linux.
16+
* [ ] The repository structure and contents follow from the ITS PropLib template, and
17+
all template or placeholder code has been removed.
18+
* [ ] The repository includes the appropriate `LICENSE.md` file
19+
2. [ ] Any test data necessary for the code and its unit tests to function is included in this
20+
GitHub repository, either directly or as a linked Git submodule.
21+
3. [ ] The README.md file has passed editorial review from the ITS Publications Office.
22+
4. [ ] The project complies with the ITS Code Style Guide or an appropriate style
23+
guide as agreed to by the sponsor, project lead, or Supervising Division Chief.
24+
5. [ ] Approved disclaimer and licensing language has been included.
25+
26+
In order to complete this approval, please create a new branch, upload and commit
27+
your version of this Markdown document to that branch, then create a pull request
28+
for that branch. The following must login to GitHub and approve that pull request
29+
before the pull request can be merged and this repo made public:
30+
31+
* Project Lead: Brian Lain
32+
* Supervising Division Chief or Release Authority: Chris Anderson

0 commit comments

Comments
 (0)