Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help with zip files, thanks ! Introduction Below is a sort of partial class diagram for our PV project. We'll attempt to write some basic
Help with zip files, thanks !
Introduction Below is a sort of partial class diagram for our PV project. We'll attempt to write some basic 00 Python programming logics that will be expanded down the road to connect all the parts. For now, our goal is just to get our feet wet... Manufacturer name:String registered_country:Stri ng contact_person: User + add the relevant setters and getters methods TestResults dataSource: TestLab product: Product reporting Condition:String testSquence:String testDate:date isc:float voc: float imp: float vmp;float pmp float ff:float noct:float + add the relevant methods User username:String password: String first name:String middle name:String last name:String address: String officePhone:String cellphone:String email:String + add the relevant methods TestLab name:String address: String contact_person: User + add the relevant methods Product model Number:String - manufacturer: Manufacturer manufacturingDate: date length:float width:float weight: float cell area: float cell technology: String total number of cells: int number of cells in series: int number of series strings: int number of bypass diodes: int series fuse rating: float interconnect material: String interconnect supplier: String superstrate type: string superstrate manufacturer: string substrate type: string substrate manufacturer: string frame material: string frame adhesive: string encapsulant type: string encapsulant manufacturer: string junction box type: string junction box manufacturer: string junction box adhesive: string cable type: string connector type: string maximum system voltage: float rated voc: float rated isc: float rated vmp: float rated imp: float - rated pmp: float - rated ff: float + add the relevant methods Problem Definitions In this PD, we're simply adding data validation (using regex) and database access to our PD3 work. We're using the same class diagram from PD3. A. Ensure that you have the module MySQLdb installed by typing on the interactive interpreter: >>> import MySQLdb If no error ensues, then you're fine. Otherwise, install the adapter. Instruction for LAMP installation with Cygwin is provided for Windows users. Mac users should simply use the Terminal. B. Create the database and all the relevant tables, including all the integrity constraints C. Update your class implementations in My Classes.py.. D. Modify your pd3.py and save as pd4.py for the modified tasks below (modifications in red): 1) We'll assume that test labs will upload the test results in csv files. So we need a function that takes as argument a csv file, reads and returns the contents of those files. A sample CSV test results file for use in this PD is attached. 2) When taking data from the user, some validations (such as valid email address, valid phone number, etc.) must be performed. Write a function that take a string and return "email" if it is a valid email address, "phone" if it is a valid phone number, "number" if it is a valid numeric data, and "date" if it is a valid date. You're to decide which date format and phone number your function will be validating. 3) To add or register a new PV module, a manufacturer must fill out and submit a module detailed specifications (MDS) form. A sample to use in this PD is attached. Write a function that prompts the user to enter data from the MDS then returns the dictionary of these data. Note: Use the same specifications for all the modules in the test results. Only the model numbers are different. 4) Each user must register with the portal. A user could be a Manufacturer, a Testing Lab, or any interested party. Write a function that takes a user registration and returns a dictionary of data. To register, a user provides the following information: username & password to log in next time first name middle name (optional) last name company name company type (test lab or manufacturer) address office phone number cell phone number email address 5) Main function a. Get the MDS data and instantiate: A product (i.e. a new PV module) with the relevant data. Note that it would require you to instantiate a manufacturer; which in turn will also require you to instantiate a contact person. Insert the data into the relevant tables in the database b. Get the test results data file . Read in the content and store into the relevant tables in the database Retrieve data from the database and display the information below in a tabular format: Manufacturer Contact name Contact Email Cell Technology Rated Power Baseline TC200 Damp Heat HF10 Average Isc Average Voc Average Pmax Average Pmax drop from Baseline average MODULE DETAILED SPECIFICATIONS Manufacturer Zhuhai Tianbo Location China Contact Tailin Wang Address No.1 Pingbei 2nd Road, Zhuhai, China 519060 Email spv@yuemaolaser.com Phone +86-756-8911378 Model Number KUT0012 Module total length x width (cm x cm) 158x 80.8 Module weight (kg) 15 148.58 Individual cell Area (cm) 11 Area (cm2) Cell technology (mono-Si, poly-Si, a-Si, CIS, CdTe, etc.) Mono-Si Cell manufacturer and part # Motech Cell manufacturing location Taiwan Total number of cells 72 Number of cells in series Number of series strings Number of bypass diodes Bypass diode rating (A) - attach diode datasheet 10/1080050 Bypass diode max junction temperature (C) 200 Series fuse rating (A) 10 Interconnect material and supplier model no. Ulbrich Stainless Steels & Special Metals Ltd Interconnect dimensions (mm x mm) 0.2mm x1.5mm, 0.2mm x 5mm Superstrate type (eg - strengthened glass etc) Tempered Glass Superstrate manufacturer and part # Dongguan CSG Solar Glass Co., Ltd./3.2 mm TPT/0.35 mm Substrate type Substrate manufacturer and part # art # ISOVOLTA Aluminum alloy Frame type/material Frame adhesive Dow Corning 7091 Encapsulant type EVA/0.5 mm Encapsulant manufacturer and part # Bridge Stone Corporation Junction box type PV-RH0502B Junction box manufacturer and part # Cixi Renhe Photovoltaic Electrical Appliance Co., Ltd. Junction box potting material, if any NA Junction box adhesive Dow Corning 7091 Is junction box intended for use with Conduit? NA Cable & Connector type 2 pfg 1169 1x4 mm2, 05-6 Maximum system voltage (V) 1000V Voc (V) 44.2 Isc (A) 5.25 Vmp (V) 35.2 Imp (A) 4.97 Pmp (W) 175 FF (%) test results with NOCT STC STC STC Model Test Sequence Condition Date Isc Voc Imp Vmp FF Pmp NOCT KUTO012 Baseline STC 3/11/2008 5.2 44.7 4.88 35.7 75 174.3 51.9 KUTO003 Baseline 3/11/2008 5.34 44.7 35.7 75.2 179.7 52.1 KUT0003 TC200 STC 5/7/2008 5.2 45.1 36.4 75.2 176.2 - KUT0004 Baseline STC 3/11/2008 5.21 44.8 4.91 36.1 76 177.2 51.8 KUT0004 TC200 STC 5/7/2008 5.17 45.1 4.81 36.5 75.3 175.6 - KUTO004 Hotspot STC 6/25/2008 5.09 45.6 4.7 37 74.9 173.7 - KUT0001 Baseline STC 3/11/2008 5.32 44.6 4.95 35.4 73.8 175.2 51.8 KUT0001 TC200 STC 5/7/2008 5.2 45 4.77 36.8 75.1 175.6 KUTO006 Baseline STC 3/11/2008 5.35 44.4 4.95 35.8 74.5 177.2 52 KUT0006 UV 6/5/2008 5.28 44.6 4.84 35.8 73.7 173.7 KUTO006 TC50 STC 7/4/2008 5.22 45 4.72 36.9 74.1 173.9 - KUTO006 HF10 8/1/2008 5.21 45.1 4.69 37 73.9 173.4 KUT0006 Termination STC 8/19/2008 5.23 45 37.3 73.2 172.5 KUTO007 Baseline STC 3/11/2008 5.25 44.4 35.8 74.6 174.2 52.1 KUTO007 UV STC 6/5/2008 5.39 43.9 4.84 35.5 72.5 171.7 KUTO007 TC50 STC 7/4/2008 5.56 44.7 4.87 36.8 72.2 179.3 KUTO007 HF10 STC 8/1/2008 5.5 44.6 4.85 36.4 72.2 176.8 KUTO005 Baseline STC 3/11/2008 5.13 44.3 4.84 35.6 75.7 172.3 51.7 KUT0005 Damp Heat STC 5/8/2008 5.11 45.5 4.7 37.4 75.4 175.6 KUTO005 Static Load STC 5/29/2008 4.95 45.6 4.67 37.6 77.6 175.5 - KUT0008 Baseline STC 3/11/2008 5.13 44.6 4.84 36 76.2 174.4 52.2 KUTO008 Damp Heat STC 5/8/2008 5.17 44.9 4.78 36.2 74.4 172.7 KUTO008 Hail STC 5/21/2008 5.14 44.5 4.73 35.8 74 169.4 - KUTO011 Baseline STC 3/11/2008 5.24 44.7 4.99 35.8 76.1 178.4 51.9 KUTO011 Outdoor Exposure STC 4/17/2008 5.05 44.3 4.79 35.6 76.4 170.7 - Introduction Below is a sort of partial class diagram for our PV project. We'll attempt to write some basic 00 Python programming logics that will be expanded down the road to connect all the parts. For now, our goal is just to get our feet wet... Manufacturer name:String registered_country:Stri ng contact_person: User + add the relevant setters and getters methods TestResults dataSource: TestLab product: Product reporting Condition:String testSquence:String testDate:date isc:float voc: float imp: float vmp;float pmp float ff:float noct:float + add the relevant methods User username:String password: String first name:String middle name:String last name:String address: String officePhone:String cellphone:String email:String + add the relevant methods TestLab name:String address: String contact_person: User + add the relevant methods Product model Number:String - manufacturer: Manufacturer manufacturingDate: date length:float width:float weight: float cell area: float cell technology: String total number of cells: int number of cells in series: int number of series strings: int number of bypass diodes: int series fuse rating: float interconnect material: String interconnect supplier: String superstrate type: string superstrate manufacturer: string substrate type: string substrate manufacturer: string frame material: string frame adhesive: string encapsulant type: string encapsulant manufacturer: string junction box type: string junction box manufacturer: string junction box adhesive: string cable type: string connector type: string maximum system voltage: float rated voc: float rated isc: float rated vmp: float rated imp: float - rated pmp: float - rated ff: float + add the relevant methods Problem Definitions In this PD, we're simply adding data validation (using regex) and database access to our PD3 work. We're using the same class diagram from PD3. A. Ensure that you have the module MySQLdb installed by typing on the interactive interpreter: >>> import MySQLdb If no error ensues, then you're fine. Otherwise, install the adapter. Instruction for LAMP installation with Cygwin is provided for Windows users. Mac users should simply use the Terminal. B. Create the database and all the relevant tables, including all the integrity constraints C. Update your class implementations in My Classes.py.. D. Modify your pd3.py and save as pd4.py for the modified tasks below (modifications in red): 1) We'll assume that test labs will upload the test results in csv files. So we need a function that takes as argument a csv file, reads and returns the contents of those files. A sample CSV test results file for use in this PD is attached. 2) When taking data from the user, some validations (such as valid email address, valid phone number, etc.) must be performed. Write a function that take a string and return "email" if it is a valid email address, "phone" if it is a valid phone number, "number" if it is a valid numeric data, and "date" if it is a valid date. You're to decide which date format and phone number your function will be validating. 3) To add or register a new PV module, a manufacturer must fill out and submit a module detailed specifications (MDS) form. A sample to use in this PD is attached. Write a function that prompts the user to enter data from the MDS then returns the dictionary of these data. Note: Use the same specifications for all the modules in the test results. Only the model numbers are different. 4) Each user must register with the portal. A user could be a Manufacturer, a Testing Lab, or any interested party. Write a function that takes a user registration and returns a dictionary of data. To register, a user provides the following information: username & password to log in next time first name middle name (optional) last name company name company type (test lab or manufacturer) address office phone number cell phone number email address 5) Main function a. Get the MDS data and instantiate: A product (i.e. a new PV module) with the relevant data. Note that it would require you to instantiate a manufacturer; which in turn will also require you to instantiate a contact person. Insert the data into the relevant tables in the database b. Get the test results data file . Read in the content and store into the relevant tables in the database Retrieve data from the database and display the information below in a tabular format: Manufacturer Contact name Contact Email Cell Technology Rated Power Baseline TC200 Damp Heat HF10 Average Isc Average Voc Average Pmax Average Pmax drop from Baseline average MODULE DETAILED SPECIFICATIONS Manufacturer Zhuhai Tianbo Location China Contact Tailin Wang Address No.1 Pingbei 2nd Road, Zhuhai, China 519060 Email spv@yuemaolaser.com Phone +86-756-8911378 Model Number KUT0012 Module total length x width (cm x cm) 158x 80.8 Module weight (kg) 15 148.58 Individual cell Area (cm) 11 Area (cm2) Cell technology (mono-Si, poly-Si, a-Si, CIS, CdTe, etc.) Mono-Si Cell manufacturer and part # Motech Cell manufacturing location Taiwan Total number of cells 72 Number of cells in series Number of series strings Number of bypass diodes Bypass diode rating (A) - attach diode datasheet 10/1080050 Bypass diode max junction temperature (C) 200 Series fuse rating (A) 10 Interconnect material and supplier model no. Ulbrich Stainless Steels & Special Metals Ltd Interconnect dimensions (mm x mm) 0.2mm x1.5mm, 0.2mm x 5mm Superstrate type (eg - strengthened glass etc) Tempered Glass Superstrate manufacturer and part # Dongguan CSG Solar Glass Co., Ltd./3.2 mm TPT/0.35 mm Substrate type Substrate manufacturer and part # art # ISOVOLTA Aluminum alloy Frame type/material Frame adhesive Dow Corning 7091 Encapsulant type EVA/0.5 mm Encapsulant manufacturer and part # Bridge Stone Corporation Junction box type PV-RH0502B Junction box manufacturer and part # Cixi Renhe Photovoltaic Electrical Appliance Co., Ltd. Junction box potting material, if any NA Junction box adhesive Dow Corning 7091 Is junction box intended for use with Conduit? NA Cable & Connector type 2 pfg 1169 1x4 mm2, 05-6 Maximum system voltage (V) 1000V Voc (V) 44.2 Isc (A) 5.25 Vmp (V) 35.2 Imp (A) 4.97 Pmp (W) 175 FF (%) test results with NOCT STC STC STC Model Test Sequence Condition Date Isc Voc Imp Vmp FF Pmp NOCT KUTO012 Baseline STC 3/11/2008 5.2 44.7 4.88 35.7 75 174.3 51.9 KUTO003 Baseline 3/11/2008 5.34 44.7 35.7 75.2 179.7 52.1 KUT0003 TC200 STC 5/7/2008 5.2 45.1 36.4 75.2 176.2 - KUT0004 Baseline STC 3/11/2008 5.21 44.8 4.91 36.1 76 177.2 51.8 KUT0004 TC200 STC 5/7/2008 5.17 45.1 4.81 36.5 75.3 175.6 - KUTO004 Hotspot STC 6/25/2008 5.09 45.6 4.7 37 74.9 173.7 - KUT0001 Baseline STC 3/11/2008 5.32 44.6 4.95 35.4 73.8 175.2 51.8 KUT0001 TC200 STC 5/7/2008 5.2 45 4.77 36.8 75.1 175.6 KUTO006 Baseline STC 3/11/2008 5.35 44.4 4.95 35.8 74.5 177.2 52 KUT0006 UV 6/5/2008 5.28 44.6 4.84 35.8 73.7 173.7 KUTO006 TC50 STC 7/4/2008 5.22 45 4.72 36.9 74.1 173.9 - KUTO006 HF10 8/1/2008 5.21 45.1 4.69 37 73.9 173.4 KUT0006 Termination STC 8/19/2008 5.23 45 37.3 73.2 172.5 KUTO007 Baseline STC 3/11/2008 5.25 44.4 35.8 74.6 174.2 52.1 KUTO007 UV STC 6/5/2008 5.39 43.9 4.84 35.5 72.5 171.7 KUTO007 TC50 STC 7/4/2008 5.56 44.7 4.87 36.8 72.2 179.3 KUTO007 HF10 STC 8/1/2008 5.5 44.6 4.85 36.4 72.2 176.8 KUTO005 Baseline STC 3/11/2008 5.13 44.3 4.84 35.6 75.7 172.3 51.7 KUT0005 Damp Heat STC 5/8/2008 5.11 45.5 4.7 37.4 75.4 175.6 KUTO005 Static Load STC 5/29/2008 4.95 45.6 4.67 37.6 77.6 175.5 - KUT0008 Baseline STC 3/11/2008 5.13 44.6 4.84 36 76.2 174.4 52.2 KUTO008 Damp Heat STC 5/8/2008 5.17 44.9 4.78 36.2 74.4 172.7 KUTO008 Hail STC 5/21/2008 5.14 44.5 4.73 35.8 74 169.4 - KUTO011 Baseline STC 3/11/2008 5.24 44.7 4.99 35.8 76.1 178.4 51.9 KUTO011 Outdoor Exposure STC 4/17/2008 5.05 44.3 4.79 35.6 76.4 170.7Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started