def test_royal_ohm(self): decoded = resistors_partname_decoder.resolve("1206S4J0100T5E") self.assertEqual(Resistor.Type.ThickFilmResistor, decoded.type) self.assertEqual('Royal Ohm', decoded.manufacturer) self.assertEqual('1206S4J0100T5E', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('', decoded.series) self.assertEqual(Resistance('10'), decoded.resistance) self.assertEqual(Tolerance('5%'), decoded.tolerance) self.assertEqual(Power('0.25'), decoded.power) self.assertEqual('200V', decoded.max_working_voltage) self.assertEqual('1206', decoded.case) self.assertEqual('Lead (Pb) Free Plating Type/ RoHS compliant', decoded.note) decoded = resistors_partname_decoder.resolve("4D02WGJ0240T") self.assertEqual(Resistor.Type.ThickFilmResistorArray, decoded.type) self.assertEqual('Royal Ohm', decoded.manufacturer) self.assertEqual('4D02WGJ0240T', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('', decoded.series) self.assertEqual(Resistance('24'), decoded.resistance) self.assertEqual(Tolerance('5%'), decoded.tolerance) self.assertEqual(Power('0.0625'), decoded.power) self.assertEqual('50V', decoded.max_working_voltage) self.assertEqual('4D02', decoded.case) self.assertEqual('', decoded.note)
def test_bourns(self): with self.subTest("CAT16-220J4LF"): decoded = resistors_partname_decoder.resolve("CAT16-220J4LF") self.assertEqual(Resistor.Type.ThickFilmResistorArray, decoded.type) self.assertEqual('Bourns', decoded.manufacturer) self.assertEqual('CAT16-220J4LF', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('125')), decoded.working_temperature_range) self.assertEqual('CAT16', decoded.series) self.assertEqual(Resistance('22'), decoded.resistance) self.assertEqual(Tolerance('5%'), decoded.tolerance) self.assertEqual(Power('0.25'), decoded.power) self.assertEqual('50V', decoded.max_working_voltage) self.assertEqual('1206', decoded.case) self.assertEqual('Concave Terminations', decoded.note) with self.subTest("CHV0603-FX-2203ELF"): decoded = resistors_partname_decoder.resolve("CHV0603-FX-2203ELF") self.assertEqual(Resistor.Type.ThickFilmResistor, decoded.type) self.assertEqual('Bourns', decoded.manufacturer) self.assertEqual('CHV0603-FX-2203ELF', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('CHV', decoded.series) self.assertEqual(Resistance('220k'), decoded.resistance) self.assertEqual(Tolerance('1%'), decoded.tolerance) self.assertEqual(Power('0.1'), decoded.power) self.assertEqual('200V', decoded.max_working_voltage) self.assertEqual('0603', decoded.case) self.assertEqual('Thick Film High Voltage Chip Resistors, TCR=100ppm/K, Tin-plated (RoHS compliant), Packing: Unknown', decoded.note) with self.subTest("CHV0603-JW-105ELF "): decoded = resistors_partname_decoder.resolve("CHV0603-JW-105ELF ") self.assertEqual(Resistor.Type.ThickFilmResistor, decoded.type) self.assertEqual('Bourns', decoded.manufacturer) self.assertEqual('CHV0603-JW-105ELF', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('CHV', decoded.series) self.assertEqual(Resistance('1M'), decoded.resistance) self.assertEqual(Tolerance('5%'), decoded.tolerance) self.assertEqual(Power('0.1'), decoded.power) self.assertEqual('200V', decoded.max_working_voltage) self.assertEqual('0603', decoded.case) self.assertEqual('Thick Film High Voltage Chip Resistors, TCR=200ppm/K, Tin-plated (RoHS compliant), Packing: Unknown', decoded.note)
def test_vishay(self): decoded = resistors_partname_decoder.resolve("CRCW0805562RFKTA") self.assertEqual(Resistor.Type.ThickFilmResistor, decoded.type) self.assertEqual('Vishay', decoded.manufacturer) self.assertEqual('CRCW0805562RFKTA', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('CRCW', decoded.series) self.assertEqual(Resistance('562'), decoded.resistance) self.assertEqual(Tolerance('1%'), decoded.tolerance) self.assertEqual(Power('0.125'), decoded.power) self.assertEqual('150V', decoded.max_working_voltage) self.assertEqual('0805', decoded.case) self.assertEqual('Lead (Pb)-Bearing Thick Film, Rectangular Chip Resistors', decoded.note)
def test_yaego(self): decoded = resistors_partname_decoder.resolve("RC0402FR-07100RL") self.assertEqual(Resistor.Type.ThickFilmResistor, decoded.type) self.assertEqual('Yageo', decoded.manufacturer) self.assertEqual('RC0402FR-07100RL', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('RC', decoded.series) self.assertEqual(Resistance('100'), decoded.resistance) self.assertEqual(Tolerance('1%'), decoded.tolerance) self.assertEqual(Power('0.0625'), decoded.power) self.assertEqual('50V', decoded.max_working_voltage) self.assertEqual('0402', decoded.case) self.assertEqual('General purpose chip resistors', decoded.note)
def test_tolerance(self): self.assertEqual("\u00B110%", str(Tolerance('10%'))) self.assertEqual("\u00B110%", str(Tolerance('-10%', '+10%'))) self.assertEqual("-10%...+20%", str(Tolerance('-10%', '+20%'))) self.assertEqual("\u00B11mΩ", str(Tolerance('1mR'))) self.assertEqual("\u00B11kΩ", str(Tolerance('-1k', '+1k'))) self.assertEqual("-1kΩ...+2kΩ", str(Tolerance('-1k', '+2k'))) with self.assertRaises(ValueError): Tolerance('-20%')
def test_thunder(self): decoded = resistors_partname_decoder.resolve("RL2512JK-7W 0R33") self.assertIsNotNone(decoded) self.assertEqual(Resistor.Type.ThickFilmResistor, decoded.type) self.assertEqual('Thunder', decoded.manufacturer) self.assertEqual('RL2512JK-7W 0R33', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('RL', decoded.series) self.assertEqual(Resistance('0.33'), decoded.resistance) self.assertEqual(Tolerance('5%'), decoded.tolerance) self.assertEqual(Power('2'), decoded.power) self.assertEqual('200V', decoded.max_working_voltage) self.assertEqual('2512', decoded.case) self.assertEqual('Thick Film Chip Resistor, TCR=1500ppm/K', decoded.note)
def test_te_connectivity(self): decoded = resistors_partname_decoder.resolve("CRGCQ1206F120R") self.assertIsNotNone(decoded) self.assertEqual(Resistor.Type.ThickFilmResistor, decoded.type) self.assertEqual('TE Connectivity', decoded.manufacturer) self.assertEqual('CRGCQ1206F120R', decoded.partnumber) self.assertEqual(TemperatureRange(Decimal('-55'), Decimal('155')), decoded.working_temperature_range) self.assertEqual('CRGCQ', decoded.series) self.assertEqual(Resistance('120'), decoded.resistance) self.assertEqual(Tolerance('1%'), decoded.tolerance) self.assertEqual(Power('0.250'), decoded.power) self.assertEqual('200V', decoded.max_working_voltage) self.assertEqual('1206', decoded.case) self.assertEqual('AEC-Q200 compliant Thick Film Chip Resistor, TCR=100ppm/K', decoded.note)
lambda resistance: "400ppm/K" if resistance <= Decimal('10') else "200ppm/K" if resistance <= Decimal('100') else "100ppm/K" } size = { '0402': '0402', '0603': '0603', '0805': '0805', '1206': '1206', '1210': '1210', '2010': '2010', '2512': '2512' } tolerance = {'F': Tolerance('1%'), 'J': Tolerance('5%')} max_working_voltage = { '0402': '50V', '0603': '75V', '0805': '150V', '1206': '200V', '1210': '200V', '2010': '200V', '2512': '200V' } power_rating = { '0402': Decimal('0.0625'), '0603': Decimal('0.1'), '0805': Decimal('0.125'),
'WG': Decimal('0.0625'), 'WA': Decimal('0.1'), 'W8': Decimal('0.125'), 'W4': Decimal('0.25'), 'W2': Decimal('0.5'), '1W': Decimal('1'), 'SA': Decimal('0.1'), 'S8': Decimal('0.125'), 'S4': Decimal('0.25'), 'S3': Decimal('0.333'), '07': Decimal('0.75'), 'U2': Decimal('0.5') } tolerance = { 'D': Tolerance('0.5%'), 'F': Tolerance('1%'), 'G': Tolerance('2%'), 'J': Tolerance('5%') } packing_type = {'T': "Tape/Reel"} packing_quantity = { '1': '1000pcs', '2': '2000pcs', '4': '4000pcs', '5': '5000pcs', 'A': '500pcs', 'C': '10000pcs', 'D': '20000pcs',
def test_equality_operator(self): self.assertEqual(Tolerance('-20%', '20%'), Tolerance('20%'))
'0603': '0603', '0805': '0805', '0508': '0508', '1206': '1206', '0612': '0612', '1210': '1210', '1812': '1812', '1218': '1218', '2010': '2010', '1020': '1020', '2512': '2512', '1225': '1225' } tolerance = { 'B': Tolerance('0.1%'), 'C': Tolerance('0.25%'), 'D': Tolerance('0.5%'), 'F': Tolerance('1%'), 'G': Tolerance('2%'), 'J': Tolerance('5%'), 'Z': Tolerance('0%') } temperature_coefficient = { 'Y': '10ppm/K', 'X': '15ppm/K', 'E': '25ppm/K', 'H': '50ppm/K', 'K': '100ppm/K', 'L': '200ppm/K',