Skip to content

Complete Assignment 1: Sampling and Reproducibility#107

Closed
tanveerrouf wants to merge 0 commit intoUofT-DSI:mainfrom
tanveerrouf:assignment-1
Closed

Complete Assignment 1: Sampling and Reproducibility#107
tanveerrouf wants to merge 0 commit intoUofT-DSI:mainfrom
tanveerrouf:assignment-1

Conversation

@tanveerrouf
Copy link

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

Added np.random.seed(42) to make results reproducible. Documented the four sampling stages in the contact tracing simulation.

What did you learn from the changes you have made?

Reproducibility requires knowing where randomness lives. Multiple sampling layers (individual, event, simulation) interact in ways that are not obvious without fixing the seed.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Considered random.seed() but NumPy functions need np.random.seed(). Setting the seed inside the loop would have broken reproducibility.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

Git divergence issue. Solved with git pull --rebase to align local work with the remote.

How were these changes tested?

Ran with 10, 100, and 1000 repetitions. With the seed, results are identical every time. Without it, values vary wildly, which in turn confirms the fix works.

A reference to a related issue in your repository (if applicable)

NA

Checklist

  • [Yes] I can confirm that my changes are working as intended

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant