Skip to content

Commit

Permalink
opencsp/common/lib/render_control: test docs
Browse files Browse the repository at this point in the history
  • Loading branch information
e10harvey committed Nov 12, 2024
1 parent a9d242a commit 0146dab
Show file tree
Hide file tree
Showing 22 changed files with 2,270 additions and 162 deletions.
55 changes: 54 additions & 1 deletion opencsp/common/lib/render_control/RenderControlBcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@


class RenderControlBcs(RenderControlPointSeq):
"""
Render control for the Beam Characterization System target.
Controls style of the point marker and circle marker of the BCS.
"""

def __init__(
self,
linestyle: str | None = '-',
Expand Down Expand Up @@ -54,10 +60,57 @@ def __init__(

def default(marker='.', color='b', linewidth=1, markersize=8) -> RenderControlBcs:
"""
What to draw if no particular preference is expressed.
Create a default render control for the Beam Characterization System target.
This function returns a `RenderControlBcs` instance configured with standard settings,
providing a basic visual representation of the BCS when no specific preferences are expressed.
Parameters
----------
marker : str, optional
Shape of the center BCS marker. One of '.', 'o', 'v', '^', '<', '>', '1', '2', '3', '4', '8', 's', '*', 'h', 'H', '+', 'x', 'D', 'd', '|', '_', or None.
By default, '.'.
color : str, optional
Color for the circle around the BCS. One of 'b', 'g', 'r', 'c', 'm', 'y', 'k', or any valid color string.
By default, 'b'.
linewidth : float, optional
Width of the line for the circle around the BCS. By default, 1.
markersize : float, optional
Size of the center BCS marker. By default, 8.
Returns
-------
RenderControlBcs
An instance of `RenderControlBcs` configured with the specified parameters.
"""
# "ChatGPT 4o" assisted with generating this docstring.
return RenderControlBcs(linewidth=linewidth, color=color, marker=marker, markersize=markersize)


def thin(marker='.', color='b', linewidth=0.3, markersize=5) -> RenderControlBcs:
"""
Create a thin render control for the Beam Characterization System target.
This function returns a `RenderControlBcs` instance configured with a thin line style,
suitable for scenarios where a less prominent visual representation is desired.
Parameters
----------
marker : str, optional
Shape of the center BCS marker. One of '.', 'o', 'v', '^', '<', '>', '1', '2', '3', '4', '8', 's', '*', 'h', 'H', '+', 'x', 'D', 'd', '|', '_', or None.
By default, '.'.
color : str, optional
Color for the circle around the BCS. One of 'b', 'g', 'r', 'c', 'm', 'y', 'k', or any valid color string.
By default, 'b'.
linewidth : float, optional
Width of the line for the circle around the BCS. By default, 0.3.
markersize : float, optional
Size of the center BCS marker. By default, 5.
Returns
-------
RenderControlBcs
An instance of `RenderControlBcs` configured with the specified parameters.
"""
# "ChatGPT 4o" assisted with generating this docstring.
return RenderControlBcs(color=color, marker=marker, linewidth=linewidth, markersize=markersize)
Loading

0 comments on commit 0146dab

Please sign in to comment.