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

[DMP 2024]: Unified policyengine Python package #1

Closed
MaxGhenis opened this issue Apr 5, 2024 · 4 comments
Closed

[DMP 2024]: Unified policyengine Python package #1

MaxGhenis opened this issue Apr 5, 2024 · 4 comments
Assignees
Labels
dmp-2024 DMP 2024-related.

Comments

@MaxGhenis
Copy link
Contributor

Description

We are looking to develop a Python package called policyengine that will serve as a unified interface for our country-specific policy simulation packages (e.g., policyengine_us, policyengine_uk). This package will provide a consistent API for users to perform policy simulations, conduct analyses, and generate visualizations across different countries. The package will include two main simulation classes: Microsimulation for running simulations on microdata and IndividualSim for calculating outcomes for a single household. Additionally, the package will offer analytics and charting functionality to facilitate cross-country comparisons and visualizations. A key feature of the package will be the ability to reproduce charts and visualizations from the PolicyEngine web interface, enabling users to generate insightful visual representations of simulation results programmatically.

Goals

  • Design a modular and extensible architecture for the policyengine package.

  • Implement the Microsimulation and IndividualSim classes for policy simulations.

  • Develop analytics and charting modules for cross-country analyses and visualizations.

  • Enable users to reproduce charts from the PolicyEngine web interface, including:

    • Budgetary breakdowns
    • Charts by income decile
    • Poverty breakdowns by demographic groups
    • Income inequality impacts for microsimulations
    • Net income, marginal tax rates, and other variables with respect to earnings for individual households (under baseline and reform law)
    • Evolution of policy parameters' values
  • Utilize Plotly for interactive and visually appealing charts.

  • Provide a user-friendly API for configuring and running simulations, including setting default countries.

  • Create comprehensive documentation, including tutorials and examples, to guide users in using the package effectively.

  • Goals Achieved By Mid-point Milestone: Completion of the core architecture, implementation of the Microsimulation and IndividualSim classes, and basic charting functionality.

Setup/Installation

The policyengine package will be hosted on GitHub and can be installed via pip:

pip install policyengine

Detailed installation instructions and dependencies will be provided in the package's README file.

Expected Outcome

The final product will be a well-documented and user-friendly Python package that enables users to perform policy simulations, conduct analyses, and generate visualizations across different countries. The package will provide a consistent interface for users to interact with our country-specific policy simulation packages, streamlining the process of cross-country comparisons and policy evaluation. Users will be able to reproduce a wide range of charts and visualizations from the PolicyEngine web interface programmatically, facilitating in-depth analysis and customization of visual representations.

Acceptance Criteria

  • The policyengine package is available on GitHub and can be installed via pip.

  • The package provides the Microsimulation and IndividualSim classes for policy simulations.

  • Users can easily configure and run simulations, including setting default countries.

  • The package includes analytics and charting modules for cross-country analyses and visualizations.

  • Users can reproduce charts from the PolicyEngine web interface, including budgetary breakdowns, charts by income decile, poverty breakdowns by demographic groups, income inequality impacts for microsimulations, net income and marginal tax rates for individual households, and evolution of policy parameters' values.

  • Plotly is used for creating interactive and visually appealing charts.

  • Comprehensive documentation, including tutorials and examples, is available to guide users in using the package effectively.

Implementation Details

  • The policyengine package will be developed in Python, leveraging existing country-specific packages (e.g., policyengine_us, policyengine_uk).

  • The package will follow a modular architecture, with separate modules for simulations, analytics, charting, and configuration.

  • The Microsimulation and IndividualSim classes will be implemented to provide a consistent interface for policy simulations across different countries.

  • The package will utilize Plotly for creating interactive and customizable charts and visualizations.

  • Chart reproduction functionality will be implemented to enable users to generate charts similar to those in the PolicyEngine web interface.

  • Continuous Integration and Continuous Deployment (CI/CD) practices will be followed to ensure code quality and automated testing.

Mockups/Wireframes

(Mockups and wireframes will be linked here when ready.)

Product Name

PolicyEngine

Organisation Name

PolicyEngine

Domain

  • Policy Simulation

  • Economic Modeling

  • Data Analysis

  • Data Visualization

Tech Skills Needed

  • Python

  • Data Analysis (pandas)

  • Data Visualization (Plotly)

  • Package Development

  • Documentation

  • Testing

  • CI/CD

Mentor(s)

@nikhilwoodruff, co-founder and CTO @anth-volk, software engineer and developer community manager

Category

  • Data Science

  • Economic Modeling

  • Package Development

  • Documentation

  • Testing

  • Data Visualization

Related Issues

  • Development of R and Stata wrappers for the policyengine package.
  • Exploration of compiling the package to WebAssembly for improved performance in web-based applications.
@MaxGhenis MaxGhenis added the dmp-2024 DMP 2024-related. label Apr 5, 2024
@masterismail
Copy link
Collaborator

Hey @MaxGhenis! I'm super interested in this project! I've been building APIs and AI models for a while now, and this sounds like a great fit.

Is there a recommended way to chat with the mentors? I'd love to discuss how I can jump in and help out with this policyengine package.

Thanks!

@nikhilwoodruff
Copy link
Contributor

nikhilwoodruff commented Jul 16, 2024

Weekly goals

Week 1

  • Add initial workflow files and set up repo for the package

Week 2

  • Plan out structure of interface, with sketches of examples

Week 3

  • Clean up code quality
  • Fix GH action deployment

Week 4

  • Add basic Pytest test Inequality metrics asserting that we match the PolicyEngine numbers (passing)
  • Add logic and tests (same as above) for all 6 poverty metrics

Week 5

  • Finish six poverty metrics
  • Add budgetary impact metrics
  • Tests for those

Week 6

  • Finish vast majority of outstanding metrics
  • Add tests for any metrics added

Week 7

@masterismail
Copy link
Collaborator

masterismail commented Jul 16, 2024

Weekly Learnings

Week 1

  • This week, I learned about Pytest and GitHub workflows, as well as GitHub Actions.

Week 2

  • This week, I focused on improving my skills in two key areas, code management and pytest.

Week 3

  • learned about gh actions in detail

Week 4

  • learned in depth about pytests

Week 5

  • learned about getting data from api

Week 6

  • focused on managing large amounts of code efficiently

Week 7

  • learnt more about plotly and it's usage.

@PolicyEngine PolicyEngine deleted a comment from Arshad-Ali-1a Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from rajat-malvi Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from Sayanjones Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from AbhimanyuSamagra Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from Tushar3021 Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from Sarcastic-Ajeet Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from MaxGhenis Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from nsadana60 Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from MaxGhenis Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from shivam963singh Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from anth-volk Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from anth-volk Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from KURAPATIHARIKA Jul 16, 2024
@PolicyEngine PolicyEngine deleted a comment from MadhukeshSingh Jul 16, 2024
@nikhilwoodruff
Copy link
Contributor

Closing since the program is now ended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dmp-2024 DMP 2024-related.
Projects
None yet
Development

No branches or pull requests

3 participants