Skip to content

feat: amplifier data-file generator extension - #31

Open
striderZA wants to merge 27 commits into
masterfrom
feat/amplifier-generator-extension
Open

feat: amplifier data-file generator extension#31
striderZA wants to merge 27 commits into
masterfrom
feat/amplifier-generator-extension

Conversation

@striderZA

Copy link
Copy Markdown
Owner

First extension built on the plugin extension system (#29): a built-in external-tool/generator extension that synthesizes a Touchstone .s2p + schema-v2 component JSON pair for an amplifier from datasheet parameters, loadable directly by the app's component library.

Design

Two-phase, fully headless workflow (the extension runner kills any tool process after 30s, so no interactive parameter entry is possible):

  1. Tools > Amplifier: New Params Template... — scaffolds a numbered params JSON template into rf-sim-generator-input/amplifier/. Instant, no dialog.
  2. Hand-edit that JSON (part number, manufacturer, gain-vs-freq points, optional NF/OIP3/P1dB/OIP2).
  3. Tools > Amplifier: Build from Params... — batch-processes every pending params file into rf-sim-libraries/amplifiers/<manufacturer>/<part>.json + .s2p (unilateral S-parameter approximation), moves consumed inputs to processed/.

Spec: docs/superpowers/specs/2026-07-30-amplifier-generator-extension-design.md
Plan: docs/superpowers/plans/2026-07-30-amplifier-generator-extension.md

Structure

  • extensions/amplifier-generator/plugin.json — manifest
  • extensions/amplifier-generator/bin/{params,touchstone,library,generate_amplifier}.py — stdlib-only Python, each independently unit-tested (26 tests)
  • tests/test_extensions.cpp — manifest discovery + full ExternalToolRunner end-to-end round-trip (including a ComponentLibrary::loadFile/all() proof that generated files actually load into the app)
  • tests/CMakeLists.txt — wires the Python suite into CTest so CI actually runs it

Depends on

#30 (fix/app-version-fetchcontent-clobber) — this branch's Task 7 commit bundles a temporary copy of that same fix (required for this branch's own tests: without it, this extension's compat.min_app_version manifest field makes ExtensionManager mark it Incompatible). Once #30 merges, this branch should rebase onto master to drop the duplicate.

Verification

  • cd extensions/amplifier-generator && python -m unittest discover -s tests -v — 26/26 pass
  • cmake --build build --target test_extensions && ctest --test-dir build -R test_extensions — pass
  • ctest --test-dir build -R amplifier_generator_python_tests — pass
  • Full subagent-driven-development flow: task-scoped review after each of 7 tasks (1 Critical fix on Task 5: unsupported freq_unit no longer crashes the whole build batch) + a final whole-branch review (1 Critical cross-task fix: generated JSON always includes the parameters key, since ComponentLibrary::loadFile treats it as mandatory)

Known limitation (documented, not fixed here)

tests/test_extensions.cpp test-case registration is sensitive to launch mechanism on this local Windows/MinGW toolchain (fewer tests register under direct MSYS-bash launch than under native process launch, e.g. ctest/CI). Root cause not fully isolated; verification for this PR relied on native-launch/ctest results. Out of scope for this PR.

striderZA added 27 commits July 30, 2026 18:56
…and wire python tests into CTest

- Add TEST_CASE exercising ExternalToolRunner against the real
  amplifier-generator extension (template scaffold -> build) end-to-end.
- Fix APP_VERSION being compiled as an empty string: FetchContent'd
  dependencies' nested project() calls reset PROJECT_VERSION before
  app/CMakeLists.txt reads it, which made every manifest with a non-empty
  compat.min_app_version (e.g. amplifier-generator's) spuriously
  Incompatible. Capture PROJECT_VERSION into RFSIM_APP_VERSION right after
  the top-level project() call instead.
- Update 4 pre-existing app-level extension tests that assumed exactly one
  external tool would be discovered; now that the built-in
  amplifier-generator extension correctly registers as Ok, project-local
  fixture tools must be located by id instead of assumed to be tools.front().
- Wire the extension's Python unit tests (test_params/test_touchstone/
  test_library/test_generate_amplifier, 26 tests) into CTest via
  find_program(python3/python) + add_test(), so CI's ctest-only run
  actually exercises them.
… JSON so ComponentLibrary::loadFile accepts minimal-input builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant