Skip to content

Conversation

@AnujNayak108
Copy link
Contributor

Pull Request

Description

Fix consistent color assignment for all forecast models in plots/utils.py.
This ensures that each model has a unique, identifiable color in plots, including new or experimental models.

Fixes #373

How Has This Been Tested?

Ran test_colours.py to verify that all models, including new and PVLive models, are assigned a color.

Verified that colour_per_model dictionary updates correctly for new models.

  • Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

Copy link
Member

@Sukh-P Sukh-P left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the tidy up changes needed then, I'll run the branch locally as well just to check it looks okay visually and then we can get this merged in, thanks for the work on this!

@AnujNayak108 AnujNayak108 requested a review from Sukh-P October 15, 2025 13:50
"""Get colour from model label"""
if "PVLive" in model_name:
colour = colour_per_model.get(model_name, "#FFFFFF")
return colour_per_model.get(model_name, "#e4e4e4")
Copy link
Member

@Sukh-P Sukh-P Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the PVLive colour the same actually? It's white which is quite distinctive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sure

}

# Make a cycle for extra models not in colour_per_model
# Skip first 3 colours as they are too similar to colours in colour_per_model
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed too as the line it related to has been removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Sukh-P
Copy link
Member

Sukh-P commented Oct 21, 2025

@AnujNayak108 thanks again for your work on this, tried running this locally to check out the new colours and noticed some errors that the tests don't catch (which isn't great)

Namely it's that the removed line_color dict in utils is referenced and used in other places e.g. here and here so all of these will need to be updated as well

@AnujNayak108
Copy link
Contributor Author

I’ve updated the plotting logic to use get_colour_from_model_name instead of line_color to handle color selection dynamically based on the model name.

Please check if this works correctly in your environment.
If it doesn’t behave as expected, could you suggest an alternative approach or adjustment you’d recommend?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make colours for graphs on forecast page more distinct

2 participants