Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow switching on and off contour plot numerical labels at top level #719

Merged
merged 2 commits into from Oct 20, 2023

Conversation

misi9170
Copy link
Collaborator

@misi9170 misi9170 commented Oct 20, 2023

Description

The flow visualization tools were hardcoded to plot numerical labels on the flow contour plots. This PR makes that an optional choice at the top level in the visualize_cut_plane() and visualize_heterogeneous_cut_plane() functions of tools/visualization.py, which are passed through to the mid-level function line_contour_cut_plane().

I have set the default value of the new label_contours Boolean to False, as I believe that most users will not want the contour labels shown. However, I've now updated examples 02_visualizations.py and 16_heterogeneous_inflow.py so that label_contours is set to True for those examples. I have left the default value (False) in other examples involving flow plots.

Other notes

  • No changes are made to source code
  • Output from most examples involving flow contour plots has changed, as the contour labels are now largely gone. The exceptions are 02 and 16, where I have reincluded the contour labels.
  • The function visualize_heterogeneous_cut_plane() of tools/visualization.py does not appear to be called anywhere in the floris code or examples, and may be redundant. However, I have not confirmed this and have left the function in place.
  • Tests pass.

Examples

Running 02_visualizations.py with label_contours = True produces
image

while setting label_contours = False produces
image

Copy link
Collaborator

@rafmudaf rafmudaf left a comment

Choose a reason for hiding this comment

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

Nicely done!

@misi9170 misi9170 added enhancement An improvement of an existing feature floris.tools labels Oct 20, 2023
@rafmudaf rafmudaf added this to the v3.5 milestone Oct 20, 2023
@rafmudaf rafmudaf merged commit 2dccbbd into NREL:develop Oct 20, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature floris.tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants