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

Add documentation page for Income Tax #759

Merged
merged 11 commits into from
Nov 23, 2023
Merged

Add documentation page for Income Tax #759

merged 11 commits into from
Nov 23, 2023

Conversation

chelsea128
Copy link
Collaborator

Thanks for contributing to OpenFisca! Please remove this line, as well as, for each line below, the cases which are not relevant to your contribution :)

  • Tax and benefit system evolution. | Technical improvement. | Crash fix. | Minor change.
  • Impacted periods: all. | until YYYY-MM-DD. | from YYYY-MM-DD.
  • Impacted areas: path/to/file/containing/impacted/variables
  • Details:
    • New feature or new behaviour description
    • Cases for which an error was noticed

These changes (remove lines which are not relevant to your contribution):

  • Impact the PolicyEngine-UK public API (for instance renaming or removing a variable)
  • Add a new feature (for instance adding a variable)
  • Fix or improve an already existing calculation.
  • Change non-functional parts of this repository (for instance editing the README)

@nikhilwoodruff
Copy link
Collaborator

from policyengine_uk import Simulation

simulation = Simulation(
    situation=dict(
            people=dict(
            person=dict(
                age=30,
                dividend_income=10_000,
            )
        ),
        axes=[[
            dict(
                name="employment_income",
                min=0,
                max=200_000,
                count=1_000,
            )
        ]]
    ),
)

import plotly.express as px
import pandas as pd
from policyengine_core.charts import format_fig

df = pd.DataFrame({
    "Employment income": simulation.calculate("employment_income"),
    "Income tax": simulation.calculate("income_tax"),
    "Dividend income tax": simulation.calculate("dividend_income_tax"),
})

fig = px.line(
    df,
    x="Employment income",
    y=["Income tax", "Dividend income tax"],
    title="Income tax vs employment income",
    labels={
        "value": "Income tax (£)",
        "variable": "Tax type",
    },
)

format_fig(fig)

@nikhilwoodruff nikhilwoodruff changed the title Add documentation Page for Income Tax Add documentation page for Income Tax Nov 1, 2023
@nikhilwoodruff nikhilwoodruff merged commit 14b7bfa into PolicyEngine:master Nov 23, 2023
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants