Skip to content

feat(compiler): add params_map for setting-to-field name mapping - #41

Merged
cdaunt merged 1 commit into
developmentfrom
feat/issue-40-param-name-mapping
Jul 30, 2026
Merged

feat(compiler): add params_map for setting-to-field name mapping#41
cdaunt merged 1 commit into
developmentfrom
feat/issue-40-param-name-mapping

Conversation

@cdaunt

@cdaunt cdaunt commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds params_map parameter to compile_netlist() and compile_circuit() that renames netlist setting keys to model field names before compilation
  • Mapping is keyed by component type name, e.g. {"thermal_heater": {"length": "length_um"}}
  • Renaming runs in pure-Python setup (pre-JAX tracing) — zero runtime performance impact

Closes #40

Test plan

  • test_params_map_renames_setting — single key rename works
  • test_params_map_none_is_noop — default None doesn't change behavior
  • test_params_map_unmapped_keys_pass_through — unmatched keys pass through
  • test_params_map_multiple_renames — multiple keys renamed in one component
  • test_params_map_through_compile_circuit — threads through high-level API, DC solve succeeds
  • test_params_map_dc_matches_direct — mapped circuit DC result matches direct compilation
  • Existing test suite (51 tests) passes with no regressions

🤖 Generated with Claude Code

https://claude.ai/code/session_011yNsfyNipiGFMPmBDfMpfu

Add `params_map` parameter to `compile_netlist()` and `compile_circuit()`
to rename netlist setting keys to model field names before compilation.
This allows users to decouple netlist setting names from the underlying
model's expected field names, resolving issue #40.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cdaunt
cdaunt marked this pull request as ready for review July 30, 2026 15:26
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cdaunt
cdaunt merged commit 66ec221 into development Jul 30, 2026
6 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