Skip to content

Commit

Permalink
improve dashboards - use time instead of index for unit_dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Dec 6, 2024
1 parent b20e36d commit a89e414
Show file tree
Hide file tree
Showing 7 changed files with 797 additions and 500 deletions.
10 changes: 7 additions & 3 deletions assume/markets/clearing_algorithms/nodal_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,24 @@ def clear(
df_p_max_pu.update(p_max_pu)
new_columns = p_max_pu.loc[:,~p_max_pu.columns.isin(df_p_max_pu.columns)]
nodal_network.generators_t.p_max_pu = pd.concat([df_p_max_pu, new_columns], axis=1)

Check warning on line 156 in assume/markets/clearing_algorithms/nodal_pricing.py

View check run for this annotation

Codecov / codecov/patch

assume/markets/clearing_algorithms/nodal_pricing.py#L153-L156

Added lines #L153 - L156 were not covered by tests
nodal_network.generators_t.p_max_pu.index.name = "snapshot"
nodal_network.generators_t.p_max_pu.columns.name = "Generator"

# Update p_min_pu for generators

Check warning on line 160 in assume/markets/clearing_algorithms/nodal_pricing.py

View check run for this annotation

Codecov / codecov/patch

assume/markets/clearing_algorithms/nodal_pricing.py#L159-L160

Added lines #L159 - L160 were not covered by tests
df_p_min_pu = nodal_network.generators_t.p_min_pu
df_p_min_pu.update(p_min_pu)
new_columns = p_min_pu.loc[:,~p_min_pu.columns.isin(df_p_min_pu.columns)]
nodal_network.generators_t.p_min_pu = pd.concat([df_p_min_pu, new_columns], axis=1)
nodal_network.generators_t.p_min_pu.index.name = "snapshot"
nodal_network.generators_t.p_min_pu.columns.name = "Generator"

Check warning on line 166 in assume/markets/clearing_algorithms/nodal_pricing.py

View check run for this annotation

Codecov / codecov/patch

assume/markets/clearing_algorithms/nodal_pricing.py#L163-L166

Added lines #L163 - L166 were not covered by tests

# Update marginal costs for generators
df_costs = nodal_network.generators_t.marginal_cost
df_costs.update(costs)

Check warning on line 170 in assume/markets/clearing_algorithms/nodal_pricing.py

View check run for this annotation

Codecov / codecov/patch

assume/markets/clearing_algorithms/nodal_pricing.py#L169-L170

Added lines #L169 - L170 were not covered by tests
new_columns = costs.loc[:,~costs.columns.isin(df_costs.columns)]
nodal_network.generators_t.marginal_cost = pd.concat([df_costs, new_columns], axis=1)
nodal_network.generators_t.marginal_cost.index.name = "snapshot"
nodal_network.generators_t.marginal_cost.columns.name = "Generator"

Check warning on line 175 in assume/markets/clearing_algorithms/nodal_pricing.py

View check run for this annotation

Codecov / codecov/patch

assume/markets/clearing_algorithms/nodal_pricing.py#L173-L175

Added lines #L173 - L175 were not covered by tests

with suppress_output():
Expand All @@ -181,11 +187,9 @@ def clear(
logger.error(f"Solver exited with {termination_condition}")
raise Exception("Solver in redispatch market did not converge")

log_flows = True

# process dispatch data
flows = self.process_dispatch_data(
network=nodal_network, orderbook_df=orderbook_df, log_flows=log_flows
network=nodal_network, orderbook_df=orderbook_df, log_flows=True

Check warning on line 192 in assume/markets/clearing_algorithms/nodal_pricing.py

View check run for this annotation

Codecov / codecov/patch

assume/markets/clearing_algorithms/nodal_pricing.py#L192

Added line #L192 was not covered by tests
)

# return orderbook_df back to orderbook format as list of dicts
Expand Down
Loading

0 comments on commit a89e414

Please sign in to comment.