Skip to content

Conversation

@iboyd-ansys
Copy link
Collaborator

@iboyd-ansys iboyd-ansys commented Dec 15, 2025

The current charts functionality relies on obtaining data from CSV files written by SystemCoupling during the solve. We would like to replace the source of data with a new streaming gRPC API that SystemCoupling will support.

This PR includes a number of changes to help prepare for this:

  • Although the original implementation went some way in separating concerns, with the possibility of swapping out the CSV data source in mind, it did not go as far as it could have done.
  • Live plotting was not fully implemented, with the focus instead being on producing a static plot at the end of the solve. Some work has been done to get this to work better, based on incremental reading of the CSV files. Live plotting will be a more natural use case for streamed chart data, so this work lays the groundwork for that.
    • A new "injected command" solve_with_plot has been added.
  • Some of the data structures for the chart data and metadata have been rationalised. This will be used to inform the specification of the charting API and its protobuf definition.
  • Previously, charts were restricted to a single interface. That restriction is now lifted. A separate figure is shown for each interface.

@github-actions github-actions bot added enhancement New features or code improvements testing Involves the development of new unit/functional tests labels Dec 15, 2025
@iboyd-ansys iboyd-ansys force-pushed the feat/stream-charts-prep branch from 707ee02 to 7bf237b Compare December 15, 2025 18:53
@iboyd-ansys iboyd-ansys changed the title Feat/stream charts prep feat: charting changes to prepare for streamed data Dec 15, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 17, 2025
@iboyd-ansys iboyd-ansys force-pushed the feat/stream-charts-prep branch from a4e728b to 3ac97a1 Compare January 7, 2026 10:25
@iboyd-ansys iboyd-ansys force-pushed the feat/stream-charts-prep branch from f4f6b53 to d3554fe Compare January 14, 2026 14:09
@iboyd-ansys iboyd-ansys requested a review from Copilot January 14, 2026 14:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the charting functionality to prepare for transitioning from CSV-based data sources to a streaming gRPC API. The changes improve separation of concerns, enhance live plotting capabilities, rationalize data structures, and remove the restriction of single-interface plotting.

Changes:

  • Refactored data structures to replace component-based indexing with direct component suffixes for better streaming API compatibility
  • Enhanced live plotting implementation with improved CSV file incremental reading support
  • Added multi-interface plotting capabilities with separate figures per interface
  • Introduced protocol definitions and abstraction layers for data sources and readers

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/charts/test_plotdefinition_manager.py Updated tests to handle multiple interfaces and new data structure with transfer names
tests/charts/test_message_dipatcher.py Updated SeriesData constructor calls to include interface_name parameter
tests/charts/test_csv_chartdata.py Updated assertions to reflect component_suffix field replacing data_index and line_suffixes
src/ansys/systemcoupling/core/charts/plotter.py Split Plotter into FigurePlotter and Plotter classes to support multiple figures per interface
src/ansys/systemcoupling/core/charts/plotdefinition_manager.py Refactored to introduce SubplotManager for per-interface subplot management
src/ansys/systemcoupling/core/charts/plot_functions.py Added protocol definitions and refactored functions to support multiple interfaces with CSV suffix
src/ansys/systemcoupling/core/charts/message_dispatcher.py Replaced if-elif chain with match statement and added logging
src/ansys/systemcoupling/core/charts/live_csv_datasource.py Enhanced to handle multiple CSV files/interfaces with improved logging
src/ansys/systemcoupling/core/charts/csv_chartdata.py Simplified data initialization by removing component-based indexing logic
src/ansys/systemcoupling/core/charts/chart_datatypes.py Updated TransferSeriesInfo and SeriesData to use component_suffix and interface_name
src/ansys/systemcoupling/core/adaptor/impl/injected_commands.py Added solve_with_plot command and enhanced argument handling for multiple interfaces
examples/temp_non_sphinx/fluent_fluent.py Deleted entire example file
examples/00-systemcoupling/cht_pipe.py Added version parameters to MAPDL and Fluent launch calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iboyd-ansys iboyd-ansys force-pushed the feat/stream-charts-prep branch from 3f401b0 to b76a44e Compare January 21, 2026 17:12
@iboyd-ansys iboyd-ansys force-pushed the feat/stream-charts-prep branch from b76a44e to 31be11f Compare January 21, 2026 17:56
@iboyd-ansys iboyd-ansys requested a review from ochernuk January 21, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New features or code improvements testing Involves the development of new unit/functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants