Add unit tests for kicadtoNgspice Convert module - #624
Open
caveman210 wants to merge 1 commit into
Open
Conversation
Related Issues Improves test coverage of the KiCad-to-ngspice netlist conversion pipeline by adding automated unit tests for the Convert module. The tests verify source-parameter injection for all six source types, analysis-card generation (AC/TRAN/DC/.op), unit-prefix conversion and device reference lookup, helping detect regressions during future development. Purpose The main objective is to lock the current behaviour of the schematic-converter logic: correct rewriting of source lines in the netlist, exact ngspice analysis-card output and SI-prefix handling. A separate known-issues suite pins current defects (e.g. meg misread as milli, ac substring collision in node names, silently swallowed entry-key errors) so they surface explicitly until fixed. Approach Created a unittest-based test suite under: unit_tests/test_convert.py unit_tests/known_issues/test_convert.py The following functionality is covered: - converttosciform/defaultvalue unit conversion and defaults - Source-parameter injection for sine, pulse, pwl, ac, dc and exp sources - AC, TRAN, DC and .op analysis-card generation - Two-source DC sweep output and empty-field defaults - .lib to .xml reference lookup via getReferenceName - Known defects pinned in a separate characterisation suite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Improves test coverage of the KiCad-to-ngspice netlist conversion pipeline by adding automated unit tests for the Convert module. The tests verify source-parameter injection for all six source types, analysis-card generation (AC/TRAN/DC/.op), unit-prefix conversion and device reference lookup, helping detect regressions during future development.
Purpose
The main objective is to lock the current behaviour of the schematic-converter logic: correct rewriting of source lines in the netlist, exact ngspice analysis-card output and SI-prefix handling. A separate known-issues suite pins current defects (e.g. meg misread as milli, ac substring collision in node names, silently swallowed entry-key errors) so they surface explicitly until fixed.
Approach
Created a unittest-based test suite under:
unit_tests/test_convert.py
unit_tests/known_issues/test_convert.py
The following functionality is covered: