Group Homework Discussion Day 5

Overview

Teaching: 0 min
Exercises: 120 min
Questions
  • What’s the homework discussion for day 5?

Objectives
  • Add NumPy Monte Carlo Code to your package.

  • Use pytest to write tests for your code.

Lesson Contents

Blog Posts

Today’s homework includes a few discussion questions. The person writing the group blog post today should include these answers in their post.

Discussion

  1. Package Interface: Everyone should read the Python documentation section on Packages.

    The __init__.py file is a way to define how users will likely interact with your code. Discuss with your group how you think functions should be called in your package. For example, as written now, our import is import mcsim.monte_carlo. Is that ideal, or would is there a way you think would be better for your users to access your function?

  2. Adding NumPy : You will notice that much of your code is the same between the two versions. Discuss with your group which functions have not changed, and which ones have changed. If you were to add your NumPy version of your Monte Carlo code to your package, what is a good way to do it?

Key Points