Question: 3 1 . Implement list _ weather _ violations You have now reached the last function in the module violations and the hardest function in

31. Implement list_weather_violations
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 list_weather_violations 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.csv,minimums.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 get_weather_violation (but only if it is not the empty string). This is explained in more detail in the specification for list_weather_violations.
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 get_minimums. Even if a pilot is instrument-rated, the pilot should use the minimums corresponding to the lesson. So an instrument-rated 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-2017. If you have done it correctly, you should find 93 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!