chip_smt module#

Shared building blocks for two-terminal SMT chip component families.

Vendor- and component-agnostic infrastructure used by the per-manufacturer passive families (yageo_rc, panasonic_erj, vishay_crcw, samsung_cl): a chip land-pattern builder driven by datasheet body dimensions, a two-terminal .insert() placement helper, a carry-correct significant-figure rounder for the value-code encoders, and an optional E-series resistance check. Vendor-specific data — size / part-number tables and value-code schemes — lives in each family module, since those genuinely differ between manufacturers.

(This module began life as chip_resistor.py; it was renamed once the MLCC capacitor family started using it — everything here except check_eseries is component-agnostic.)

class ChipDims(length: Toleranced, width: Toleranced, height: Toleranced, lead: Toleranced)[source]#

Bases: NamedTuple

Body + termination dimensions for a chip component (from a datasheet).

Parameters:
length: Toleranced#

Alias for field number 0

width: Toleranced#

Alias for field number 1

height: Toleranced#

Alias for field number 2

lead: Toleranced#

Alias for field number 3

datasheet_dim(typ, plus, minus=None)[source]#

Toleranced from a datasheet nominal and its +/- tolerances (mm).

One argument for a symmetric tolerance, two for an asymmetric one – chip datasheets print both (Vishay’s 0603 length is 1.55 +0.10 / -0.05).

Return type:

Toleranced

Parameters:
round_sig(value, sig_figs)[source]#

Round a positive value to sig_figs significant figures.

Used by the family value-code encoders so rounding carries propagate correctly across decade boundaries (e.g. 9999 -> 10000), avoiding malformed or wrong part-number value fields.

Return type:

float

Parameters:
compact_value(quantity, sig_figs=6)[source]#

Scale a quantity to its natural SI prefix, without binary-float noise.

Use in place of PlainQuantity.to_compact(), which divides by a power of ten and so reintroduces representation error on exactly the inputs a passive library uses most: 100e-9 F becomes 99.99999999999999 nanofarad, and 2.2e6 ohm becomes 2.1999999999999997 megaohm. Those strings reach the BOM, and no build, type check or land-pattern test looks at them. Rounding the scaled magnitude restores the value the caller actually asked for.

Return type:

PlainQuantity

Parameters:
  • quantity (PlainQuantity)

  • sig_figs (int)

chip_smt_landpattern(size_key, dims=None)[source]#

Build a 2-pad SMT chip land pattern for the given case size.

size_key is the JITX SMT_CHIP_DEFS case name (the imperial size, e.g. "0603"). When dims is given, its datasheet values override the generator defaults (length -> span, width -> lead/body width, lead -> foot length, height -> body height). When dims is None, the generator’s standard EIA dimensions for the size are used — appropriate when a datasheet specifies the case only by its standard size code (with no custom mechanical drawing).

Return type:

SMT

Parameters:
insert_two_pin(component, pin_a, pin_b, *, short_trace=False)[source]#

Place a two-terminal component (ports p1/p2) into the active circuit.

Mirrors jitxlib.parts.Resistor.insert(). With short_trace=True both pins must be ports (not nets) and a short trace is added to each terminal.

Return type:

TypeVar(C, bound= _TwoPin)

Parameters:
check_eseries(ohms, tolerance)[source]#

Raise if ohms is not a standard E-series value for tolerance.

Two grades, because two is what these four datasheets between them name: E24 (>=5%) and E96 (tighter). Both ends are deliberate. Yageo’s tightest grade is +/-0.1% (code B) and its own datasheet puts that on E24/E96, so falling through to E192 would accept values no vendor here makes; and no vendor in the set offers +/-2%, so an E48 branch would have no caller. Add a series when a family that needs it lands, not before.

Return type:

None

Parameters: