-
Notifications
You must be signed in to change notification settings - Fork 9
SF: Split formula evaluation and plotting in SF plotter #2586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
56ba8c5 to
aee3efd
Compare
1cc4c38 to
00e5efa
Compare
aee3efd to
4915ea5
Compare
4915ea5 to
1c6f1c4
Compare
t-b
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New code LGTM. Needs conflict resolution though.
Prevents unnecessary iteration if deep > dimension size
00e5efa to
aa4c8ac
Compare
There was a problem hiding this 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 SweepFormula plotter to separate formula evaluation from plotting logic, improving code organization and maintainability. The change replaces a struct-based approach for plot metadata with a wave-based approach, enabling better separation of concerns between evaluation and display phases.
Key Changes:
- Extracted formula evaluation into new function
SF_PlotterGetDataFromFormulas()that pre-evaluates all formulas before plotting - Converted
SF_PlotMetaDatastruct to text wave with dimension labels for plot metadata storage - Updated error handling to collect errors during evaluation and abort at the end if any occurred
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Packages/MIES/MIES_Structures.ipf | Removed obsolete SF_PlotMetaData structure definition |
| Packages/MIES/MIES_WaveDataFolderGetters.ipf | Added wave getter functions for SF plot metadata and data organization |
| Packages/MIES/MIES_SweepFormula.ipf | Refactored plotter with new evaluation function, converted struct access to wave indexing, improved error handling, fixed typos |
| Packages/MIES/MIES_SweepFormula_PSX.ipf | Updated function signatures to use wave-based metadata instead of struct |
| Packages/MIES/MIES_Utilities_WaveHandling.ipf | Fixed comment typo, added safety check for deep parameter |
| Packages/MIES/MIES_GuiUtilities.ipf | Added null check and non-existent window handling to GetAllWindows function |
| Packages/tests/Basic/UTF_GuiUtilities.ipf | Added comprehensive tests for GetAllWindows function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ull string Add tests
Formula evaluation was splitted from plotting and is now done in a separate function before the plotting loop is run. The formula and meta data results are gathered in that function. The structure PlotMetaData was removed as it can not be saved in an indexable wave. It was replaced by a text wave. The function that evaluated the formulas catches evaluation errors and returns an error code. If this error code is set, then SFH_ASSERT has stored error related information. However, we want to display already formulas that are correct in plots. The evaluation does not add results for formulas that errored out. Thus, the plotting loop runs, but does not include results where the formula evaluation had an error. After the loop ran, an Abort is triggered if there was an evaluation error such that the outer catch can handle error output and notebook modification. This also allows the plotter loop to use SFH_ASSERT. The behavior change is that only the last evaluation error is shown, whereas before the first evaluation error was shown.
aa4c8ac to
767c569
Compare
|
Failing CI. |
|
The reason for the fail is: where in main psx(...) gets evaluated then With the changed the evaluation is done first, such that
I think this prevents generally to split off the evaluation now from displaying the data in the plotter. Considering that this should prepare the plotter for operations with plotting "instructions", the way would be to incrementally build up the output panel with subsequently adding plot subwindows. |
|
Thanks for digging. What would then be the way forward? |
|
From the top of my head. We could delay running |
|
Delaying the plotting of I first thought I move the storage for the psx working DF from the plot window to the data browser window (as far as I tested multiple psx plots separated by So instead of trying to make PSX work with splitting evaluation and plotting I now think that currently a feasible way is to change the plotter that it also creates the plot/table subwindows dynamically. Such that there is always an evaluation step and a plotting step (if the evaluation yielded results). The plotting adds then a new subwindow and everything is tiled at the end. Logically this means that I pull the window / guide creation and plotGraphs wave filling in the loop that parses the formulas. |
Sounds good! |
|
This PR is replaced by #2592 |
Part of #2581