Add ability to refresh/update existing Variable Explorer windows to reflect current variable state
Hello, when you click on a variable in the variable explorer you get a new window from the variable and it's content (see pic1.png). At the moment these small windows will not be updated when the variable changes. In some cases it is really usefull to compare values, but sometimes it would be nice when the windows will be updated. For this i propose if there is a checkbox which is by default unchecked, but when you check the checkbox, the content of the window will be updated. Is something like that possible to make?


Thanks for the suggestion. We'll try to implement this in a future release.
Thank you!
Agreed, this would definitely be a very useful feature and something I've thought about as well, though would take at least some backend work to implement. Also, from a UI perspective, It would probably be easiest and most straightforward to stick the button bottom left.
Absolutely loved this in the old Linux build I used
Adding my support for this feature to be added in the future! Thanks
Btw a huge thanks to the entire team that updates and maintains Spyder!
Thanks for your kind words @rpinto73!
Yes!! This would be super useful
Would love to see this.
Still doesn't exist, right? That would be quite useful for me.
Will add my upvote. Adding this functionality would be great. Thank you for maintaining Spyder.
Will add my upvote too for such a feature. Coming from a Stata background, autorefreshing is key for understanding the data. Given the comment of a user here, users switch to other programs like Sublime due to such an issue. Perhaps implementation could start with smaller dataframes, if a concern is the processing power an autorefresh function would use up?
This would be incredibly helpful
Will add my upvote too for such a feature. Coming from a Stata background, autorefreshing is key for understanding the data. Given the comment of a user here, users switch to other programs like Sublime due to such an issue. Perhaps implementation could start with smaller dataframes, if a concern is the processing power an autorefresh function would use up?
@EdSaiedi I don't think Sublime can do it, think he is just saying he will stick with Sublime and print to console.
Have you had any luck finding an alternative? Thanks
I would also like the global setting for all these windows. Most of the time I would like them to be autorefreshed but sometimes I need to compare values for different runs.
Unfortunately, we can't make this work automatically because it'd consume a lot of memory. Every operation that shows a variable in one of our specialized viewers involves making a copy of it. That copy is cleared once users close the viewer.
But if viewers are maintained opened and they're being updated after every code execution, the memory consumed by Spyder can skyrocket quite quickly, especially for large variables.
So, I think the best we can do is to add a refresh button to our viewers, so users can update them on demand. We'll try to do that in the future.
Understood Carlos, the refresh button would be a fantastic addition, thank you
This would be a very useful feature, i.e. allowing only one open view per variable and updating that variable as code gets executed rather than pressing refresh.
@bajhuman, please read my previous comment: that can't be done because it'll increase the memory consumed by Spyder without limit.
I made a prototype in order to get an idea of what is involved. In the video, I define an array arr, open an array editor, give the command arr = numpy.flipud(arr) (which flips the array upside down) and then refresh the array editor.
https://github.com/spyder-ide/spyder/assets/7941918/6076c735-01c2-4234-bd61-77320719deaa
Feel free to comment on the UI/UX. Note that the command arr = numpy.flipud(arr) does not mutate the array but it assigns the variable to a new array. I think that users will expect the array editor to show the new array, but let me know if you disagree.
My code does work, but it is easy to break (this is a MVP for a very low value of V). This is going to be more work than I had thought. These situations are currently not handled (and probably more):
- collection, object or dataframe editors
- arrays nested in other objects
- changing the type of the variable or deleting it
- changing a normal array to a record, masked, or 3d or vice versa
- changing the number of rows or columns
- changing the maximum or minimum value in the array
- editing the array in the editor and then refreshing it