def test_aishi(self): part = capacitors_partname_decoder.resolve("EWH1EM221F11OT") self.assertIsNotNone(part) component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Aishi", partnumber="EWH1EM221F11OT", working_temperature_range=TemperatureRange('-40', '105'), series="WH", capacitance="220uF", voltage="25V", tolerance={'min': "-20%", 'max': '+20%'}, dielectric_type="Aluminium oxide", case="8x11", note="Miniature aluminium electrolytic capacitors") self.assertEqual(component, part) part = capacitors_partname_decoder.resolve("EWH1KM2R2D11OT") self.assertIsNotNone(part) component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Aishi", partnumber="EWH1KM2R2D11OT", working_temperature_range=TemperatureRange('-40', '105'), series="WH", capacitance="2.2uF", voltage="100V", tolerance={'min': "-20%", 'max': '+20%'}, dielectric_type="Aluminium oxide", case="5x11", note="Miniature aluminium electrolytic capacitors") self.assertEqual(component, part)
def test_yaego(self): # ---------------- CC ----------------- with self.subTest("CC0402JRNPO9BN330"): part = capacitors_partname_decoder.resolve("CC0402JRNPO9BN330") self.assertIsNotNone(part) component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Yageo", partnumber="CC0402JRNPO9BN330", working_temperature_range=TemperatureRange('-55', '125'), series="CC", capacitance="33pF", voltage="50V", tolerance={'min': "-5%", 'max': '+5%'}, dielectric_type="NP0", case="0402", note="Paper/PE taping reel; Reel 7 inch") self.assertEqual(component, part) with self.subTest("CC1206MKX7RDBB102"): part = capacitors_partname_decoder.resolve("CC1206MKX7RDBB102") self.assertIsNotNone(part) component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Yageo", partnumber="CC1206MKX7RDBB102", working_temperature_range=TemperatureRange('-55', '125'), series="CC", capacitance="1nF", voltage="2000V", tolerance={'min': "-20%", 'max': '+20%'}, dielectric_type="X7R", case="1206", note="Blister taping reel; Reel 7 inch") self.assertEqual(component, part)
def test_samwha(self): part = capacitors_partname_decoder.resolve("CA1E337M10010VR") component = Capacitor(capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="Samwha", partnumber="CA1E337M10010VR", working_temperature_range=TemperatureRange('-55', '105'), series="CA", capacitance="330uF", voltage="25V", tolerance={'min': "-20%", 'max': '+20%'}, dielectric_type="Aluminium oxide", case="10mm", note="Chip type, Long Life Series") self.assertEqual(component, part) part = capacitors_partname_decoder.resolve("SD1J475M05011BB") component = Capacitor(capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="Samwha", partnumber="SD1J475M05011BB", working_temperature_range=TemperatureRange('-40', '85'), series="SD", capacitance="4.7uF", voltage="63V", tolerance={'min': "-20%", 'max': '+20%'}, dielectric_type="Aluminium oxide", case="5mm", note="Standard, For General Purposes Series") self.assertEqual(component, part)
def test_taiyo_yuden(self): part = capacitors_partname_decoder.resolve("EMK212B7475KG-T") component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Taiyo Yuden", partnumber="EMK212B7475KG-T", working_temperature_range=TemperatureRange('-55', '125'), series="M", capacitance="4.7uF", voltage="16V", tolerance={'min': "-10%", 'max': '+10%'}, dielectric_type="X7R", case="0805", note="Multilayer ceramic capacitor") self.assertEqual(component, part) part = capacitors_partname_decoder.resolve("HMK325B7225KM-T") component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Taiyo Yuden", partnumber="HMK325B7225KM-T", working_temperature_range=TemperatureRange('-55', '125'), series="M", capacitance="2.2uF", voltage="100V", tolerance={'min': "-10%", 'max': '+10%'}, dielectric_type="X7R", case="1210", note="Multilayer ceramic capacitor") self.assertEqual(component, part)
def capacitor_from_partkeepr_json(capacitor_json): try: parameters = capacitor_json["parameters"] if len(capacitor_json["manufacturers"]) > 0: part_number = capacitor_json["manufacturers"][0]['partNumber'] manufacturer_name = capacitor_json["manufacturers"][0]['name'] else: part_number = capacitor_json['name'] manufacturer_name = None capacitor_type = Capacitor.Type(parameters["Capacitor Type"]['value']) capacitance = capacitance_from_partkeepr_parameters(parameters) working_temperature = working_temperature_range_from_partkeepr_json(parameters) if 'Voltage' in parameters: if parameters['Voltage']['valueMax'] is not None: voltage = parameters['Voltage']['valueMax'] + "V" else: voltage = parameters["Voltage"]['value'] + 'V' else: voltage = None return Capacitor(capacitor_type=capacitor_type, manufacturer=manufacturer_name, partnumber=part_number, working_temperature_range=working_temperature, series=None, capacitance=capacitance, voltage=voltage, tolerance=capacitanceTolerance_from_partkeepr_json(parameters['Tolerance']) if 'Tolerance' in parameters else None, dielectric_type=parameters['Dielectric Type']['value'] if 'Dielectric Type' in parameters else None, case=capacitor_json['footprint'] if len(capacitor_json['footprint']) > 0 else None, note="") except TypeError: print(capacitor_json) raise
def test_JRG(self): part = capacitors_partname_decoder.resolve('JRG0J331M02500630115000B') component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="JB Capacitors Company", partnumber="JRG0J331M02500630115000B", working_temperature_range=TemperatureRange('-40', '105'), series="JRG", capacitance="330uF", voltage="6.3V", tolerance={'min': "-20%", 'max': '+20%'}, dielectric_type="Aluminium oxide", case='6.3x11.5mm', note="Radial Aluminum Electrolytic Capacitor, Pitch=2.5, Lead length=Standard, Packing: Bulk") self.assertEqual(component, part)
def test_samsung_CL(self): part = capacitors_partname_decoder.resolve('CL05B222KB5NNNC') component = Capacitor(capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="Samsung", partnumber="CL05B222KB5NNNC", working_temperature_range=TemperatureRange('-55', '125'), series="CL", capacitance="2.2nF", voltage="50V", tolerance={'min': "-10%", 'max': '+10%'}, dielectric_type="X7R", case="0402", note="Normal") self.assertEqual(component, part)
def test_nichicon(self): part = capacitors_partname_decoder.resolve("UKA1H220MDD") component = Capacitor(capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="Nichicon", partnumber="UKA1H220MDD", working_temperature_range=TemperatureRange('-55', '105'), series="KA", capacitance="22uF", voltage="50V", tolerance={'min': "-20%", 'max': '+20%'}, dielectric_type="Aluminium oxide", case="5", note="For High Grade Audio Equipment, Wide Temperature Range") self.assertEqual(component, part)
def test_avx(self): part = capacitors_partname_decoder.resolve("04023C104KAT2A") component = Capacitor(capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="AVX", partnumber="04023C104KAT2A", working_temperature_range=TemperatureRange('-55', '125'), series="", capacitance="100nF", voltage="25V", tolerance={'min': "-10%", 'max': '+10%'}, dielectric_type="X7R", case="0402", note="Standard product") self.assertEqual(component, part)
def test_vishay_VJ(self): part = capacitors_partname_decoder.resolve('VJ0603D820JXCAJ') component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Vishay", partnumber="VJ0603D820JXCAJ", working_temperature_range=TemperatureRange('-55', '125'), series="VJ", capacitance="82pF", voltage="200V", tolerance={'min': "-5%", 'max': '+5%'}, dielectric_type="C0G", case="0603", note="Ni barrier100 % tin platematte finish") self.assertEqual(component, part)
def test_GCM(self): part = capacitors_partname_decoder.resolve('GCM155R71C104KA55D') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="GCM155R71C104KA55D", working_temperature_range=TemperatureRange('-55', '125'), series="GCM", capacitance="100nF", voltage="16V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X7R", case="0402", note="Chip Multilayer Ceramic Capacitors for Automotive") self.assertEqual(component, part) part = capacitors_partname_decoder.resolve('GCM21BR71E105KA56L') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="GCM21BR71E105KA56L", working_temperature_range=TemperatureRange('-55', '125'), series="GCM", capacitance="1uF", voltage="25V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X7R", case="0805", note="Chip Multilayer Ceramic Capacitors for Automotive") self.assertEqual(component, part)
def decode_match(match): return Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Vishay", partnumber=match.group(1) + match.group(2) + match.group(3) + match.group(4) + match.group(5) + match.group(6) + match.group(7) + match.group(8) + match.group(9), working_temperature_range=TemperatureRange('-55', '125'), series='VJ', capacitance=capacitance_string_to_farads(match.group(4)), voltage=voltage[match.group(7)], tolerance=tolerance[match.group(5)], dielectric_type=dielectric_type[match.group(3)], case=size[match.group(2)], note=termination[match.group(6)])
def decode_match(match): partnumber = match.group(1)+match.group(2)+match.group(3)+match.group(4)+match.group(5)+match.group(6)+\ match.group(7) + match.group(8) voltage_str = voltage[match.group(3)] return Capacitor(capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="Aishi", partnumber=partnumber, working_temperature_range=operating_temperature_range[match.group(2)](Decimal(voltage_str[:-1])), series=match.group(2), capacitance=capacitance_string_to_farads(match.group(5)) * Decimal('1000000'), voltage=voltage_str, tolerance=tolerance[match.group(4)], dielectric_type="Aluminium oxide", case=size_code[match.group(6)], note=series[match.group(2)])
def decode_match(match): return Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Samsung", partnumber=match.group(1) + match.group(2) + match.group(3) + match.group(4) + match.group(5) + match.group(6) + match.group(7) + match.group(8) + match.group(9) + match.group(10) + match.group(11), working_temperature_range=operating_temperature_range[match.group(3)], series="CL", capacitance=capacitance_string_to_farads(match.group(4)), voltage=voltage[match.group(6)], tolerance=tolerance[match.group(5)], dielectric_type=dielectric_type[match.group(3)], case=size[match.group(2)], note=samsung_control_code[match.group(8)])
def test_kemet(self): with self.subTest("C0603C393K5RAC"): part = capacitors_partname_decoder.resolve("C0603C393K5RAC") self.assertIsNotNone(part) component = Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Kemet", partnumber="C0603C393K5RAC", working_temperature_range=TemperatureRange('-55', '125'), series="C", capacitance="39nF", voltage="50V", tolerance={'min': "-10%", 'max': '+10%'}, dielectric_type="X7R", case="0603", note="Standard") self.assertEqual(component, part)
def decode_match(match): partname = match.group(1) + match.group(2) + match.group(3) + match.group(4) + match.group( 5) + match.group(6) + match.group(7) dielectric = dielectric_type[match.group(2)] note = "Termination: " + termination[match.group(6)] + ", Packing: " + package_style[match.group(7)] return Capacitor(capacitor_type=Capacitor.Type.MLCC, manufacturer="Fenghua Advanced Technology", partnumber=partname, working_temperature_range=operating_temperature_range[dielectric], series=None, capacitance=capacitance_string_to_farads(match.group(3)), voltage=decode_voltage(match.group(5)), tolerance=tolerance[match.group(4)], dielectric_type=dielectric, case=size[match.group(1)], note=note)
def decode_match(match): partname = match.group(1) + match.group(2) + match.group(3) + match.group( 4) + match.group(5) + match.group(6) + match.group(7) partname += match.group(8) if match.group(8) is not None else "" return Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Yageo", partnumber=partname, working_temperature_range=operating_temperature_range[match.group(5)], series='CC', capacitance=capacitance_string_to_farads(match.group(8)), voltage=voltage[match.group(6)], tolerance=tolerance[match.group(3)], dielectric_type=dielectric_type[match.group(5)], case=size[match.group(2)], note=packing_style[match.group(4)])
def decode_match(match, series_code, height): partnumber = match.group(1) + match.group(2) + match.group( 3) + match.group(4) + match.group(5) + match.group(6) + match.group( 7) + match.group(8) + match.group(9) partnumber += match.group(10) if match.group(10) is not None else "" return Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber=partnumber, working_temperature_range=operating_temperature_range[match.group(5)], series=match.group(1) + match.group(2), capacitance=capacitance_string_to_farads(match.group(7)), voltage=voltage[match.group(6)], tolerance=tolerance[match.group(8)], dielectric_type=dielectric_type[match.group(5)], case=dimension[match.group(3)], note=series_code[match.group(2)])
def decode_match_TZ(match): partnumber = match.group(1) + match.group(2) + match.group( 3) + match.group(4) + match.group(5) + match.group(6) + match.group(7) series = match.group(2) capacitance_max = capacitance_string_to_farads(match.group(4)) return Capacitor( capacitor_type=Capacitor.Type.CeramicTrimmer, manufacturer="Murata Manufacturing", partnumber=partnumber, working_temperature_range=operating_temperature_range_TZ[series], series=match.group(1) + series, capacitance=get_capacitance_range(series, capacitance_max), voltage=voltage_TZ[series](capacitance_max), tolerance=tolerance_TZ[series](capacitance_max), dielectric_type=None, case=None, note=series_TZ[match.group(2)])
def decode_match(match): voltage_str = voltage[match.group(2)] partname = match.group(1) + match.group(2) + match.group(3) + match.group( 4) + match.group(5) + match.group(6) + match.group(7) partname += match.group(8) if match.group(8) is not None else "" return Capacitor( capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="Samwha", partnumber=partname, working_temperature_range=operating_temperature_range[match.group(1)]( Decimal(voltage_str[:-1])), series=match.group(1), capacitance=capacitance_string_to_farads(match.group(3)), voltage=voltage_str, tolerance=tolerance[match.group(4)], dielectric_type="Aluminium oxide", case=case_diameter[match.group(5)], note=series[match.group(1)])
def test_GCD(self): part = capacitors_partname_decoder.resolve('GCD188R71H153KA01') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="GCD188R71H153KA01", working_temperature_range=TemperatureRange('-55', '125'), series="GCD", capacitance="15nF", voltage="50V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X7R", case="0603", note="MLSC Design Chip Multilayer Ceramic Capacitors for Automotive" ) self.assertEqual(component, part)
def test_0805(self): part = capacitors_partname_decoder.resolve('0805B472K500NT') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Fenghua Advanced Technology", partnumber="0805B472K500NT", working_temperature_range=TemperatureRange('-55', '125'), series=None, capacitance="4.7nF", voltage="50V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X7R", case="0805", note= "Termination: Nickel Barrier Termination, Packing: Taping Package") self.assertEqual(component, part)
def test_KCM(self): part = capacitors_partname_decoder.resolve('KCM55LR71H106KH01') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="KCM55LR71H106KH01", working_temperature_range=TemperatureRange('-55', '125'), series="KCM", capacitance="10uF", voltage="50V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X7R", case="2220", note= "Metal Terminal Type Multilayer Ceramic Capacitors for Automotive") self.assertEqual(component, part)
def decode_match(match): partnumber = match.group(1) + match.group(2) + match.group( 3) + match.group(4) + match.group(5) + match.group(6) partnumber += match.group(7) if match.group(7) is not None else '' voltage_str = voltage[match.group(3)] return Capacitor( capacitor_type=Capacitor.Type.ElectrolyticAluminium, manufacturer="Nichicon", partnumber=partnumber, working_temperature_range=operating_temperature_range[match.group(2)]( Decimal(voltage_str[:-1])), series=match.group(2), capacitance=capacitance_string_to_farads(match.group(4)) * Decimal('1000000'), voltage=voltage_str, tolerance=tolerance[match.group(5)], dielectric_type="Aluminium oxide", case=configuration[match.group(6)], note=series[match.group(2)])
def test_GCG(self): part = capacitors_partname_decoder.resolve('GCG1555G1H121JA01') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="GCG1555G1H121JA01", working_temperature_range=TemperatureRange('-55', '150'), series="GCG", capacitance="120pF", voltage="50V", tolerance={ 'min': "-5%", 'max': '+5%' }, dielectric_type="X8G", case="0402", note= "AgPd Termination Conductive Glue Mounting Chip Multilayer Ceramic Capacitors for Automotive" ) self.assertEqual(component, part)
def test_KC3(self): part = capacitors_partname_decoder.resolve('KC355LD72J154KH01') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="KC355LD72J154KH01", working_temperature_range=TemperatureRange('-55', '125'), series="KC3", capacitance="150nF", voltage="630V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X7T", case="2220", note= "High Effective Capacitance & High Allowable Ripple Current Metal Terminal Type Multilayer Ceramic Capacitors for Automotive" ) self.assertEqual(component, part)
def test_KCA(self): part = capacitors_partname_decoder.resolve('KCA55L7UMF102KH01') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="KCA55L7UMF102KH01", working_temperature_range=TemperatureRange('-55', '125'), series="KCA", capacitance="1nF", voltage="250VAC", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="U2J", case="2220", note= "Safety Standard Certified Metal Terminal Type Multilayer Ceramic Capacitors for Automotive" ) self.assertEqual(component, part)
def test_TZ(self): with self.subTest("TZB"): part = capacitors_partname_decoder.resolve('TZB4P400AB10R00') self.assertIsNotNone(part) component = Capacitor( capacitor_type=Capacitor.Type.CeramicTrimmer, manufacturer="Murata Manufacturing", partnumber="TZB4P400AB10R00", working_temperature_range=TemperatureRange('-25', '85'), series="TZB4", capacitance=CapacitanceRange("8.5pF", "40pF"), voltage="100V", tolerance={ 'min': "-0%", 'max': '+50%' }, dielectric_type=None, case=None, note="4mm Size SMD Type") self.assertEqual(component, part)
def test_GC3(self): part = capacitors_partname_decoder.resolve('GC331AD72W153KX01') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="GC331AD72W153KX01", working_temperature_range=TemperatureRange('-55', '125'), series="GC3", capacitance="15nF", voltage="450V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X7T", case="1206", note= "High Effective Capacitance & High Ripple Current Chip Multilayer Ceramic Capacitors for Automotive" ) self.assertEqual(component, part)
def test_GCJ(self): part = capacitors_partname_decoder.resolve('GCJ188R92A152KA01') component = Capacitor( capacitor_type=Capacitor.Type.MLCC, manufacturer="Murata Manufacturing", partnumber="GCJ188R92A152KA01", working_temperature_range=TemperatureRange('-55', '150'), series="GCJ", capacitance="1.5nF", voltage="100V", tolerance={ 'min': "-10%", 'max': '+10%' }, dielectric_type="X8R", case="0603", note= "Soft Termination Chip Multilayer Ceramic Capacitors for Automotive" ) self.assertEqual(component, part)