Save files in-place (e.g., editing XYZ files)

There’s a new feature request

The current behavior is that “Save” is only to CML or CJSON because these formats retain the most information and export to XYZ, etc. involve information loss. So you need to “Export” to these formats.

The feature request is to change the “save” behavior to allow writing to XYZ etc. formats e.g. if the user picks “Export” it would write directly to file.xyz instead of forcing the export dialog.

I’m on the fence. I understand the use case, but the number of people writing to XYZ and other formats and then being confused that bonds or formal charges, etc. are not retained was the whole reason for this change in Avo2.

Thoughts?

I just went through the request discussion. One thing I resonate with this issue is avogardro not retaining the path where it’s currently run.

For eg.

$ cd Packages
$ avogadro 
# inside the avogadro gui, if I click 'open'
# it doesn't show the file under Packages but 
# instead the path of past file that has been opened. 

Follow up to this issue. On my machine, I had to give entire path of the file I need to open otherwise Avogadro throws up error of not finding.

$ ls 
orca.out
$ avogadro2 orca.out      # Error while reading file, Error opening file:orca.out
$ avogadro2 ./orca.out     # throws the same error
$ avogadro2 `pwd`/orca.out # This opens the file without issues

Below is the version I’m using, also I’m unsure if this behaviour is specific to *linux machines.

$ avogadro2 --version
Avogadroapp version:  1.102.1
Avogadrolibs version:  1.102.1
Qt version:  6.8.3

Now my stance is, I’m okay with the current save behavior since it will prevent from accidental loss of data. As mentioned by the original commenter, the export/save paths should updated to where avogadro2 is invoked. At the end this will make it easier in all the cases.

I think this is something of a different feature request. You’re asking for “if I launch avogadro2 from the terminal, please use that working directory for the default open and save paths”

I’ll have to think a little bit about how to pass “avogadro2 was called from the command line with files to open” to the UI, but that aspect shouldn’t be too hard to tweak because you can pass specific directories to the open and save dialogs. (We don’t currently, because most GUI applications intentionally use their previous open and save paths.)

1 Like