-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix X SPICE element parsing for Calibre-style model names #528
Conversation
Reviewer's Guide by SourceryThis pull request fixes the parsing of X SPICE elements with Calibre-style model names. Previously, the code would remove brackets around model names for all elements, including X elements. This caused issues because X elements use a different syntax for model names. The fix is to only remove the brackets for resistors and capacitors. Sequence diagram for SPICE element parsing with Calibre-style model namessequenceDiagram
participant Parser as SPICE Parser
participant Regex as Regex Engine
participant Element as Element Handler
Parser->>Element: parse_element(s, element)
alt element != 'X'
Element->>Regex: Remove brackets from model name
Regex-->>Element: Processed string
else element == 'X'
Note over Element: Keep original model name format
end
Element-->>Parser: ParseElementData
Class diagram showing the modified parse_element methodclassDiagram
class NetlistSpiceReader {
+parse_element(s: str, element: str) ParseElementData
}
note for NetlistSpiceReader "Modified to preserve X element model names"
class ParseElementData {
}
NetlistSpiceReader ..> ParseElementData : creates
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome! thank you Niko!
Summary by Sourcery
Bug Fixes:
$[model_name]
) were not parsed correctly for elements other than resistors and capacitors.