From 0c5fb0f3ec5f773797fc08ec769f33e332c7dd46 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 10 Apr 2024 20:04:45 +0200 Subject: Updating documentation. --- .../advanced_topics/module_loading.md | 37 ++++++---------------- 1 file changed, 10 insertions(+), 27 deletions(-) (limited to 'docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md') diff --git a/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md b/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md index 8250382..8242a7f 100644 --- a/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md +++ b/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md @@ -1,34 +1,16 @@ -Load modules from another package -================================= +Load objects from external package +================================== -It is possible to load [GazeMovementIdentifier](../../../argaze.md/#argaze.GazeFeatures.GazeMovementIdentifier), [ScanPathAnalyzer](../../../argaze.md/#argaze.GazeFeatures.ScanPathAnalyzer), [AOIMatcher](../../../argaze.md/#argaze.GazeFeatures.AOIMatcher) or [AOIScanPathAnalyzer](../../../argaze.md/#argaze.GazeFeatures.AOIScanPathAnalyzer) modules [from another Python package](https://docs.python.org/3/tutorial/modules.html#packages). +It is possible to load pipeline step objects [from external Python package](https://docs.python.org/3/tutorial/modules.html#packages). -To do so, simply prepend the package where to find the module into the JSON configuration file: +To do so, simply prepend the package module where to find a class into the JSON configuration file. The exemple below shows how to load an external [GazeMovementIdentifier](../../../argaze.md/#argaze.GazeFeatures.GazeMovementIdentifier): ``` { ... "gaze_movement_identifier": { - "my_package.MyGazeMovementIdentifierAlgorithm": { - "specific_plugin_parameter": 0 - } - }, - ... - "scan_path_analyzers": { - "my_package.MyScanPathAnalyzerAlgorithm": { - "specific_plugin_parameter": 0 - } - } - ... - "aoi_matcher": { - "my_package.MyAOIMatcherAlgorithm": { - "specific_plugin_parameter": 0 - } - } - ... - "aoi_scan_path_analyzers": { - "my_package.MyAOIScanPathAnalyzerAlgorithm": { - "specific_plugin_parameter": 0 + "my_package.my_module.my_class": { + "my_parameter": 0 } } } @@ -45,7 +27,8 @@ import my_package # Load ArFrame with argaze.load('./configuration.json') as ar_frame: - # Print ArFrame attributes - for module, scan_path_analyzer in ar_frame.scan_path_analyzers.items(): - print('scan path analyzer type:', type(scan_path_analyzer)) + # Print gaze movement identifier type + print(type(ar_frame.gaze_movement_identifier)) ``` + +This logic would be the same for [ScanPathAnalyzer](../../../argaze.md/#argaze.GazeFeatures.ScanPathAnalyzer), [AOIMatcher](../../../argaze.md/#argaze.GazeFeatures.AOIMatcher), [AOIScanPathAnalyzer](../../../argaze.md/#argaze.GazeFeatures.AOIScanPathAnalyzer) or [GazePositionCalibrator](../../../argaze.md/#argaze.GazeFeatures.GazePositionCalibrator). \ No newline at end of file -- cgit v1.1