-
Notifications
You must be signed in to change notification settings - Fork 9
Add table operation in SweepFormula #2171
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
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 implements a minimum viable product (MVP) for the table operation in SweepFormula, allowing data to be displayed in a table format instead of the default graph view.
- Adds a new
tableoperation that can be applied to datasets - Modifies the plotting logic to display data as an editable table when the table operation is used
- Implements basic table functionality without support for advanced features like
vs,with, orandoperations
90e95b9 to
529c345
Compare
|
@timjarsky Here is a first version for playing around. If you enclose an expression in The table(s) are in a separate panel. f.e. results in two panels with two sub windows each, one with two tables and the other with two plots. One subwindow with one table and two columns. Expressions added with Also multiple datasets from a single expression result in new columns per dataset. Special case mixing: Is split into a table and a plot. If you use only tables or only plots the second window is not presented as it would contain no data. SF_DM_NORMAL display mode is supported as well. |
|
@MichaelHuth The runners work again. The failure in https://github.com/AllenInstitute/MIES/actions/runs/19199707109/job/55010723400 is our documentation check. |
|
@MichaelHuth This is working well. Please add a right-click menu option to bring the databrowser to the front, similar to what we do for the plots. Also, could you make the dimension labels on the tables more informative? Thank you. |
Why in a separate panel and not as a subwindow in the existing one? |
In the current panel as a subwindow the resulting size of the table might be two small and it could be inconvenient to use without additional elements to change the guide to adjust subwindow distribution. Also the complexity stays similar as a user can have a formula like: then this results in a plot and a table. In a single panel I would also need to reserve subwindows for each display type and remove empty ones afterwards. If you think that moving different display types to a new panel is too inflationary regarding the number windows I can wrap everything in the same panel. |
529c345 to
40341b0
Compare
I changed the table that it shows dimension labels. The dimension labels are from the data waves that are from the result in the expression in In Igor 10 for tables also tooltips work. I can retrieve the indices and the wave where the cursor is currently positioned. So it would be possible to generate some tooltip text including information present in the JSON wave note. |
40341b0 to
832c2b7
Compare
Can the tooltip show the formula which created the table column? If yes I'd say it's worth the effort. |
|
@MichaelHuth Chatted with Tim about this today. And we need to add a way for the user to C&P the sweepformula code which produced the table. So maybe add another column with just the SF code which produced the other columns? |
832c2b7 to
7289397
Compare
We can collect the formulas that lead to a certain table window in the plotter and put this in the user data of the window. I am not so convinced that adding another column is a good solution as it contains then data that is not part of the SF output. Should this output then be just a list of formulas or should it be adapted with "with" inserted? Variant 1: Variant 2: The latter would have the advantage that it can be pasted as is to a SF notebook again. @timjarsky Would a button with the "put in clipboard" functionality work as well? |
7e394f4 to
41684b4
Compare
|
@timjarsky I added a context menu entry that allows to copy the formulas that were evaluated to create the table to the clipboard. If multiple formulas are part of the table then the Also check if the tooltip is ok as it is or if it needs some more information. |
b7e25fe to
06aec05
Compare
06aec05 to
d8fcbc2
Compare
|
Playing around
creates the following plot
do? Here it looks like that the vs part is ignored. The documentation says:
Maybe this needs to also say that the vs part is ignored? Review: b8d1a0c (GUI util: Add utility function to remove all columns from a table, 2025-11-13) Code and tests look good. The commit message has which looks like an left over. If you want to have the function name in the commit message I would rephrase 7537f7e (Utils: Add function to test if a wave has dimension labels, 2025-11-18) Same comment about commit message. Code and test looks good. 2b5bf7a (SF: Add support to plotter to display data in tables, 2025-11-13) SF_TileExistingData:
95f877c (SF: Add operation table, 2025-11-14) Please prefer SFH_GetArgumentAsWave. Nice tests! 42e7286 (SF: Add tooltip information to table display, 2025-11-18) Tooltip looks great. Please use ff1025a (SF: Use only label display in table view if the wave actually has labels, 2025-11-18) Good. 1bf9405 (SF: In plotter add formulas for tables to userdata of window, 2025-11-18) Makes sense. 64ee6ae (SF: Add context menu option on SF table to copy formulas to clipboard, 2025-11-19) Yuup. b1967e6 (SF: Workaround for Igor not changing subwindow focus on right click, 2025-11-21) commit message: d8fcbc2 (SF: Add documentation for table operation to rst and ifn, 2025-11-19) Good, but see my earlier comment about |
|
As this is my PR I can't request changes. |
The part after I can of course extend the documentation to be more precise for this. |
A utility function to remove all columns from a table This is the equivalent for RemoveTracesFromGraph for plots with the base functionality.
A function to test if a wave has dimension labels The function checks by default only the first dimindex because waves with labels typically start with the first element labelled. There is an optional argument though to increase the lookup depth.
Tables introduce a second type of displaying data (after plots) to the plotter. Tables are displayed in a separate panel. Therefore in SF_PreparePlotter the plotGraphs wave that lists all window names is extended with a new row for the names of the table subwindows. The creation of plotGraphs is moved to an own getter function. The panel or window creation for SF_DM_NORMAL mode is moved to an own function SF_NewSweepFormulaBaseWindow For the equivalent of RemoveTracesFromGraph the function RemoveAllColumnsFromTable is used for tables. Since not all SubWindows prepared by SF_PreparePlotter might be used in plotting the subWindows (SF_DM_SUBWINDOWS mode) are tiled only between the windows that actually contain data after all data was plotted in SF_TileExistingData.
operation tags the output wave to hint the plotter that the data should be displayed in a table. The operation does not change the data otherwise. table(expression)
The tooltip displays a selection of properties of the data when available The properties can be set in SF_GetTableTooltipProperties The tooltip function attempts automatically to read it as string or number. Adapted plotting tests for the change that the wave in the plotter contains now always the formula as JSON wave note. (The direct result from the executor does not)
The formulas are copied with the "with" keyword if the table consists of multiple formulas.
There is a bug, where Igor does not change the focus to a subwindow when right clicked. This prevents that the clicked window name can be retrieved on the basis of the currently active window. WM suggested a workaround where the last right clicked window is stored in a window hook and then used in the menu handler. This commit implements this workaround.
That would be good. |
d8fcbc2 to
14a8bcf
Compare
|
@MichaelHuth Thanks for reassigning me. The CI looks broken, I'll fix it once the VPN works again. |


Implement a MVP
vswithandgives