diff --git a/migrations/versions/22ce09690d23_mix_in_timely_beliefs_sensor_with_asset_market_and_weather_sensor.py b/migrations/versions/22ce09690d23_mix_in_timely_beliefs_sensor_with_asset_market_and_weather_sensor.py index cad8037ee..e99ac01c2 100644 --- a/migrations/versions/22ce09690d23_mix_in_timely_beliefs_sensor_with_asset_market_and_weather_sensor.py +++ b/migrations/versions/22ce09690d23_mix_in_timely_beliefs_sensor_with_asset_market_and_weather_sensor.py @@ -70,9 +70,6 @@ def upgrade(): op.execute( f"update market set knowledge_horizon_fnc = '{knowledge_horizons.ex_ante.__name__}';" ) # default assumption that prices are known before a transaction - op.execute( - f"update market set knowledge_horizon_fnc = '{knowledge_horizons.x_days_ago_at_y_oclock.__name__}' where name in ('epex_da', 'kpx_da');" - ) op.execute( f"update market set knowledge_horizon_fnc = '{knowledge_horizons.at_date.__name__}' where name in ('kepco_cs_fast', 'kepco_cs_slow', 'kepco_cs_smart');" ) @@ -90,12 +87,6 @@ def upgrade(): op.execute( f"""update market set knowledge_horizon_par = '{json.dumps(ex_ante_default_par)}';""" ) - op.execute( - """update market set knowledge_horizon_par = '{"x": 1, "y": 12, "z": "Europe/Paris"}' where name='epex_da';""" - ) # gate closure at 12:00 on the preceding day, with expected price publication at 12.42 and 12.55 (from EPEX Spot Day-Ahead Multi-Regional Coupling, https://www.epexspot.com/en/downloads#rules-fees-processes ) - op.execute( - """update market set knowledge_horizon_par = '{"x": 1, "y": 10, "z": "Asia/Seoul"}' where name='kpx_da';""" - ) # gate closure at 10.00 on the preceding day, with expected price publication at 15.00 (from KPX Power Market Operation, https://www.slideshare.net/sjchung0/power-market-operation ) op.execute( """update market set knowledge_horizon_par = '{"knowledge_time": "2014-12-31 00:00:00+00:00"}' where name in ('kepco_cs_fast', 'kepco_cs_slow', 'kepco_cs_smart');""" ) # tariff publication date (unofficial) @@ -145,6 +136,18 @@ def upgrade(): op.execute("update weather_sensor set timezone = 'Asia/Seoul';") op.alter_column("weather_sensor", "timezone", nullable=False) + # todo: execute after adding relevant tests and updating our strategy to create forecasting jobs when new information arrives + # op.execute( + # f"update market set knowledge_horizon_fnc = '{knowledge_horizons.x_days_ago_at_y_oclock.__name__}' where name in ('epex_da', 'kpx_da');" + # ) + # op.execute( + # """update market set knowledge_horizon_par = '{"x": 1, "y": 12, "z": "Europe/Paris"}' where name='epex_da';""" + # ) # gate closure at 12:00 on the preceding day, with expected price publication at 12.42 and 12.55 (from EPEX Spot Day-Ahead Multi-Regional Coupling, https://www.epexspot.com/en/downloads#rules-fees-processes ) + # op.execute( + # """update market set knowledge_horizon_par = '{"x": 1, "y": 10, "z": "Asia/Seoul"}' where name='kpx_da';""" + # ) # gate closure at 10.00 on the preceding day, with expected price publication at 15.00 (from KPX Power Market Operation, https://www.slideshare.net/sjchung0/power-market-operation ) + # todo: add statement to update the horizon for prices on these markets, in accordance with their new knowledge horizon function + def downgrade(): # Drop mixed in columns