diff --git a/opencsp/common/lib/cv/SpotAnalysis.py b/opencsp/common/lib/cv/SpotAnalysis.py index 808a045b0..054b19d5b 100644 --- a/opencsp/common/lib/cv/SpotAnalysis.py +++ b/opencsp/common/lib/cv/SpotAnalysis.py @@ -15,7 +15,7 @@ from opencsp.common.lib.cv.spot_analysis.ImagesStream import ImagesStream from opencsp.common.lib.cv.spot_analysis.SpotAnalysisImagesStream import SpotAnalysisImagesStream from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperable import SpotAnalysisOperable -from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperablesStream import SpotAnalysisOperablesStream +from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperablesStream import _SpotAnalysisOperablesStream from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperableAttributeParser import SpotAnalysisOperableAttributeParser import opencsp.common.lib.render.VideoHandler as vh import opencsp.common.lib.opencsp_path.opencsp_root_path as orp @@ -183,7 +183,7 @@ def __init__( on the first call to process_next(). """ self._prev_result: SpotAnalysisOperable = None """ The previously returned result. """ - self.input_stream: SpotAnalysisOperablesStream = None + self.input_stream: _SpotAnalysisOperablesStream = None """ The images to be processed. """ self.save_dir: str = save_dir """ If not None, then primary images will be saved to the given @@ -237,8 +237,8 @@ def _images2stream( return ImagesIterable(images) def _assign_inputs(self, input_operables: Iterator[SpotAnalysisOperable]): - if not isinstance(input_operables, SpotAnalysisOperablesStream): - input_operables = SpotAnalysisOperablesStream(input_operables) + if not isinstance(input_operables, _SpotAnalysisOperablesStream): + input_operables = _SpotAnalysisOperablesStream(input_operables) self.input_stream = input_operables self._prev_result = None self.image_processors[0].assign_inputs(self.input_stream) @@ -257,10 +257,11 @@ def set_primary_images(self, images: list[str] | list[np.ndarray] | vh.VideoHand See also: set_input_operables()""" primary_images = self._images2stream(images) images_stream = SpotAnalysisImagesStream(primary_images, {}) - self._assign_inputs(SpotAnalysisOperablesStream(images_stream)) + self._assign_inputs(_SpotAnalysisOperablesStream(images_stream)) def set_input_operables( - self, input_operables: SpotAnalysisOperablesStream | list[SpotAnalysisOperable] | Iterator[SpotAnalysisOperable] + self, + input_operables: _SpotAnalysisOperablesStream | list[SpotAnalysisOperable] | Iterator[SpotAnalysisOperable], ): """Assigns primary and supporting images, and other necessary data, in preparation for process_next(). diff --git a/opencsp/common/lib/cv/spot_analysis/SpotAnalysisOperablesStream.py b/opencsp/common/lib/cv/spot_analysis/SpotAnalysisOperablesStream.py index 9894c21df..016425ec7 100644 --- a/opencsp/common/lib/cv/spot_analysis/SpotAnalysisOperablesStream.py +++ b/opencsp/common/lib/cv/spot_analysis/SpotAnalysisOperablesStream.py @@ -9,8 +9,12 @@ from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperable import SpotAnalysisOperable -class SpotAnalysisOperablesStream(Iterator[SpotAnalysisOperable]): +class _SpotAnalysisOperablesStream(Iterator[SpotAnalysisOperable]): """ + This class is meant for internal use. Users of the SpotAnalysis class or + SpotAnalysisImageProcessor classes should not need to know the mechanics of + this class. + A stream that accepts images as input and provides SpotAnalysisOperables as output. This stream can be set up with default values for supporting images or other diff --git a/opencsp/common/lib/cv/spot_analysis/image_processor/AbstractSpotAnalysisImageProcessor.py b/opencsp/common/lib/cv/spot_analysis/image_processor/AbstractSpotAnalysisImageProcessor.py index e44e0b563..a1aceb04b 100644 --- a/opencsp/common/lib/cv/spot_analysis/image_processor/AbstractSpotAnalysisImageProcessor.py +++ b/opencsp/common/lib/cv/spot_analysis/image_processor/AbstractSpotAnalysisImageProcessor.py @@ -12,7 +12,7 @@ from opencsp.common.lib.cv.spot_analysis.ImagesIterable import ImagesIterable from opencsp.common.lib.cv.spot_analysis.ImagesStream import ImagesStream from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperable import SpotAnalysisOperable -from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperablesStream import SpotAnalysisOperablesStream +from opencsp.common.lib.cv.spot_analysis.SpotAnalysisOperablesStream import _SpotAnalysisOperablesStream from opencsp.common.lib.cv.spot_analysis.SpotAnalysisImagesStream import SpotAnalysisImagesStream import opencsp.common.lib.opencsp_path.opencsp_root_path as orp import opencsp.common.lib.tool.file_tools as ft @@ -265,7 +265,7 @@ def run( if isinstance(operables, (ImagesIterable, ImagesStream)): operables = SpotAnalysisImagesStream(operables) if isinstance(operables, SpotAnalysisImagesStream): - operables = SpotAnalysisOperablesStream(operables) + operables = _SpotAnalysisOperablesStream(operables) self.assign_inputs(operables) ret = [result for result in self] return ret