applyaf
applyaf is a Python 3.12+ module that applies frequency dependent antenna factors and cable losses to spectrum analyzer readings in order to calculate the incident field. Any duplicate frequency entries in the antenna factors or cable losses data are removed before interpolating the frequencies to match those of the spectrum analyzer readings.
Inputs
Three csv files containing the following are required inputs:
- Spectrum analyzer measurements
- Antenna factor data
- Cable loss data
Each CSV file should contain data in two columns:
- Frequency
- Amplitude
The amplitude is expected to be in dB.
Dependencies
See the pyproject.toml and uv.lock files for the dependency requirements.
Future Improvements
Some thoughts for future improvements include:
- Allowing CSV data files that contain non-dB amplitudes and then convert as needed. Should this be a per-file setting?
- Generalize the code to handle a variable number (>3) of data to be interpolated and applied to the given data set.
- If the code is generalized, should this be wrapped into the siganalysis project or left on its own?
Contributing
Contributions are welcome! To contribute please:
- Fork the repository
- Create a feature branch
- Add code and tests
- Pass lint and tests
- Submit a pull request
Development Setup
Development Setup Using uv
Development Setup on macOS
$ brew install uv ruff just
With uv, ruff and Just installed, development has been simplified to simply running Just to see the available commands.
$ just
Releasing to PyPI
just release cuts the release. It lints, type checks, and tests, then shows
the entries waiting under Unreleased and the version each kind of bump would
produce, and asks which to cut. Once answered it bumps the version, closes out
the CHANGELOG, updates the lock file, commits, and tags. Pushing the tag is
what publishes.
$ just release
Releasing from 3.0.1, with these entries under Unreleased:
### Fixed
- `read_csv_file()` returned a 0-d array for a single row file.
1) patch 3.0.1 -> 3.0.2
2) minor 3.0.1 -> 3.1.0
3) major 3.0.1 -> 4.0.0
q) cancel
Which release? [1] 2
Tagged v3.1.0. Publish it with:
git push --follow-tags
The entries decide the bump, so the prompt puts them next to the versions they
would produce rather than leaving the choice to memory. Answering q, or
anything unrecognized, changes nothing.
The tag push runs the release workflow, which rechecks the tag against the
version in pyproject.toml, repeats the checks, builds, and uploads. There is
no PyPI API token anywhere: the workflow authenticates with trusted
publishing, which mints a short lived credential from the GitHub OIDC
identity of that run.
Pushing the tag is the point of no return, since PyPI never lets a version
number be reused. Everything just release does is local and amendable until
then, and it refuses to start against a dirty working tree, off master, on a
master behind its upstream, with a CHANGELOG whose Unreleased section is
empty, or when the tag it would create already exists. A refusal leaves the
version and the CHANGELOG untouched.
just build runs the same checks and produces the same distributions without
releasing anything, which is the way to inspect what CI would upload.
This depends on one piece of configuration that lives outside the repository. A
trusted publisher has to be registered for applyaf on
PyPI, pointing at the questrail/applyaf repository, the release.yml
workflow, and the pypi environment. It is a one time setup per project.
License
applyaf is released under the MIT license. Please see the LICENSE.txt file for more information.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file applyaf-3.0.1.tar.gz.
File metadata
- Download URL: applyaf-3.0.1.tar.gz
- Upload date:
- Size: 35.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
847fb4edcfe240a29bbdd5be6c1cfa7600a608f7c825ee6dad05b59c3a8bd8d7
|
|
| MD5 |
b1ac279d036b56b81d35f66a22a8f58b
|
|
| BLAKE2b-256 |
95d4a8192ed781be5be00a014b955bc5f4edf91e8dd16342233db8520167237e
|
File details
Details for the file applyaf-3.0.1-py3-none-any.whl.
File metadata
- Download URL: applyaf-3.0.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8d5ccfb305d7a654aee9ab93ee82cef20aed8795041a69f26b02b8ae4dbc6e3
|
|
| MD5 |
afc9d86986e6ceb10cd1ba8bb4c0e6e1
|
|
| BLAKE2b-256 |
9518e0ced7b1e13934b4da170822dfb88d7c27199e33208c2022462c5cdee659
|