Skip to content

Commit 85ebeb9

Browse files
Merge branch 'main' into AddPublicReleaseForm
2 parents 29a9266 + 1a06d57 commit 85ebeb9

16 files changed

+318
-106
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

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ name: Validate CITATION.cff
22

33
on:
44
push:
5+
branches: ["main", "dev"]
56
paths:
6-
- CITATION.cff
7-
- .github/workflows/cff-validator.yml
7+
- 'CITATION.cff'
8+
- '.github/workflows/cff-validator.yml'
89
pull_request:
10+
branches: ["main", "dev"]
911
paths:
10-
- CITATION.cff
11-
- .github/workflows/cff-validator.yml
12+
- 'CITATION.cff'
13+
- '.github/workflows/cff-validator.yml'
1214
workflow_dispatch:
1315

1416
jobs:
@@ -22,4 +24,4 @@ jobs:
2224
- name: Checkout repository
2325
uses: actions/checkout@v4
2426
- name: Validate CITATION.cff
25-
uses: dieghernan/cff-validator@v3
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

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"upload_type": "software",
3+
"publication_date": "2024-12-11",
4+
"title": "Recommendation ITU-R P.2108, Python Wrapper",
5+
"creators": [
6+
{
7+
"name": "Romaniello, Anthony W.",
8+
"affiliation": "U.S. Department of Commerce, National Telecommunications and Information Administration, Institute for Telecommunication Sciences",
9+
"orcid": "0000-0001-8437-6504"
10+
}
11+
],
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"
37+
}

CITATION.cff

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ authors:
1818
Institute for Telecommunication Sciences
1919
address: 325 Broadway
2020
city: Boulder
21-
country: CO
21+
country: US
2222
post-code: '80305'
23+
region: Colorado
2324
alias: NTIA/ITS
2425
2526
website: 'https://its.ntia.gov'

GitHubRepoPublicReleaseApproval.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mark next to each attests that the criterion has been met.
1717
all template or placeholder code has been removed.
1818
* [x] The repository includes the appropriate `LICENSE.md` file
1919
2. [x] Any test data necessary for the code and its unit tests to function is included in this
20-
GitHub repository, or in a parent repository which includes this one as a Git submodule.
20+
GitHub repository, either directly or as a linked Git submodule.
2121
3. [x] The README.md file has passed editorial review from the ITS Publications Office.
2222
4. [x] The project complies with the ITS Code Style Guide or an appropriate style
2323
guide as agreed to by the sponsor, project lead, or Supervising Division Chief.

0 commit comments

Comments
 (0)