You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive, file-by-file comparison identifying everything missing from touchstone-python relative to touchstone-dotnet.
Executive Summary
The Python repo is a functional port of the .NET repo but is missing features across 5 major areas: parser API surface, model richness, extension methods, test depth, and project infrastructure. There are ~40 discrete gaps ranging from missing async parsing to absent GitHub templates.
1. Parser API Surface
1.1 Missing: parse(stream) Overload
.NET: TouchstoneParser.Parse(Stream stream, string? fileName) — parse from any stream (network, memory, zip entry, etc.)
Python: ❌ Missing entirely. Only parse(filepath) and parse_string(content) exist.
Impact: Can't parse from in-memory streams, BytesIO, or network responses without first converting to string.
1.2 Missing: parse(TextReader) Overload
.NET: TouchstoneParser.Parse(TextReader reader, string? fileName) — parse from any TextReader
Python: ❌ Missing entirely. No equivalent that accepts file-like objects / TextIO.
Impact: Can't pass open file handles, StringIO, or piped input.
1.3 Missing: ParseAsync() — Async Parsing
.NET: TouchstoneParser.ParseAsync(string filePath, CancellationToken ct) with full async file I/O and cancellation support.
Python: ❌ Missing entirely. No async def parse_async() or asyncio integration.
Impact: Blocks the event loop in async applications (FastAPI, Jupyter async cells, etc.)
README claims it doesn't have it — but .NET advertises it as a feature.
1.4 Missing: Public DetectPortCount() Method
.NET: TouchstoneParser.DetectPortCount(string fileName) — a public static utility.
Python: Port detection is inline inside parse() and not exposed as a public method.
Impact: Users can't validate filenames programmatically without parsing.
1.5 Missing: Multiple Option Line Detection
.NET: Parser explicitly throwsTouchstoneParserException("Multiple option lines found") if a second # line appears.
Python: Parser simply breaks on the first # line and ignores any subsequent ones. Silently swallows malformed files.
Impact: Corrupted files pass validation silently.
1.6 Missing: Invalid Numeric Data Error Reporting
.NET DataLineTokenizer: Throws TouchstoneParserException("Invalid numeric value: '{token}'", lineNumber) with the exact line number and bad token.
Python DataLineTokenizer: Silently continues past unparseable tokens with except ValueError: continue.
Impact: Data corruption goes undetected; debugging is much harder.
2. Models — Missing Features
2.1 Missing: FrequencyPoint Class
.NET: A dedicated FrequencyPoint class encapsulates a single frequency + its N×N NetworkParameter[,] matrix. Provides:
.NET: Tests parsing 10,000 frequency points from a generated string via TouchstoneParser.ParseString().
Python: Only tests constructing a TouchstoneData object with random data. ❌ Does not test the actual parser under load.
5. Project Infrastructure — Missing Items
5.1 Missing: .github/ISSUE_TEMPLATE/ Directory
.NET: Has bug_report.md and feature_request.md issue templates.
Python: ❌ No issue templates at all.
5.2 Missing: .github/PULL_REQUEST_TEMPLATE.md
.NET: Has a detailed PR template with type-of-change checkboxes, test checklist, etc.
Python: ❌ No PR template.
5.3 Missing: .github/dependabot.yml
.NET: Configured for weekly NuGet + GitHub Actions dependency updates.
Python: ❌ No Dependabot for pip/PyPI or GitHub Actions.
5.4 Missing: .editorconfig
.NET: Comprehensive .editorconfig with C#-specific formatting, naming conventions, and code quality rules.
Python: ❌ No .editorconfig. Has black and isort config in pyproject.toml but no cross-editor config.
5.5 Missing: icon.png — Package Icon
.NET: Has a 341KB icon.png used as the NuGet package icon.
Python: ❌ No package icon for PyPI.
5.6 Missing: Plotting Example
.NET: Has Touchstone.Plotting.Example using ScottPlot to generate S-parameter plots with saved PNG output.
Python: The quickstart.py example has a matplotlib section, but it calls data.magnitude() and data.phase() which don't exist as methods on TouchstoneData. The example is broken.
5.7 Missing: Comprehensive Parser Example
.NET: Touchstone.Parser.Examples/Program.cs is a 102-line demo covering parsing, LINQ queries, passband analysis, VSWR table, CSV export, and Touchstone re-export with beautiful ASCII formatting.
Python: quickstart.py is 58 lines and uses APIs that don't match the actual codebase (data.magnitude(), data.phase()). It's incomplete and broken.
5.8 Missing: Benchmarks
.NET: Has a full Touchstone.Parser.Benchmarks project using BenchmarkDotNet with [MemoryDiagnoser] for memory allocation tracking.
Python: .benchmarks directory is empty. pytest-benchmark is listed as a dev dependency but no benchmark tests exist.
5.9 Missing: Dual Package Registry Publishing
.NET publish.yml: Publishes to both NuGet.org and GitHub Packages.
Python publish.yml: Only publishes to PyPI. ❌ No GitHub Packages.
5.10 Missing: NuGet Artifact Upload in CI
.NET ci.yml: Runs dotnet pack as validation and uploads the .nupkg as a CI artifact with 7-day retention.
Python ci.yml: ❌ No package build validation in CI. Doesn't build a wheel/sdist to verify packaging works.
5.11 Missing: NuGet Cache
.NET ci.yml: Uses actions/cache@v4 for NuGet package caching.
Python ci.yml: ❌ No pip cache configured. Slower CI runs.
Python CI: Uses actions/checkout@v3, actions/setup-python@v4 — ❌ outdated by 1-2 major versions.
Python CD: Also uses actions/checkout@v3, actions/setup-python@v4 — ❌ outdated.
5.13 Missing: Redundant CD Workflow
Python has bothcd.yml (triggered on release, uses twine) andpublish.yml (triggered on push/tag, uses gh-action-pypi-publish). These overlap and could publish the same version twice or conflict.
.NET: Has a single publish.yml — clean and non-redundant.
6. Documentation Gaps
6.1 Missing: Auto-generated API Docs
.NET docs/: Uses DocFX with docfx.json to auto-generate API reference from XML doc comments. Has _site/ build output.
Python docs/: Uses MkDocs with mkdocs.yml, but the docs/api/ directory is empty — no auto-generated docs from docstrings. The api.md is a manually written stub.
6.2 README Inaccuracies
Python README claims "LINQ-friendly APIs" and mentions GetS11(), GetS21(), GetParameter(i, j) — ❌ None of these methods exist in the Python codebase.
Python README claims "Zero dependencies — pure Python, no external packages" — ❌ False: the library requires numpy>=1.20.0.
Python README shows FrequencyPoint and NetworkParameter as class names — ❌ These classes don't exist in the Python code.
6.3 Missing: Ecosystem Cross-reference
.NET README: Links to the Python version: "check out the Python version for Python-based workflows"
Python README: ❌ Does not link back to the .NET version.
The most critical gaps are: (1) missing FrequencyPoint and NetworkParameter classes that form the foundation of the type-safe API, (2) broken/inaccurate examples and README claims, (3) silent error swallowing in the tokenizer, and (4) ~65 missing test cases.