Skip to content

Conversation

seveibar
Copy link
Contributor

@seveibar seveibar commented Oct 2, 2025

  • add spicey, update props and circuit json
  • wip spice analysis

Copy link

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview Comment Oct 3, 2025 11:03pm

@seveibar seveibar marked this pull request as ready for review October 3, 2025 23:03
Comment on lines +5 to +70
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)
})
Copy link
Contributor

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)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@seveibar seveibar merged commit 3dad372 into main Oct 3, 2025
12 checks passed
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