From 06056870c9581e14252fc332f3cda7375d829f08 Mon Sep 17 00:00:00 2001 From: ram-from-tvl Date: Wed, 22 Oct 2025 13:48:42 +0530 Subject: [PATCH 1/2] Add explanatory note about adjuster values being subtracted from forecast, ate heatmap to use OCF color scale centered at 0 with fixed range -3500 to 3500 --- src/adjuster.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/adjuster.py b/src/adjuster.py index e0f643cf..7dd1dc0c 100644 --- a/src/adjuster.py +++ b/src/adjuster.py @@ -21,6 +21,8 @@ def adjuster_page(): url = 'https://www.notion.so/openclimatefix/Adjuster-cae707fbac0a440895f8aacec2a7b55c?pvs=4' st.markdown(f'Link to Notion page', unsafe_allow_html=True) + st.markdown("**Note:** Adjuster values are subtracted from the forecast. Positive adjuster values will reduce the forecast.") + connection = DatabaseConnection(url=os.environ["DB_URL"], echo=True) with connection.get_session() as session: # get all the models with adjust values @@ -50,9 +52,24 @@ def adjuster_page(): index="time_of_day", columns="forecast_horizon_minutes", values="value" ) + # Define OCF colorscale + colorscale = [ + [0, '#4675c1'], + [0.111, '#65b0c9'], + [0.222, '#58b0a9'], + [0.333, '#ffd480'], + [0.444, '#faa056'], + [0.555, '#9cb6e1'], + [0.666, '#a3d6e0'], + [0.777, '#9ed1cd'], + [0.888, '#ffe9bc'], + [1, '#ffdabc'] + ] + fig = go.Figure( data=go.Heatmap( - z=metric_values_df.values, x=metric_values_df.columns, y=metric_values_df.index + z=metric_values_df.values, x=metric_values_df.columns, y=metric_values_df.index, + colorscale=colorscale, zmid=0, zmin=-3500, zmax=3500 ), layout=go.Layout( title=go.layout.Title(text=f"Adjuster Value for {model_name}"), From 6f00b0d72d3bf840bb376a614ca4a179fcf44ecc Mon Sep 17 00:00:00 2001 From: ram-from-tvl Date: Tue, 6 Jan 2026 19:47:13 +0530 Subject: [PATCH 2/2] Use only bold colors for colorscale to avoid confusion --- src/adjuster.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/adjuster.py b/src/adjuster.py index 7dd1dc0c..0066dd90 100644 --- a/src/adjuster.py +++ b/src/adjuster.py @@ -52,18 +52,13 @@ def adjuster_page(): index="time_of_day", columns="forecast_horizon_minutes", values="value" ) - # Define OCF colorscale + # Define OCF colorscale using only bold colors for full range colorscale = [ - [0, '#4675c1'], - [0.111, '#65b0c9'], - [0.222, '#58b0a9'], - [0.333, '#ffd480'], - [0.444, '#faa056'], - [0.555, '#9cb6e1'], - [0.666, '#a3d6e0'], - [0.777, '#9ed1cd'], - [0.888, '#ffe9bc'], - [1, '#ffdabc'] + [0, '#4675c1'], # Bold blue (negative values) + [0.25, '#65b0c9'], # Bold cyan + [0.5, '#58b0a9'], # Bold teal (around zero) + [0.75, '#ffd480'], # Bold yellow-orange + [1, '#faa056'] # Bold orange (positive values) ] fig = go.Figure(