Skip to content

[DMP 2024]: Unified policyengine Python package #1

@MaxGhenis

Description

@MaxGhenis

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.

Metadata

Metadata

Assignees

Labels

dmp-2024DMP 2024-related.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions