Question: 3 1 . Implement list _ weather _ violations You have now reached the last function in the module violations and the hardest function in
Implement listweatherviolations
You have now reached the last function in the module violations and the hardest function in the required portion of the project. The project becomes easier after this point.
The function listweatherviolations analyzes a complete dataset to find weather violations. This function is simply given a directory, nothing more. The function then reads the files daycycle.json, students.csvminimums.csv weather.json, and lessons.csv to create a list of weather violations. Remember how all of the other functions assumed that these files were read somewhere else and converted to tables or dictionaries as appropriate? That happens in this function.
This function will return a table of all lessons that violate weather minimums. Each row of the table is the lesson data plus one additional column. This column will contain the results of the function getweatherviolation but only if it is not the empty string This is explained in more detail in the specification for listweatherviolations.
This function will use almost every function you have written so far. To help you organize your thoughts, here is some pseudocode to help you approach the function
For each of the lessons
Get the takeoff time
Get the pilot credentials
Get the pilot minimums
Get the weather conditions
Check for a violation and add it to the list if so
HINT: One thing that we have seen confuse students is the parameter vfr in getminimums. Even if a pilot is instrumentrated, the pilot should use the minimums corresponding to the lesson. So an instrumentrated pilot on a VFR flight is subject to VMC minimums. Whether or not a lesson is VFR is indicated by the FILED column of lessons.csv
When you have finished with the function, run the test script. The test script is the same as analyzing the dataset KITH If you have done it correctly, you should find weather violations cloud cover in Ithaca is not friendly to flying
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
