Skip to content

Commit

Permalink
Add interface attribute for 1D plot line width
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Mar 29, 2024
1 parent 9756527 commit c676fa1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wcomp/base_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ class WCompBase(ABC):
"""

LINE_PLOT_COLOR = "OVERWRITE" # Color to use for all line plots; use matplotlib color codes
LINE_PLOT_MARKER = "" # Marker to use for all line plots; use matplotlib marker codes
LINE_PLOT_LINESTYLE = "--" # Line style to use for all line plots; use matplotlib line style codes
LINE_PLOT_LINEWIDTH = 2 # Line width to use for all line plots
LEGEND = "OVERWRITE" # Legend entry; typically should be the name of the corresponding software

# These generally do not need to be changed in the subclass
N_POINTS_1D = 100 # Number of points to use for 1D line plots
RESOLUTION_2D = 10 # Resolution for 2D contour plots in meters

Expand Down
4 changes: 4 additions & 0 deletions wcomp/floris_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class WCompFloris(WCompBase):
LINE_PLOT_COLOR = "green"
LINE_PLOT_MARKER = ""
LINE_PLOT_LINESTYLE = "--"
LINE_PLOT_LINEWIDTH = 2
LEGEND = "Floris"

def __init__(self, input_file: str | Path):
Expand Down Expand Up @@ -282,6 +283,7 @@ def vertical_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down Expand Up @@ -316,6 +318,7 @@ def streamwise_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down Expand Up @@ -350,6 +353,7 @@ def xsection_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down
4 changes: 4 additions & 0 deletions wcomp/foxes_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class WCompFoxes(WCompBase):
LINE_PLOT_COLOR = "red"
LINE_PLOT_MARKER = ""
LINE_PLOT_LINESTYLE = "--"
LINE_PLOT_LINEWIDTH = 2
LEGEND = "foxes"

def __init__(self, input_file: str | Path):
Expand Down Expand Up @@ -462,6 +463,7 @@ def vertical_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down Expand Up @@ -495,6 +497,7 @@ def streamwise_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down Expand Up @@ -530,6 +533,7 @@ def xsection_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down
4 changes: 4 additions & 0 deletions wcomp/pywake_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class WCompPyWake(WCompBase):
LINE_PLOT_COLOR = "blue"
LINE_PLOT_MARKER = ""
LINE_PLOT_LINESTYLE = "--"
LINE_PLOT_LINEWIDTH = 2
LEGEND = "PyWake"

def __init__(self, input_file: str | Path):
Expand Down Expand Up @@ -245,6 +246,7 @@ def vertical_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down Expand Up @@ -285,6 +287,7 @@ def streamwise_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down Expand Up @@ -323,6 +326,7 @@ def xsection_profile_plot(
color=self.LINE_PLOT_COLOR,
marker=self.LINE_PLOT_MARKER,
linestyle=self.LINE_PLOT_LINESTYLE,
linewidth=self.LINE_PLOT_LINEWIDTH,
label=self.LEGEND
)
return profile
Expand Down

0 comments on commit c676fa1

Please sign in to comment.