Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/5060.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Safely populate report-def-changed/plot-set-changed event-info
Comment thread
mkundu1 marked this conversation as resolved.
13 changes: 12 additions & 1 deletion src/ansys/fluent/core/streaming_services/events_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,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
):
Expand Down Expand Up @@ -265,12 +269,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
):
Expand All @@ -291,12 +297,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."""

Expand Down Expand Up @@ -409,7 +417,10 @@ def _construct_event_info(
solver_event = SolverEvent(event.value)
event_info_cls = EventInfoBase.derived_classes.get(solver_event)
# 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())
}
Comment thread
mkundu1 marked this conversation as resolved.
return event_info_cls(**kwargs)
Comment thread
mkundu1 marked this conversation as resolved.
Comment thread
mkundu1 marked this conversation as resolved.

def _process_streaming(
self, service, id, stream_begin_method, started_evt, *args, **kwargs
Expand Down
Loading