MSS icon indicating copy to clipboard operation
MSS copied to clipboard

Add config & CLI support for .ftml path in mssautoplot

Open annapurna-gupta opened this issue 8 months ago • 3 comments

Fixes #2714

annapurna-gupta avatar May 06 '25 17:05 annapurna-gupta

Let’s also make sure we save the file path in mssautoplot.json. We can just use self.last_save_directory for this; no need to create a new default.

ReimarBauer avatar May 11 '25 10:05 ReimarBauer

the autoplot dockingwidget still does not save a path into the json configuration for the filenames, see https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/autoplot_dockwidget.py#L318 The filenames can be stored on different directories. In the json file we need the file location, not only the names.

ReimarBauer avatar May 23 '25 12:05 ReimarBauer

the autoplot dockingwidget still does not save a path into the json configuration for the filenames, see https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/autoplot_dockwidget.py#L318 The filenames can be stored on different directories. In the json file we need the file location, not only the names.

I'm currently working on the CLI version of autoplot (not the GUI-based autoplot_dockwidget). My changes are focused on command-line behavior, so they won't affect or fix the GUI behavior related to JSON path saving? or am i missing something?

annapurna-gupta avatar May 23 '25 19:05 annapurna-gupta

Hii @ReimarBauer I’ve added the path for the .ftml file like this:

if filename and not os.path.isabs(filename): default_dir = os.path.join(os.path.expanduser("~"), ".config", "msui") filename = os.path.join(default_dir, filename)

But I think it’s not working as expected — the file still isn’t being found. Could you please help me check if I’m missing something?

annapurna-gupta avatar May 25 '25 16:05 annapurna-gupta

Hii @ReimarBauer I’ve added the path for the .ftml file like this:

if filename and not os.path.isabs(filename): default_dir = os.path.join(os.path.expanduser("~"), ".config", "msui") filename = os.path.join(default_dir, filename)

But I think it’s not working as expected — the file still isn’t being found. Could you please help me check if I’m missing something?

When configuring the new mssautoplot.json, we should mirror the behavior of existing configurations regarding file paths. Specifically, the path used to store an FTML file should be relative to the user's designated storage location. For example, if a user saves an FTML file as /Users/reimarbauer/FTML/example.ftml, the new configuration should reflect this same path. This consistency is important because sharing my mssautoplot.json necessitates also sharing the corresponding FTML file – and knowing the storage location ensures I can easily identify the correct one among potentially many examples.

Please implement the functionality for the autoplot docking widget https://github.com/Open-MSS/MSS/blob/develop/mslib/msui/autoplot_dockwidget.py to save the FTML path/file before proceeding with CLI improvements.

ReimarBauer avatar May 26 '25 20:05 ReimarBauer

Hii @ReimarBauer I noticed that running: mssautoplot --cpath ~/.config/msui/mssautoplot.json gives resource 'example_flight.ftml' not found but this works: mssautoplot --cpath ~/.config/msui/mssautoplot.json --ftml-path /home/anuu/.config/msui/example_flight.ftml

annapurna-gupta avatar Jun 23 '25 07:06 annapurna-gupta

Hii @ReimarBauer I noticed that running: mssautoplot --cpath ~/.config/msui/mssautoplot.json gives resource 'example_flight.ftml' not found but this works: mssautoplot --cpath ~/.config/msui/mssautoplot.json --ftml-path /home/anuu/.config/msui/example_flight.ftml

Please share the section of your mssautoplot.json for

"automated_plotting_flights": [],
"automated_plotting_hsecs": [],
"automated_plotting_vsecs": [],
"automated_plotting_lsecs": []

ReimarBauer avatar Jun 23 '25 08:06 ReimarBauer