Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

Set benefit increases to negative values in net revenue impact table#2672

Closed
v-lerie wants to merge 4 commits into
PolicyEngine:mainfrom
v-lerie:issue2601
Closed

Set benefit increases to negative values in net revenue impact table#2672
v-lerie wants to merge 4 commits into
PolicyEngine:mainfrom
v-lerie:issue2601

Conversation

@v-lerie

@v-lerie v-lerie commented Jul 14, 2025

Copy link
Copy Markdown
Collaborator

Description

Fixes #2601

Screenshots

image

@vercel

vercel Bot commented Jul 14, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
policyengine-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 15, 2025 0:13am

@anth-volk anth-volk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for your work on this @v-lerie, just had a few changes for you.

? impact.budget[item.budgetKey]
: item.formula(impact.budget),
item.budgetKey === "benefit_spending_impact"
? -Math.abs(impact.budget[item.budgetKey])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue, blocking: I believe this only half-solves the problem

In cases where the government budget loses revenue (e.g., a new benefit program is introduced), the benefits row should be negative, but in cases where the government budget gains revenue (e.g., benefit cuts), it should be positive. This code will always make it positive.

? impact.budget[item.budgetKey]
: item.formula(impact.budget),
item.budgetKey === "benefit_spending_impact"
? -Math.abs(impact.budget[item.budgetKey])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue, blocking: It's tough to read this nested conditional

Addressing my other comment, can you modify this to be more readable/CLEAN?

}

if (budgetKey === "benefit_spending_impact") {
impact = -Math.abs(impact);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue, blocking: Here, too budgetary impacts are always negative when they should be negative only sometimes

@github-project-automation github-project-automation Bot moved this from Todo to PR: Review Requested in policyengine-app Jul 24, 2025
@MaxGhenis

Copy link
Copy Markdown
Contributor

Thank you for this contribution. Closing as part of the policyengine-app (v1) wind-down: policyengine.org is now served by policyengine-app-v2, and this repository is being archived, so changes merged here would not reach the live site.

If this is still relevant, please consider re-opening it against policyengine-app-v2 — we'd welcome it there. Apologies that this sat open through the migration.

If v2's revenue table still shows this, please re-file — sounds like a real display bug.

@MaxGhenis MaxGhenis closed this Jul 6, 2026
@github-project-automation github-project-automation Bot moved this from PR: Review Requested to Closed in policyengine-app Jul 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

Set benefit increases to negative values in net revenue impact 5y table

3 participants