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:
NamedTupleBody + termination dimensions for a chip component (from a datasheet).
- Parameters:
length (Toleranced)
width (Toleranced)
height (Toleranced)
lead (Toleranced)
- 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:
- Parameters:
- round_sig(value, sig_figs)[source]#
Round a positive value to
sig_figssignificant 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.
- 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 Fbecomes99.99999999999999 nanofarad, and2.2e6 ohmbecomes2.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_keyis the JITXSMT_CHIP_DEFScase name (the imperial size, e.g."0603"). Whendimsis given, its datasheet values override the generator defaults (length-> span,width-> lead/body width,lead-> foot length,height-> body height). WhendimsisNone, 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).
- 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(). Withshort_trace=Trueboth pins must be ports (not nets) and a short trace is added to each terminal.
- check_eseries(ohms, tolerance)[source]#
Raise if
ohmsis not a standard E-series value fortolerance.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.