Skip to content

Commit

Permalink
New scenarios and bid config to match multi scenario 20 in v0, plus i…
Browse files Browse the repository at this point in the history
…mproved names, and adding 0.01 to buy_price (#370)

* New scenarios and bid config to match multi scenario 20 in v0, plus improved names
* Adding 0.01 to buy_price
* Fixing price_independent
  • Loading branch information
eriklien committed Sep 12, 2024
1 parent cf25c71 commit 5ab3b57
Show file tree
Hide file tree
Showing 6 changed files with 994 additions and 209 deletions.
52 changes: 43 additions & 9 deletions scripts/mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"source": [
"import yaml\n",
"no2_price_scenario_mappings = []\n",
"for attr_name in [\"buy_price\", \"sale_price\"]:\n",
" for price_offset in range(-200, 200+1, 20):\n",
"price_offsets_in_multi_scenario_20 = {-500, -50, -40, -30, -20, -15, -10, -5, 5, 10, 15, 20, 30, 40, 50, 70, 100, 2000}\n",
"for attr_name, add_extra in {\"buy_price\": 0.01, \"sale_price\": 0}.items():\n",
" for add_to_price in sorted(price_offsets_in_multi_scenario_20.union(set(range(-200, 200+1, 20)))):\n",
" no2_price_scenario_mappings.append({\n",
" \"external_id\": f\"no2_{attr_name}_offset_{price_offset}\",\n",
" \"external_id\": f\"no2_{attr_name}_{'plus' if add_to_price>0 else 'minus'}_{abs(add_to_price)}_first_24h\",\n",
" \"object_type\": \"market\",\n",
" \"object_name\": \"Dayahead\",\n",
" \"attribute_name\": attr_name,\n",
Expand All @@ -20,14 +21,44 @@
" \"AddFromOffset\": {\n",
" \"parameters\": {\n",
" \"relative_datapoints\": [\n",
" {\"offset_minute\": 0.0, \"offset_value\": price_offset},\n",
" {\"offset_minute\": 1440.0, \"offset_value\": 0.0},\n",
" {\"offset_minute\": 0.0, \"offset_value\": add_to_price+add_extra},\n",
" {\"offset_minute\": 1440.0, \"offset_value\": 0.0+add_extra},\n",
" ]\n",
" }\n",
" }\n",
" },\n",
" ],\n",
" })\n",
" for price_multiplier in {0}:\n",
" no2_price_scenario_mappings.append({\n",
" \"external_id\": f\"no2_{attr_name}_multiply_{price_multiplier}_first_24h\",\n",
" \"object_type\": \"market\",\n",
" \"object_name\": \"Dayahead\",\n",
" \"attribute_name\": attr_name,\n",
" \"time_series\": f\"[external_id]907677\",\n",
" \"transformations\": ([{\n",
" \"AddFromOffset\": {\n",
" \"parameters\": {\n",
" \"relative_datapoints\": [\n",
" {\"offset_minute\": 0.0, \"offset_value\": add_extra},\n",
" {\"offset_minute\": 1440.0, \"offset_value\": add_extra},\n",
" ]\n",
" }\n",
" }\n",
" }] if add_extra != 0 else [])+\n",
" [{\n",
" \"MultiplyFromOffset\": {\n",
" \"parameters\": {\n",
" \"relative_datapoints\": [\n",
" {\"offset_minute\": 0.0, \"offset_value\": price_multiplier},\n",
" {\"offset_minute\": 1440.0, \"offset_value\": price_multiplier},\n",
" ]\n",
" }\n",
" }\n",
" },\n",
" ],\n",
" })\n",
"\n",
"\n",
"print(yaml.safe_dump(no2_price_scenario_mappings, sort_keys=False))"
]
Expand Down Expand Up @@ -133,12 +164,15 @@
"plants = plants_with_schedule\n",
"for plant in plants:\n",
" for add_steps in [True, False]:\n",
" for number_of_scenarios_in_scenario_set in [\"2\", \"3\"]:\n",
" for number_of_scenarios_in_scenario_set in [\"1\", \"2\", \"3\", \"20\"]:\n",
" if add_steps and number_of_scenarios_in_scenario_set == \"1\":\n",
" continue\n",
" method = f\"multi scenario {number_of_scenarios_in_scenario_set}\" if number_of_scenarios_in_scenario_set != \"1\" else \"price independent\"\n",
" print(f\"- name: {plant} {number_of_scenarios_in_scenario_set}{' step' if add_steps else ''}\")\n",
" print(f\" method: multi scenario {number_of_scenarios_in_scenario_set}\")\n",
" print(f\" power_asset: \\\"[external_id]plant_water_value_based_{plant.lower()}\\\"\")\n",
" print(f\" method: {method}\")\n",
" print(f\" power_asset: \\\"[external_id]plant_information_{plant.lower()}\\\"\")\n",
" print(f\" add_steps: {add_steps}\")\n",
" print(f\" scenario_set: \\\"[name|type:ShopScenarioSet]{number_of_scenarios_in_scenario_set} scenarios\\\"\")\n",
" print(f\" scenario_set: \\\"[name]Fornebu {number_of_scenarios_in_scenario_set} scenario{'s' if number_of_scenarios_in_scenario_set!='1' else ''}\\\"\")\n",
" "
]
},
Expand Down
25 changes: 24 additions & 1 deletion tests/data/demo/v1/fornebu/bid_configuration_day_ahead.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
price_area: "[external_id]price_area_information_no2"
bid_date_specification: "[name]Default BidDate"
partials:
- "[name|type:ShopBasedPartialBidConfiguration]plant A set A"
- "[external_id]shop_based_partial_bid_configuration_strand_krv_1"
- "[external_id]shop_based_partial_bid_configuration_rull2_1"
- "[external_id]shop_based_partial_bid_configuration_rull1_1"
- "[external_id]shop_based_partial_bid_configuration_lien_krv_1"
- "[external_id]shop_based_partial_bid_configuration_dalby_1"
- "[external_id]shop_based_partial_bid_configuration_holen_1"
- "[external_id]shop_based_partial_bid_configuration_landet_1"
- "[external_id]shop_based_partial_bid_configuration_scott_1"
- "[external_id]shop_based_partial_bid_configuration_lund_1"
- name: Multi Scenario 2 NO2
market_configuration: "[external_id]market_configuration_nord_pool_day_ahead"
price_area: "[external_id]price_area_information_no2"
Expand Down Expand Up @@ -79,3 +87,18 @@
- "[external_id]shop_based_partial_bid_configuration_holen_3"
- "[external_id]shop_based_partial_bid_configuration_landet_2"
- "[external_id]shop_based_partial_bid_configuration_lund_3_step"

- name: Multi scenario 20 NO2
market_configuration: "[name]Nord Pool Day-Ahead"
price_area: "[external_id]price_area_information_no2"
bid_date_specification: "[name]Default BidDate"
partials:
- "[external_id]shop_based_partial_bid_configuration_strand_krv_20_step"
- "[external_id]shop_based_partial_bid_configuration_rull2_20_step"
- "[external_id]shop_based_partial_bid_configuration_rull1_20_step"
- "[external_id]shop_based_partial_bid_configuration_lien_krv_20_step"
- "[external_id]shop_based_partial_bid_configuration_dalby_20_step"
- "[external_id]shop_based_partial_bid_configuration_holen_20_step"
- "[external_id]shop_based_partial_bid_configuration_landet_20_step"
- "[external_id]shop_based_partial_bid_configuration_scott_20_step"
- "[external_id]shop_based_partial_bid_configuration_lund_20_step"
Loading

0 comments on commit 5ab3b57

Please sign in to comment.