diff --git a/src/mlpro/bf/streams/tasks/deriver.py b/src/mlpro/bf/streams/tasks/deriver.py index 4c06db29e..c4cf43d31 100644 --- a/src/mlpro/bf/streams/tasks/deriver.py +++ b/src/mlpro/bf/streams/tasks/deriver.py @@ -8,10 +8,11 @@ ## -- 2023-02-02 0.0.0 SY Creation ## -- 2023-02-05 1.0.0 SY First version release ## -- 2024-05-10 1.0.1 DA/SY Bugfix in Deriver.__init__() +## -- 2024-05-22 1.1.0 DA Refactoring ## ------------------------------------------------------------------------------------------------- """ -Ver. 1.0.1 (2024-05-10) +Ver. 1.1.0 (2024-05-22) This module provides a stream task class Deriver to derive the data of instances. """ @@ -21,7 +22,7 @@ from mlpro.bf.various import Log from mlpro.bf.mt import Task from mlpro.bf.math import Set, Element -from mlpro.bf.streams import Instance, StreamTask, Feature, Label +from mlpro.bf.streams import Instance, InstDict, StreamTask, Feature, Label from mlpro.bf.physics import TransferFunction import numpy as np @@ -61,8 +62,8 @@ class Deriver(StreamTask): Further optional named parameters. """ - C_NAME = 'Deriver' - C_PLOT_STANDALONE = True + C_NAME = 'Deriver' + C_PLOT_STANDALONE = True ## ------------------------------------------------------------------------------------------------- def __init__( self, @@ -174,13 +175,11 @@ def _derive_data(self, p_inst:Instance): ## ------------------------------------------------------------------------------------------------- - def _run(self, p_inst_new: set, p_inst_del: set): + def _run(self, p_inst : InstDict ): - for inst in p_inst_new: + for (inst_type,inst) in sorted(p_inst.values()): self._derive_data(p_inst=inst) - for inst in p_inst_del: - self._derive_data(p_inst=inst) diff --git a/test/howtos/bf/howto_bf_streams_102_tasks_workflows_and_stream_scenarios.py b/test/howtos/bf/howto_bf_streams_102_tasks_workflows_and_stream_scenarios.py index 9d5081fbf..67e4d916c 100644 --- a/test/howtos/bf/howto_bf_streams_102_tasks_workflows_and_stream_scenarios.py +++ b/test/howtos/bf/howto_bf_streams_102_tasks_workflows_and_stream_scenarios.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_streams_001_tasks_workflows_and_stream_scenarios.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_streams_110_stream_task_window.py b/test/howtos/bf/howto_bf_streams_110_stream_task_window.py index 1fcf55058..c3cff197c 100644 --- a/test/howtos/bf/howto_bf_streams_110_stream_task_window.py +++ b/test/howtos/bf/howto_bf_streams_110_stream_task_window.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_streams_110_stream_task_window.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_streams_111_stream_task_rearranger_2d.py b/test/howtos/bf/howto_bf_streams_111_stream_task_rearranger_2d.py index 179b9020a..9be70ca4a 100644 --- a/test/howtos/bf/howto_bf_streams_111_stream_task_rearranger_2d.py +++ b/test/howtos/bf/howto_bf_streams_111_stream_task_rearranger_2d.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_streams_111_stream_task_rearranger_2d.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_streams_112_stream_task_rearranger_3d.py b/test/howtos/bf/howto_bf_streams_112_stream_task_rearranger_3d.py index 8c4863bb5..83e424783 100644 --- a/test/howtos/bf/howto_bf_streams_112_stream_task_rearranger_3d.py +++ b/test/howtos/bf/howto_bf_streams_112_stream_task_rearranger_3d.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_streams_112_stream_task_rearranger_3d.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_streams_113_stream_task_rearranger_nd.py b/test/howtos/bf/howto_bf_streams_113_stream_task_rearranger_nd.py index 56743ac46..38425228f 100644 --- a/test/howtos/bf/howto_bf_streams_113_stream_task_rearranger_nd.py +++ b/test/howtos/bf/howto_bf_streams_113_stream_task_rearranger_nd.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_streams_113_stream_task_rearranger_nd.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_streams_114_stream_task_deriver.py b/test/howtos/bf/howto_bf_streams_114_stream_task_deriver.py index 4448e7550..fafd92cd4 100644 --- a/test/howtos/bf/howto_bf_streams_114_stream_task_deriver.py +++ b/test/howtos/bf/howto_bf_streams_114_stream_task_deriver.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_streams_114_stream_task_deriver.py ## ------------------------------------------------------------------------------------------------- @@ -50,7 +50,7 @@ class MyTask (StreamTask): C_NAME = 'Custom' ## ------------------------------------------------------------------------------------------------- - def _run(self, p_inst_new: list, p_inst_del: list): + def _run(self, p_inst: InstDict): pass @@ -82,7 +82,7 @@ def _setup(self, p_mode, p_visualize: bool, p_logging): features = stream.get_feature_space().get_dims() features_new = [ ( 'F', features[0:1] ) ] - task_rearranger = Rearranger( p_name='t1', + task_rearranger = Rearranger( p_name='T1 - Rearranger', p_range_max=Task.C_RANGE_THREAD, p_visualize=p_visualize, p_logging=p_logging, @@ -94,7 +94,7 @@ def _setup(self, p_mode, p_visualize: bool, p_logging): features = task_rearranger._feature_space.get_dims() derived_feature = features[0] - task_deriver_1 = Deriver( p_name='t2', + task_deriver_1 = Deriver( p_name='T2 - Deriver 1', p_range_max=Task.C_RANGE_THREAD, p_visualize=p_visualize, p_logging=p_logging, @@ -110,7 +110,7 @@ def _setup(self, p_mode, p_visualize: bool, p_logging): features = task_deriver_1._feature_space.get_dims() derived_feature = features[0] - task_deriver_2 = Deriver( p_name='t3', + task_deriver_2 = Deriver( p_name='T3 - Deriver 2', p_range_max=Task.C_RANGE_THREAD, p_visualize=p_visualize, p_logging=p_logging, @@ -155,6 +155,8 @@ def _setup(self, p_mode, p_visualize: bool, p_logging): if __name__ == '__main__': myscenario.init_plot( p_plot_settings=PlotSettings( p_view = PlotSettings.C_VIEW_ND, p_view_autoselect = False, + p_plot_horizon = 50, + p_data_horizon = 100, p_step_rate = 2 ) ) input('Press ENTER to start stream processing...') diff --git a/test/howtos/bf/howto_bf_systems_001_demonstrating_native_systems.py b/test/howtos/bf/howto_bf_systems_001_demonstrating_native_systems.py index a6b4defdc..99e487835 100644 --- a/test/howtos/bf/howto_bf_systems_001_demonstrating_native_systems.py +++ b/test/howtos/bf/howto_bf_systems_001_demonstrating_native_systems.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_systems_001.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_systems_010_systems_controllers_actuators_sensors.py b/test/howtos/bf/howto_bf_systems_010_systems_controllers_actuators_sensors.py index 02f0cf466..17b839a11 100644 --- a/test/howtos/bf/howto_bf_systems_010_systems_controllers_actuators_sensors.py +++ b/test/howtos/bf/howto_bf_systems_010_systems_controllers_actuators_sensors.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_systems_010_systems_controllers_actuators_sensors.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_systems_021_multisystem_flipflop.py b/test/howtos/bf/howto_bf_systems_021_multisystem_flipflop.py index 3dc08b5e6..472199d0f 100644 --- a/test/howtos/bf/howto_bf_systems_021_multisystem_flipflop.py +++ b/test/howtos/bf/howto_bf_systems_021_multisystem_flipflop.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_systems_021_multisystem_flipflop.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_systems_030_adaptive_double_pendulum_sytem.py.off b/test/howtos/bf/howto_bf_systems_030_adaptive_double_pendulum_sytem.py.off index 810c07180..4a728bbdb 100644 --- a/test/howtos/bf/howto_bf_systems_030_adaptive_double_pendulum_sytem.py.off +++ b/test/howtos/bf/howto_bf_systems_030_adaptive_double_pendulum_sytem.py.off @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_systems_030_adaptive_double_pendulum_system.py ## ------------------------------------------------------------------------------------------------- diff --git a/test/howtos/bf/howto_bf_ui_001_reuse_of_interactive_2d_3d_input_space.py b/test/howtos/bf/howto_bf_ui_001_reuse_of_interactive_2d_3d_input_space.py index c0ac5fb9b..fe1c1ee18 100644 --- a/test/howtos/bf/howto_bf_ui_001_reuse_of_interactive_2d_3d_input_space.py +++ b/test/howtos/bf/howto_bf_ui_001_reuse_of_interactive_2d_3d_input_space.py @@ -1,5 +1,5 @@ ## ------------------------------------------------------------------------------------------------- -## -- Project : MLPro - A Synoptic Framework for Standardized Machine Learning Tasks +## -- Project : MLPro - The integrative middleware framework for standardized machine learning ## -- Package : mlpro.bf.examples ## -- Module : howto_bf_ui_001_reuse_of_interactive_2d_3d_input_space.py ## -------------------------------------------------------------------------------------------------