def test_tolerance(self): self.assertEqual(str(Tolerance('10%')), "\u00B110%") self.assertEqual(str(Tolerance('-10%', '+10%')), "\u00B110%") self.assertEqual(str(Tolerance('-10%', '+20%')), "-10%...+20%") self.assertEqual(str(Tolerance('1pF')), "\u00B11pF") self.assertEqual(str(Tolerance('-1pF', '+1pF')), "\u00B11pF") self.assertEqual(str(Tolerance('-1pF', '+2pF')), "-1pF...+2pF") with self.assertRaises(ValueError): Tolerance('-20%')
def test_NR(self): part = inductors_partname_decoder.resolve('NR6028T220M') self.assertIsNotNone(part) component = Inductor(inductor_type=Inductor.Type.WireWoundInductor, manufacturer="Taiyo Yuden", partnumber="NR6028T220M", working_temperature_range=TemperatureRange('-25', '120'), series="NR", inductance='22uH', tolerance=Tolerance('20%'), q=None, dc_resistance=None, rated_current=None, self_resonant_frequency=None, max_working_voltage=None, case='6028', note='SMD Power Inductors') self.assertEqual(component, part)
def test_IHLP(self): part = inductors_partname_decoder.resolve('IHLP2525AEER1R0M01') self.assertIsNotNone(part) component = Inductor(inductor_type=Inductor.Type.WireWoundInductor, manufacturer="Vishay", partnumber="IHLP2525AEER1R0M01", working_temperature_range=TemperatureRange('-55', '125'), series="IHLP", inductance='1uH', tolerance=Tolerance('20%'), q=None, dc_resistance=None, rated_current=None, self_resonant_frequency=None, max_working_voltage='40V', case='2525', note='Commercial / High Saturation') self.assertEqual(component, part)
def test_LQG(self): part = inductors_partname_decoder.resolve('LQG18HNR10J00D') self.assertIsNotNone(part) component = Inductor( inductor_type=Inductor.Type.MultilayerInductor, manufacturer="Murata Manufacturing", partnumber="LQG18HNR10J00D", working_temperature_range=TemperatureRange('-55', '125'), series="LQG", inductance='100nH', tolerance=Tolerance('5%'), q='8', dc_resistance=None, rated_current=None, self_resonant_frequency=None, max_working_voltage=None, case=Chip('0603', T=Dimmension('0.8mm', LengthTolerance('0.15mm'))), note=None) self.assertEqual(component, part)
def test_equality_operator(self): self.assertEqual(Tolerance('-20%', '20%'), Tolerance('20%'))
from ..units.temperature import TemperatureRange from .common import * import re size = { '0201': '0201', '0402': '0402', '0603': '0603', '0805': '0805', '1206': '1206', '1210': '1210', '1812': '1812' } tolerance = { 'B': Tolerance('-0.1pF', '+0.1pF'), 'C': Tolerance('-0.25pF', '+0.25pF'), 'D': Tolerance('0.5pF'), 'F': Tolerance('1%'), 'G': Tolerance('2%'), 'J': Tolerance('5%'), 'K': Tolerance('10%'), 'M': Tolerance('20%'), 'Z': Tolerance('-20%', '+80%') } packing_style = { 'R': 'Paper/PE taping reel; Reel 7 inch', 'K': 'Blister taping reel; Reel 7 inch', 'P': 'Paper/PE taping reel; Reel 13 inch', 'F': 'Blister taping reel; Reel 13 inch',
'1H': '50V', '1J': '63V', '1K': '80V', '2A': '100V', '2C': '160V', '2D': '200V', '2E': '250V', '2F': '315V', '2V': '350V', '2G': '400V', '2W': '450V', '2J': '630V', '3A': '1000V', 'MF': '250VAC'} tolerance = {'B': Tolerance('-0.1pF', '+0.1pF'), 'C': Tolerance('-0.25pF', '+0.25pF'), 'D': Tolerance('-0.5pF', '+0.5pF'), 'F': Tolerance('1%'), 'G': Tolerance('2%'), 'J': Tolerance('5%'), 'K': Tolerance('10%'), 'M': Tolerance('20%'), 'W': Tolerance('-0.05pF', '+0.05pF')} pitch = {'020': '2.0', '025': '2.5', '035': '3.5', '050': '5.0', '075': '7.5'}
'1A': '10V', '1C': '16V', '1E': '25V', '1V': '35V', '1H': '50V', '1J': '63V', '1K': '100V', '2C': '160V', '2D': '200V', '2E': '250V', '2V': '350V', '2G': '400V', '2W': '450V', '2H': '500V'} tolerance = {'F': Tolerance('1%'), 'G': Tolerance('2%'), 'J': Tolerance('5%'), 'K': Tolerance('10%'), 'M': Tolerance('20%')} size_code = {'D11': '5x11', 'E11': '6.3x11', 'F11': '8x11', 'F12': '8x12', 'G20': '10x20', 'W20': '12.5x20', 'W25': '12.5x25', 'L25': '16x25', 'L35': '16x35', 'M40': '18x40'}
# http://www.kemet.com/Lists/FileStore/f2097g.pdf from partname_resolver.components.capacitor import Capacitor from partname_resolver.units.capacitanceTolerance import Tolerance from ..units.temperature import TemperatureRange import re from decimal import Decimal tolerance = { 'B': Tolerance('0.10pF'), 'C': Tolerance('0.25pF'), 'D': Tolerance('0.5pF'), 'F': Tolerance('1%'), 'G': Tolerance('2%'), 'J': Tolerance('5%'), 'K': Tolerance('10%'), 'M': Tolerance('20%') } operating_temperature_range = { 'B': TemperatureRange('-55', '125'), 'C': TemperatureRange('-55', '125'), 'D': TemperatureRange('-55', '125'), 'F': TemperatureRange('-55', '125'), 'G': TemperatureRange('-55', '125'), 'J': TemperatureRange('-55', '125'), 'K': TemperatureRange('-55', '125'), 'M': TemperatureRange('-55', '125') } def kemet(partname):
'1K': '80V', '2A': '100V', '2C': '160V', '2D': '200V', '2E': '250V', '2F': '315V', '2V': '350V', '2G': '400V', '2W': '450V', '2J': '630V', '3A': '1000V', 'MF': '250VAC' } tolerance = { 'K': Tolerance('10%'), 'M': Tolerance('20%'), 'V': Tolerance('-10%', '+20%'), 'Q': Tolerance('-10%', '+30%'), 'T': Tolerance('-10%', '+50%') } case_diameter = { '03': '3mm', '04': '4mm', '05': '5mm', '6L': '6.3mm', '08': '8mm', '10': '10mm', '12': '12.5mm', '14': '14.5mm',
'1C': '16V', '1E': '25V', 'YA': '35V', '1H': '50V', '1J': '63V', '1K': '80V', '2A': '100V', '2E': '250V', '2W': '450V', '2J': '630V', '3A': '1000V', 'MF': '250VAC' } tolerance = { 'B': Tolerance('-0.1pF', '+0.1pF'), 'C': Tolerance('-0.25pF', '+0.25pF'), 'D': Tolerance('0.5pF'), 'F': Tolerance('1%'), 'G': Tolerance('2%'), 'J': Tolerance('5%'), 'K': Tolerance('10%'), 'M': Tolerance('20%'), 'R': 'Depends on individual standards.', 'W': Tolerance('-0.05pF', '+0.05pF') } package = { 'L': 'ø180mm Embossed Taping', 'D': 'ø180mm Paper Taping', 'W': 'ø180mm Paper Taping',
'SV': '5mmL, General purpose', 'ST': '5mmL, Wide temperature range', 'NT': '5mmL, Bi-polar', 'SS': '7mmL, General purpose', 'SH': '7mmL, Wide temperature range', 'SL': '7mmL, Low impedance', 'SA': '5&7mmL, Low impedance, Long life', 'NS': '7mmL, Bi-pola', 'SK': 'General purpose', 'TK': 'Wide temperature range', 'NK': 'Bi-polar', 'LK': 'Low leakage current' } tolerance = { 'A': Tolerance('-8%', '+32%'), 'B': Tolerance('-5%', '+10%'), 'C': Tolerance('+10%', '+30%'), 'D': Tolerance('-40%', '0%'), 'E': Tolerance('-12%', '+20%'), 'F': Tolerance('-5%', '+20%'), 'G': Tolerance('-30%', '0%'), 'H': Tolerance('-5%', '+15%'), 'I': Tolerance('-20%', '0%'), 'J': Tolerance('5%'), 'K': Tolerance('10%'), 'L': Tolerance('15%'), 'M': Tolerance('20%'), 'N': Tolerance('30%'), 'O': Tolerance('20%', '+10%'), 'P': Tolerance('0%', '+30%'),