Skip to content

Commit

Permalink
opencsp/common/lib/opencsp_path: test docs
Browse files Browse the repository at this point in the history
  • Loading branch information
e10harvey committed Nov 11, 2024
1 parent fb53b45 commit e75847e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
24 changes: 24 additions & 0 deletions opencsp/common/lib/opencsp_path/data_path_for_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,32 @@ def __sandia_nsttf_test_definition_dir():


def sandia_nsttf_test_heliostats_origin_file():
"""
Returns the path to the heliostats origin file for the Sandia NSTTF tests.
This file contains data regarding the origin positions of heliostats at the Sandia
National Solar Thermal Test Facility.
Returns
-------
str
The path to the heliostats origin file.
"""
# "ChatGPT 4o" assisted with generating this docstring.
return os.path.join(__sandia_nsttf_test_definition_dir(), 'NSTTF_Heliostats_origin_at_torque_tube.csv')


def sandia_nsttf_test_facet_centroidsfile():
"""
Returns the path to the facet centroids file for the Sandia NSTTF tests.
This file contains data regarding the centroids of facets at the Sandia National
Solar Thermal Test Facility.
Returns
-------
str
The path to the facet centroids file.
"""
# "ChatGPT 4o" assisted with generating this docstring.
return os.path.join(__sandia_nsttf_test_definition_dir(), 'NSTTF_Facet_Centroids.csv')
8 changes: 8 additions & 0 deletions opencsp/test/test_DocStringsExist.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import opencsp.common.lib.geometry.ReferenceFrame as ReferenceFrame
import opencsp.common.lib.geometry.TranslationXYZ as TranslationXYZ
import opencsp.common.lib.geometry.matrix_geometry_3d as matrix_geometry_3d
import opencsp.common.lib.opencsp_path.optical_analysis_data_path as optical_analysis_data_path


def test_docstrings_exist_for_methods():
Expand Down Expand Up @@ -208,6 +209,12 @@ def test_docstrings_exist_for_methods():
opencsp.common.lib.geometry.transform_3d,
]

opencsp_path_class_list = [
opencsp.common.lib.opencsp_path.data_path_for_test,
opencsp.common.lib.opencsp_path.opencsp_root_path,
opencsp.common.lib.opencsp_path.optical_analysis_data_path,
]

common_class_list = (
camera_class_list
+ csp_class_list
Expand All @@ -216,6 +223,7 @@ def test_docstrings_exist_for_methods():
+ file_class_list
+ geo_class_list
+ geometry_class_list
+ opencsp_path_class_list
)

class_list = app_class_list + common_class_list
Expand Down

0 comments on commit e75847e

Please sign in to comment.