brendanjmeade / result_manager

Graphical result viewer for celeri
0 stars 0 forks source link

Add folder picker and automate read in of station files #1

Closed brendanjmeade closed 1 month ago

brendanjmeade commented 2 months ago

Use Bokeh button with tk reader example in result_manager_experiments.ipynb.

This should return the run folder name and automatically read station file and save it as a ColumnDataSource.

brendanjmeade commented 2 months ago

Try client server version that serves the main app with: bokeh serve --show result_manager.py

jploveless commented 2 months ago

This is working for 2 folders in https://github.com/brendanjmeade/result_manager/commit/3452e8176dcafcae2d3485298602e861ad542326

A few issues/things to decide:

jploveless commented 2 months ago

Another really minor issue (but sometimes confusing UX) is that, when loading a folder for the first time (doesn't seem to matter which button is clicked), the file picker shows up properly. Everything is loaded fine, but the active app is python 3.10. When loading a second folder, the python 3.10 app bounces in the Dock, and I need to manually switch to that app to bring up the file picker. If I don't see the bounce, I click the Load button again, and it gets a little confused (but ultimately loads the folder's files correctly). I don't know if there's a way to explicitly tell the file picker code to switch back and forth between apps (browser and python 3.10).

brendanjmeade commented 2 months ago

I haven't tried it yet, but here's ChatGPT's suggestion: https://chatgpt.com/share/0f9b4d83-52e9-4fac-99a6-9ff5e5d697d6

jploveless commented 2 months ago

As is, this breaks the file picker. Slightly modified (deleting root.mainloop()), it works, but it doesn't really help with bringing the file picker to the front when clicking the load button a second time. It also causes the Python 3.10 app to quit unexpectedly when I Ctrl+c in terminal to quit the bokeh server (though maybe there's a more elegant way to quit the server!)

jploveless commented 2 months ago
  • [x] I just copied the whole button loading routine, so there are now functions named load_data1 and load_data2. This isn't too elegant but it's functional. I think we could potentially just have one function and immediately copy the loaded variables stasource, segsource, and tdesource to stasource_1, segsource_1, and tdesource_1, but I'm not sure in practice how this would work. A side note is that, to make a copy of a ColumnDataSource, use stasource_2 = ColumnDataSource(stasource_1.data.copy())

I think it might be best to leave these button functions as separate entities, given how the station data is loaded into CDSs with different key names, so I'm going to check this task off.

brendanjmeade commented 1 month ago

I think this is closed for now as things are working well enough.