Skip to content

User bill columns#16

Merged
karpdave merged 5 commits intomainfrom
pink_columns
Aug 27, 2025
Merged

User bill columns#16
karpdave merged 5 commits intomainfrom
pink_columns

Conversation

@karpdave
Copy link
Copy Markdown
Contributor

Also addressses:

  • refactor of how we handle inflation
  • update capex_project.py functions to expect full unfiltered df of npa_projects

@karpdave karpdave linked an issue Aug 27, 2025 that may be closed by this pull request
class ScenarioParams:
gas_electric: Literal["gas", "electric"] = field(validator=validators.in_(["gas", "electric"]))
capex_opex: Literal["capex", "opex"] = field(validator=validators.in_(["capex", "opex"]))
electric_fixed_cost_pct: float = field(validator=validators.and_(validators.ge(0.0), validator=validators.le(1.0)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this belong int ElectricParams?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea probably, since we aren't going to vary it across scenarios to make plots. Will move

pl.col("gas_inflation_adjusted_revenue_requirement")
+ pl.col("electric_inflation_adjusted_revenue_requirement")
).alias("total_inflation_adjusted_revenue_requirement"),
(pl.col("gas_inflation_adjusted_revenue_requirement") / pl.col("num_users")).alias("gas_bill_per_user"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change num_users to gas_num_users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack ty

+ pl.col("electric_inflation_adjusted_revenue_requirement")
).alias("total_inflation_adjusted_revenue_requirement"),
(pl.col("gas_inflation_adjusted_revenue_requirement") / pl.col("num_users")).alias("gas_bill_per_user"),
(pl.col("gas_inflation_adjusted_revenue_requirement") / pl.col("num_gas_users")).alias(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change num_gas_users to gas_num_users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack ty

"nonconverts_gas_bill_per_user"
),
(pl.lit(0)).alias("converts_gas_bill_per_user"),
(pl.col("electric_inflation_adjusted_revenue_requirement") / pl.col("num_users")).alias(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change num_users to electric_num_users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack ty

(
pl.lit(scenario_params.electric_fixed_cost_pct)
* pl.col("electric_inflation_adjusted_revenue_requirement")
/ pl.col("num_users")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change num_users to electric_num_users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ack ty

return df.filter(year_filter & npa_filter).select(pl.col("num_converts")).sum().item()


def compute_npa_install_costs_from_df(year: int, df: pl.DataFrame, npa_install_cost: float) -> float:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i created a duplicate function but we can clean it up when we merge

electric: ElectricParams
shared: SharedParams

def __attrs_post_init__(self):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these getting used anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea, in the inflation calcs

@karpdave karpdave merged commit 220d8ce into main Aug 27, 2025
0 of 7 checks passed
@karpdave karpdave deleted the pink_columns branch August 28, 2025 14:43
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.

Compute pink columns (user bills)

2 participants