diff --git a/doc/changelog.d/5060.fixed.md b/doc/changelog.d/5060.fixed.md new file mode 100644 index 00000000000..8a81e4c23de --- /dev/null +++ b/doc/changelog.d/5060.fixed.md @@ -0,0 +1 @@ +Safely populate report-def-changed/plot-set-changed event-info diff --git a/src/ansys/fluent/core/streaming_services/events_streaming.py b/src/ansys/fluent/core/streaming_services/events_streaming.py index e7951a4ad66..4ff8ade971f 100644 --- a/src/ansys/fluent/core/streaming_services/events_streaming.py +++ b/src/ansys/fluent/core/streaming_services/events_streaming.py @@ -203,20 +203,24 @@ class IterationEndedEventInfo(EventInfoBase, event=SolverEvent.ITERATION_ENDED): index: int +@dataclass class CalculationsStartedEventInfo( EventInfoBase, event=SolverEvent.CALCULATIONS_STARTED ): """Information about the event triggered when calculations are started.""" +@dataclass class CalculationsEndedEventInfo(EventInfoBase, event=SolverEvent.CALCULATIONS_ENDED): """Information about the event triggered when calculations are ended.""" +@dataclass class CalculationsPausedEventInfo(EventInfoBase, event=SolverEvent.CALCULATIONS_PAUSED): """Information about the event triggered when calculations are paused.""" +@dataclass class CalculationsResumedEventInfo( EventInfoBase, event=SolverEvent.CALCULATIONS_RESUMED ): @@ -275,12 +279,14 @@ class DataLoadedEventInfo(EventInfoBase, event=SolverEvent.DATA_LOADED): data_file_name: str = field(metadata=dict(deprecated_name="datafilepath")) +@dataclass class AboutToInitializeSolutionEventInfo( EventInfoBase, event=SolverEvent.ABOUT_TO_INITIALIZE_SOLUTION ): """Information about the event triggered just before solution is initialized.""" +@dataclass class SolutionInitializedEventInfo( EventInfoBase, event=SolverEvent.SOLUTION_INITIALIZED ): @@ -301,12 +307,14 @@ class ReportPlotSetUpdatedEventInfo( """Information about the event triggered when a report plot set is updated.""" +@dataclass class ResidualPlotUpdatedEventInfo( EventInfoBase, event=SolverEvent.RESIDUAL_PLOT_UPDATED ): """Information about the event triggered when residual plots are updated.""" +@dataclass class SettingsClearedEventInfo(EventInfoBase, event=SolverEvent.SETTINGS_CLEARED): """Information about the event triggered when settings are cleared.""" @@ -428,7 +436,10 @@ def _construct_event_info( if self._server_supports_v1 and not event_info_dict: return event_info_cls() # Key names can be different, but their order is the same - return event_info_cls(*event_info_dict.values()) + kwargs = { + f.name: v for f, v in zip(fields(event_info_cls), event_info_dict.values()) + } + return event_info_cls(**kwargs) def _process_streaming( self, service, id, stream_begin_method, started_evt, *args, **kwargs