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
Windows 10, Run... does not work #5
Comments
Try out the absolute most recent code. The "Save results in" field should be automatically populated with the same path as in the "Run calculations in" field under Recent changes to Avogadro means the script can't currently automatically find the Open Babel binary. My recent commit adjusted things so that menu options that need Open Babel won't be displayed if the plugin can't find the binary, so if you use the latest code the You'll have to set the path to
It's because |
I tried with todays Nightly of avogadro2 and todays avo-xtb, but I can't even get the plugin running, i.e. no menues are shown. The files from the Avogadro2 Plugin-Manager do load but they seem to be an old version of avo-xtb with the menues still having no elipses. So testing may take a while. |
I found the problem. It was to do with the formatting of the version number in
Yes, the version available in the plugin manager is still at 0.2. At the moment, new releases of plugins aren't automatically fetched, Geoff has to refresh the cache manually. I will ask him to do that (to make 0.3 available) as soon as we've got it working on your system. |
Ok, plugin works again, but Run... still doesn't work, even when using TurboMole coordinates. The "Save results in" field and the "Run calculations in" field are still empty by default. If I use TurboMole coordinates and this code in run.py, at least everything works as it should:
With this change in place, XYZ-coordinates still do not work, albeit the correct obabel version was found and sucessfully called, as can be seen in the log file. The input.xyz is still zero bytes.
I checked the command in convert.py : line 58, but it seems to be correct: |
The "Save results in:" field gets, at least in theory, populated by Avogadro with the value of You shouldn't start the calculation from the Run... window without making sure that field is populated with some directory.
|
Sorry for the late reply. Last days were very busy.
|
Thanks, and no worries, it's not very time critical. On the basis of 2 and 4, it looks like the problem is conversion to and from The thing is it kind of has to be this way in order to allow for periodic systems. I'll see if I can implement manual conversion of cjson to xyz so that Open Babel isn't needed if tmol wasn't turned on. It will still be broken if tmol is turned on, but at least it would be half of the problem solved. |
OK, I found the culprit. It's the input.tmol file. I had a look at it with a hex editor.
Removing the empty lines manually solves the conversion problem. |
Always those pesky newlines! That's very useful, well spotted. Quite odd though. It's not just saving the file with the wrong line endings, something is adding extra ones. Critically, I don't get why that should only apply to tmol and not other formats – I'll raise that with Geoff. Related to that, would you do me one more favour? When you run e.g. an optimization, what are the line endings in the I suspect the problem arises when the tmol file is passed as a string from Avogadro to the plugin, as the file is passed as a string and I guess uses your native line endings within the string, i.e. I can think of two simple fixes, either to remove any By the way, macOS also uses |
Line Endings are "\r\n", as expected. |
Yeah ok, looks like Avogadro is inconsistent then and I guess maybe it's to do with whether Avogadro uses Open Babel to prepare the input geometry or not. I'll raise it on the forum. The commits I made yesterday should hopefully fix the problems you describe here? If they do I'll close this issue. |
I tried run using tmol format.
I assume, it's
After these two fixes, run works with tmol format. I tried run without tmol format. I get the following error message because the last/input.xyz is empty - 0 bytes. (Also it's the only file in last/.)
The complete log since running the avo_xtb plugin is:
|
Yep, that was a stupid error, fixed it.
Ok, good that it works with that fix. That's a bug with Avogadro though so I opened an issue for it. I don't think it makes sense to implement a hot-fix for it – it leads to inconsistent behaviour from the user's point of view. The user-facing behaviour would be the same even if I added the fix i.e. the field is empty, so the user won't have any idea that the fix is in place, it will still appear broken. I'll see if I can fix the issue in Avogadro though. I already solved the same problem once. Interestingly my own build of Avogadro doesn't suffer the same issue. Are you running the nightly build of Avo?
Fixed. I checked with opt and run, with tmol and xyz, and everything works fine for me now. Let me know if it does for you too (when you add your fix at |
Works beautifully now. With and without tmol coordinates.
I am running today's Nightly.
I'm not sure I get what you are saying. ATM, the bug in Avogadro is that it gobbles up the save path, so the field is empty. Indeed, this should be fixed in Avogadro itself. But imagine, a user is not interested anymore in using their own path and wants to empty the field. Should they be expected to look up what the default directory is and enter it manually ? Should the script fail without warning if the field is empty ? IMHO the most sensible meaning of an empty path should be the default directory for computation. That the script is then also working despite Avogadro's bug is a bonus. In no case should we try to copy to a directory based on an empty string. That's like relying on undefined behaviour. |
I'm glad that it works well now. Since the original issue was solved, I'll close this.
Having thought about it somewhat I think I do agree with you, but I think for different reasons. Just to clarify what's going on: Every calculation is always run, and the results are generated, in The copying doesn't need to happen unless the user asked for it. So if anything, what should happen if that field is an empty string, is the same as if it is left as the if not (avo_input["save_dir"] in ["", None] or Path(avo_input["save_dir"]) == calc_dir):
copytree(calc_dir, Path(avo_input["save_dir"]), dirs_exist_ok=True)
The idea was that they should leave it as the But what I might do is change things a little to clarify what "Save results in:" means, since it seems to be confusing. Possibly I'll reword the description to make it's clear that it's only for an extra copy, and set the default value of the field to be blank anyway. |
Windows 10, Avogadro 1.99 Nightly 2024-02-08, avo-xtb 2024-02-13T14:00:00
Problem: Run... produces empty input.xyz files and therefore gives error in run.py: line 211
To Reproduce:
--> input.tmol in last/ ist OK, input.xyz is 0 bytes
Checking the checkbox "Use Turbomole Geometry" runs the calculation, but since "Save results in" was empty, an error in run.py: line 261 occurs.
Setting both "Use Turbomole Geometry" and "Save results in" works fine.
Solution:
The text was updated successfully, but these errors were encountered: