Conversation
src/npa_howtopay/model.py
Outdated
| ####### TODO: ticket | ||
| intermediate_columns = compute_blue_columns() # returns pl.DataFrame | ||
| # TODO: ticket | ||
| intermediate_df_gas = compute_intermediate_cols(year, input_params, scenario_params, "gas") |
There was a problem hiding this comment.
I think this is cleaner as just "compute_intermediate_gas_cols" and "compute_intermediate_electric_cols", rather than the branching in compute_intermediate_cols
src/npa_howtopay/model.py
Outdated
| ts_params.gas_fixed_overhead_costs + gas_maintenance_cost + npa_opex | ||
| ) # npa_opex is 0 if scenario_params.capex_opex == "capex" OR gas_electric == "electric" | ||
| # costs_depreciation = gas_depreciation_expense | ||
| total_costs = costs_fixed + costs_volumetric |
There was a problem hiding this comment.
nit: maybe call this like "opex_costs" or something, because it's weird that "total_costs" isn't in fact the total of all costs (we add "costs_depreciation" in the next line). I introduced this bad name in the spreadsheet, sorry
src/npa_howtopay/model.py
Outdated
| ) -> pl.DataFrame: | ||
| # TODO: implement this | ||
| if gas_electric == "gas": | ||
| num_gas_users = input_params.gas.num_users_init - npa.compute_num_converts_from_df(ts_params.npa_projects, year) |
There was a problem hiding this comment.
note: the signature on this function changes a little bit in the npa_projects PR, but it's a trivial merge. New call will be:
npa.compute_total_converts_from_df(year, ts_params.npa_projects, cumulative=True)
src/npa_howtopay/model.py
Outdated
| def compute_blue_columns(year: int, gas_params: GasParams, shared_params: SharedParams) -> pl.DataFrame: | ||
| def compute_intermediate_cols( | ||
| year: int, | ||
| input_params: InputParams, |
There was a problem hiding this comment.
this also needs to take ScenarioParams right, so it can know whether to assign opex costs for npa projects?
src/npa_howtopay/model.py
Outdated
|
|
||
| # gas_usage = input_params.gas_usage_per_user * num_gas_users | ||
| # gas_costs_volumetric = gas_usage * input_params.gas_cost_per_therm | ||
| # return pl.DataFrame({"year": year, "gas_usage": gas_usage, "gas_costs_volumetric": gas_costs_volumetric}) |
There was a problem hiding this comment.
looking at this commented out return statement, I feel better about the request to split this into two functions, since we'd need to branch the return as well since the columns being created are different
…lt npa_opex into gas or elec
calculate intermediate columns and return as df