Skip to content

Calculate budget windows on the detailed-save path, five years at a time #1053

Closed

Description

@anth-volk

The detailed-save API calculates economy reports one year at a time (#1049, #1051). Budget-window reports, which compare a reform with its baseline in each year of a window of up to 75 years, have no detailed-save path yet. The draft #982 built one on the simulation service's own tables, which no longer exist, and scheduled its years through call reports, which were removed.

What's needed

  • POST /reports accepts a budget window (report_type: "budget_window", budget_window_size 1 to 75, ending by 2200) and creates, in one transaction, the report, one budget_window_runs row and a report run per year naming it and the year.
  • At most five years of a window are under way at once. The simulation service starts the first ones; each year's coordinator, when its year ends, starts the window's earliest waiting years.
  • The window is marked succeeded when every year has succeeded, and failed as soon as a year fails, with no further years started.
  • The stuck-run sweep leaves a window's waiting years to the window, fails the window when it fails one of its years, and settles a window that no year advances any more.
  • The v2 functions' Modal container limits leave room for windows running at their cap.

The Public API grants the roles the updates of budget_window_runs this needs in PolicyEngine/policyengine-api#4267.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions