Skip to content

Commit

Permalink
Fix test, add Vxy class docs
Browse files Browse the repository at this point in the history
  • Loading branch information
e10harvey committed Nov 11, 2024
1 parent 767739b commit cbfd021
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 23 additions & 0 deletions opencsp/common/lib/geometry/Vxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@


class Vxy:
"""
A class to represent 2D points or vectors.
This class allows for the creation and manipulation of 2D vectors,
including operations such as addition, subtraction, scaling,
normalization, rotation, and dot/cross products.
The vectors can be initialized from various data formats, including
NumPy arrays, tuples, lists, or other instances of the Vxy class.
Attributes
----------
data : np.ndarray
An array with shape (2, N), where N is the number of 2D vectors.
dtype : np.dtype
The data type of the vector elements.
x : np.ndarray
The x-coordinates of the vectors.
y : np.ndarray
The y-coordinates of the vectors.
"""

# "ChatGPT 4o-mini" assisted with generating this docstring.
def __init__(self, data: Union[np.ndarray, tuple[float, float], tuple[list, list], "Vxy"], dtype=float):
"""
2D vector class to represent 2D points/vectors.
Expand Down
2 changes: 0 additions & 2 deletions opencsp/test/test_DocStringsExist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from opencsp.app.camera_calibration.lib.ViewAnnotatedImages import ViewAnnotatedImages
from opencsp.app.sofast.SofastGUI import SofastGUI
from opencsp.app.sofast.lib import *
from opencsp.app.sofast.lib.visualize_setup import visualize_setup

# from opencsp.app.target.target_color.target_color_2d_gradient import target_color_2d_gradient
import opencsp.app.target.target_color.target_color_bullseye_error as target_color_bullseye_error
Expand Down Expand Up @@ -39,7 +38,6 @@ def test_docstrings_exist_for_methods():
opencsp.app.sofast.lib.DistanceOpticScreen.DistanceOpticScreen,
opencsp.app.sofast.lib.DotLocationsFixedPattern.DotLocationsFixedPattern,
SofastGUI,
visualize_setup,
opencsp.app.sofast.lib.Fringes.Fringes,
opencsp.app.sofast.lib.ImageCalibrationAbstract.ImageCalibrationAbstract,
opencsp.app.sofast.lib.ImageCalibrationGlobal.ImageCalibrationGlobal,
Expand Down

0 comments on commit cbfd021

Please sign in to comment.