Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Jupyter Notebook for Visualization and Validation #17

Open
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

MarkEwert03
Copy link
Collaborator

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

The main purpose of this PR is to create a Jupyter notebook to allow for easier user accessibility running leap and performing analysis with the results. Along the way, a couple of bugs were fixed and additional features were added including:

  • ignore_pollution_flag added to leap cmd arguments. Currently, air pollution is just a framework in the model and has no actual effect on it. This conditional flag is passed through simulation.py and agent.py so that errors are not generated by check_year() by utils.py (This stems from issue Issue with Incidence Module #8 and this is a temporary workaround until air pollution functionality is added)
  • additional error checking in severity.py/compute_distribution() to avoid leap from crashing due to non-stochastic values being passed to np.multinomial
  • np.clip() added in utils.py/sigmoid() to avoid np overflow warnings
  • additional features for users running leap:
    • If directory doesn't exist with -o flag, users are prompted to create one
    • If directory does exist with -o flag, users are warned that they will overwrite existing files
    • Log file created after each successful run with relevant metadata and simulation parameters

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (updated docstrings or README files)
  • Tests (added new tests or modified current test suite)
  • Refactoring (changes in the design of the code that don't change the functionality)

Tests

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

  • Ran leap with various parameters to obtain data files used for jupyter notebook

Linked PRs / Issues

List here any related pull requests (from this repo or other repos) and/or the issue this PR is addressing.

This addresses GitHub Issue #14. We will confirm with Kate what additional plots are desired.

Checklist:

  • I have performed a self-review of my code
  • I have documented my code with appropriate docstrings
  • I have made corresponding changes to the documentation / README files
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@ahill187 ahill187 added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 30, 2025
Copy link
Collaborator

@ahill187 ahill187 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I've added a few comments, a few things to change, but overall looks good to go.

.gitignore Outdated Show resolved Hide resolved
leap/outcome_matrix.py Show resolved Hide resolved
leap/processed_data/pop_projection_BC_CA.rds Outdated Show resolved Hide resolved
leap/utils.py Show resolved Hide resolved
leap/utils.py Show resolved Hide resolved
leap/main.py Show resolved Hide resolved
leap/main.py Show resolved Hide resolved
leap/simulation.py Outdated Show resolved Hide resolved
leap/agent.py Outdated Show resolved Hide resolved
output_visualizations.ipynb Outdated Show resolved Hide resolved
@MarkEwert03 MarkEwert03 requested a review from ahill187 February 4, 2025 22:38
leap/outcome_matrix.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants