Skip to content
Snippets Groups Projects
Commit bb4ae400 authored by Ashwin Maran's avatar Ashwin Maran
Browse files

add lab-p10 and p10

parent 835ad3e8
No related branches found
No related tags found
No related merge requests found
# Lab-P10: Files and Namedtuples
In this lab, you'll get practice with files and namedtuples, in preparation for P10.
-----------------------------
## Corrections/Clarifications
**Find any issues?** Please report to us:
- Ashwin Maran <amaran@wisc.edu>
------------------------------
## Learning Objectives
In this lab, you will practice...
* loading data in json files
* loading data in csv files
* using try/except to handle malformed data
------------------------------
## Note on Academic Misconduct
You may do these lab exercises only with your project partner; you are not allowed to start
working on Lab-P10 with one person, then do the project with a different partner. Now may be a
good time to review [our course policies](https://cs220.cs.wisc.edu/f23/syllabus.html).
**Important:** P10 and P11 are two parts of the same data analysis.
You **cannot** switch project partners between these two projects.
If you partner up with someone for P10, you have to sustain that partnership until end of P11.
**You must acknowledge that you have read this to your lab TA**.
------------------------------
## Segment 1: Setup
Create a `lab-p10` directory and download the following files into the `lab-p10` directory.
* `small_data.zip`
* `lab-p10.ipynb`
* `public_tests.py`
After downloading data.zip, make sure to extract it (using [Mac directions](http://osxdaily.com/2017/11/05/how-open-zip-file-mac/) or [Windows directions](https://support.microsoft.com/en-us/help/4028088/windows-zip-and-unzip-files)). After extracting, you need to make sure that the project files are stored in the following structure:
```
+-- lab-p10.ipynb
+-- public_tests.py
+-- small_data
| +-- .DS_Store
| +-- .ipynb_checkpoints
| +-- mapping_1.json
| +-- mapping_2.json
| +-- mapping_3.json
| +-- planets_1.csv
| +-- planets_2.csv
| +-- planets_3.csv
| +-- stars_1.csv
| +-- stars_2.csv
| +-- stars_3.csv
```
Make sure that the files inside `small_data.zip` are inside the `small_data` directory. You may delete `small_data.zip` after extracting these files from it.
## Segment 2:
For the remaining segments, detailed instructions are provided in `lab-p10.ipynb`. From the terminal, open a `jupyter notebook` session, open your `lab-p10.ipynb`, and follow the instructions in `lab-p10.ipynb`.
## Project 10
You can now get started with [p10](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-f23-projects/-/tree/main/p10). **You may copy/paste any code created here in project P10**. Have fun!
This diff is collapsed.
This diff is collapsed.
File added
# Project 10 (P10): Looking at Stars and Planets
## Corrections and clarifications:
* None yet.
**Find any issues?** Report to us:
- Divyam Anshumaan <anshumaan@wisc.edu>
- Samuel Guo <sguo258@wisc.edu>
- Cathy Cao <ccao35@wisc.edu>
- John Balis <balis@wisc.edu>
- David Parra <deparra@wisc.edu>
- Muhammad Musa <mmusa2@wisc.edu>
## Instructions:
This project will focus on **file handling**, **namedtuples**, **data cleaning** and **error handling**. To start, download [`p10.ipynb`](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-f23-projects/-/tree/main/p10/p10.ipynb), [`public_tests.py`](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-f23-projects/-/tree/main/p10/public_tests.py), and [`data.zip`](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-f23-projects/-/tree/main/p10/data.zip).
After downloading `data.zip`, make sure to extract it (using [Mac directions](http://osxdaily.com/2017/11/05/how-open-zip-file-mac/) or [Windows directions](https://support.microsoft.com/en-us/help/4028088/windows-zip-and-unzip-files)). After extracting, you should see a folder called `data`, which has the following files in it:
* `.DS_Store`
* `.ipynb_checkpoints`
* `mapping_1.json`
* `mapping_2.json`
* `mapping_3.json`
* `mapping_4.json`
* `mapping_5.json`
* `stars_1.csv`
* `stars_2.csv`
* `stars_3.csv`
* `stars_4.csv`
* `stars_5.csv`
* `planets_1.csv`
* `planets_2.csv`
* `planets_3.csv`
* `planets_4.csv`
* `planets_5.csv`
You may delete `data.zip` after extracting these files from it.
You will work on `p10.ipynb` and hand it in. You should follow the provided directions for each question. Questions have **specific** directions on what **to do** and what **not to do**.
**Important warning:** Since P10 deals heavily with file handling, whether or not the test cases pass depends greatly on the operating system being used. Even if your code passes all tests locally, it may **fail on Gradescope** if it uses a different operating system. To avoid these issues, **follow the instructions** in P10 carefully, and **after submission, check to see that all your test cases pass on the Gradescope autograder**.
------------------------------
## IMPORTANT Submission instructions:
- Review the [Grading Rubric](https://git.doit.wisc.edu/cdis/cs/courses/cs220/cs220-f23-projects/-/tree/main/p10/rubric.md), to ensure that you don't lose points during code review.
- Login to [Gradescope](https://www.gradescope.com/) and upload the zip file into the P10 assignment.
- If you completed the project with a **partner**, make sure to **add their name** by clicking "Add Group Member"
in Gradescope when uploading the P10 zip file.
<img src="images/add_group_member.png" width="400">
**Warning:** You will have to add your partner on Gradescope even if you have filled out this information in your `p10.ipynb` notebook.
- It is **your responsibility** to make sure that your project clears auto-grader tests on the Gradescope test system. Otter test results should be available within forty minutes after your submission (usually within ten minutes). **Ignore** the `-/100.00` that is displayed to the right. You should be able to see both PASS / FAIL results for the 20 test cases, which is accessible via Gradescope Dashboard (as in the image below):
<img src="images/gradescope.png" width="400">
- You can view your **final score** at the **end of the page**. If you pass all tests, then you will receive **full points** for the project. Otherwise, you can see your final score in the **summary** section of the test results (as in the image below):
<img src="images/summary.png" width="400">
If you want more details on why you lost points on a particular test, you can scroll up to find more details about the test.
File added
# Images
Images from p10 are stored here.
```python
```
p10/images/add_group_member.png

157 KiB

p10/images/gradescope.png

60.5 KiB

p10/images/summary.png

20.1 KiB

This diff is collapsed.
This diff is collapsed.
# Project 10 (P10) grading rubric
## Code reviews
- The Gradescope autograder will make deductions based on the rubric provided below.
- To ensure that you don't lose any points, you must review the rubric and make sure that you have followed the instructions provided in the project correctly.
## Rubric
### General guidelines:
- Outputs not visible/did not save the notebook file prior to running the cell containing "export". We cannot see your output if you do not save before generating the zip file. (-3)
- Used concepts/modules such as `csv.DictReader` and `pandas` not covered in class yet. Note that built-in functions that you have been introduced to can be used. (-3)
- Used bare try/except blocks without explicitly specifying the type of exceptions that need to be caught (-3)
- Large outputs such as `stars_dict` or `planets_list` are displayed in the notebook. (-3)
- Import statements are not mentioned in the required cell at the top of the notebook. (-1)
### Question specific guidelines:
- q1 (3)
- answer is not sorted explicitly (-2)
- answer does not remove all files and directories that start with `.` (-1)
- q2 (3)
- recomputed variable defined in Question 1, or the answer is not sorted explicitly (-1)
- answer does not remove all files and directories that start with `.` (-1)
- paths are hardcoded using slashes (-1)
- q3 (4)
- recomputed variable defined in Question 1 or Question 2, or the answer is not sorted explicitly (-1)
- answer does not remove all files and directories that start with `.` (-1)
- answer does not check only for files that end with `.csv` (-1)
- paths are hardcoded using slashes (-1)
- q4 (4)
- recomputed variable defined in Question 1 or Question 2, or the answer is not sorted explicitly (-1)
- answer does not remove all files and directories that start with `.` (-1)
- answer does not check for only files that start with `stars` (-1)
- paths are hardcoded using slashes (-1)
- `Star` (2)
- data structure is defined more than once (-1)
- data structure is defined incorrectly (-1)
- `star_cell` (4)
- function does not typecast values based on columns (-1)
- column indices are hardcoded instead of using column names (-1)
- function logic is incorrect (-1)
- function is defined more than once (-1)
- q5 (4)
- `star_cell` function is not used to answer (-1)
- answer unnecessarily iterates over the entire dataset (-1)
- `get_stars` (6)
- function logic is incorrect (-2)
- hardcoded the name of directory inside the function instead of passing it as a part of the input argument (-1)
- function is called more than twice with the same dataset (-1)
- `star_cell` function is not used (-1)
- function is defined more than once (-1)
- q6 (2)
- `stars_1_dict` data structure is not used to answer (-2)
- q7 (3)
- incorrect logic is used to answer (-1)
- `stars_1_dict` data structure is not used to answer (-1)
- q8 (3)
- incorrect logic is used to answer (-1)
- `get_stars` function is not used to answer (-1)
- `stars_dict` (3)
- data structure is defined incorrectly (-1)
- `get_stars` function is not used (-1)
- `stars_paths` is not used to find paths of necessary files (-1)
- q9 (2)
- `stars_dict` data structure is not used to answer (-2)
- q10 (3)
- incorrect logic is used to answer (-1)
- `stars_dict` data structure is not used to answer (-1)
- q11 (3)
- answer does not check for only stars that start with `Kepler` (-1)
- incorrect logic is used to answer (-1)
- `stars_dict` data structure is not used to answer (-1)
- `Planet` (2)
- data structure is defined more than once (-1)
- data structure is defined incorrectly (-1)
- `planet_cell` (5)
- function does not typecast values based on columns (-1)
- column indices are hardcoded instead of using column names (-1)
- boolean values are not typecasted correctly (-1)
- function logic is incorrect (-1)
- function is defined more than once (-1)
- q12 (4)
- `planet_cell` function is not used to answer (-1)
- `mapping_1_json` data structure is not used to answer (-1)
- answer unnecessarily iterates over the entire dataset (-1)
- `get_planets` (8)
- function logic is incorrect (-2)
- hardcoded the name of directory inside the function instead of passing it as a part of the input argument (-1)
- function is called more than twice with the same dataset (-1)
- `planet_cell` function is not used (-1)
- function is defined more than once (-3)
- q13 (3)
- `get_planets` function is not used to answer (-1)
- paths are hardcoded using slashes (-1)
- q14 (3)
- incorrect logic is used to answer (-1)
- `get_planets` function is not used to answer (-1)
- paths are hardcoded using slashes (-1)
- q15 (3)
- `get_planets` function is not used to answer (-1)
- paths are hardcoded using slashes (-1)
- `planets_list` (4)
- data structure is defined incorrectly (-2)
- `get_planets` function is not used (-1)
- paths are hardcoded using slashes (-1)
- q16 (2)
- `planets_list` data structure is not used to answer (-2)
- q17 (3)
- incorrect comparison operator is used (-1)
- incorrect logic is used to answer (-1)
- `planets_list` data structure is not used to answer (-1)
- q18 (4)
- `planets_list` and `stars_dict` data structures are not used to answer (-2)
- did not exit loop and instead iterated further after finding the answer (-1)
- q19 (5)
- incorrect comparison operator is used (-1)
- incorrect logic is used to answer (-1)
- `planets_list` and `stars_dict` data structures are not used to answer (-2)
- q20 (5)
- answer does not include all Planets that orbit the Star (-1)
- incorrect logic is used to answer (-1)
- `planets_list` and `stars_dict` data structures are not used to answer (-2)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment