-
Notifications
You must be signed in to change notification settings - Fork 81
Init SPICE Integration into Core #1427
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
Conversation
seveibar
commented
Oct 2, 2025
- add spicey, update props and circuit json
- wip spice analysis
The latest updates on your projects. Learn more about Vercel for GitHub.
|
test("spice-analysis01-platform-config", async () => { | ||
const { circuit } = getTestFixture() | ||
|
||
circuit.platform = { | ||
spiceEngineMap: { | ||
spicey: { | ||
async simulate(spiceString: string) { | ||
return { | ||
simulationResultCircuitJson: [ | ||
{ | ||
type: "simulation_experiment", | ||
simulation_experiment_id: "1", | ||
} as any, | ||
{ | ||
type: "simulation_transient_voltage_graph", | ||
simulation_experiment_id: "1", | ||
voltage_levels: [ | ||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, | ||
], | ||
start_time_ms: 0, | ||
end_time_ms: 10, | ||
time_per_step: 0.001, | ||
simulation_transient_voltage_graph_id: | ||
"simulation-transient-voltage-graph-1", | ||
name: "simulation-transient-voltage-graph-1", | ||
} as SimulationTransientVoltageGraph, | ||
], | ||
} | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
circuit.add( | ||
<board schMaxTraceDistance={10}> | ||
<voltagesource | ||
name="VS1" | ||
peakToPeakVoltage="3V" | ||
frequency="1kHz" | ||
waveShape="square" | ||
/> | ||
<switch name="SW1" spst /> | ||
<trace from="VS1.1" to="SW1.1" /> | ||
<capacitor | ||
name="C1" | ||
capacitance="10uF" | ||
connections={{ pos: "SW1.2", neg: "VS1.2" }} | ||
/> | ||
<resistor | ||
name="R1" | ||
resistance="1k" | ||
connections={{ pin1: "SW1.2", pin2: "VS1.2" }} | ||
/> | ||
</board>, | ||
) | ||
|
||
await circuit.renderUntilSettled() | ||
|
||
const circuitJson = circuit.getCircuitJson() | ||
|
||
expect( | ||
circuitJson.some((el) => el.type === "simulation_transient_voltage_graph"), | ||
).toBe(true) | ||
|
||
expect(circuit).toMatchSimulationSnapshot(import.meta.path) | ||
}) |
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.
This test file violates the testing rule requiring *.test.ts
files to contain at most one test(...)
function. When additional tests are needed for a feature area, they must be split into separate numbered files (e.g., spice-analysis1.test.tsx
, spice-analysis2.test.tsx
). While this file currently contains only one test, the filename spice-analysis01-platform-config.test.tsx
suggests it's part of a series but doesn't follow the proper numbered naming convention.
Spotted by Diamond (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.