xtb_step Phase F – File Drop Notes#
Three real bugs from your last test run, all fixed:
KeyError: 'optimization frame'and the analogous'frequencies frame'error when opening the Optimization / Frequencies edit dialogs. Root cause: my Phase ETkEnergy.create_dialogended withself.reset_dialog(), which Python’s MRO dispatched to the subclassreset_dialog– but at that point the subclasscreate_dialoghad not yet built its own frames, so the lookup blew up.(Same bug, fixed by the same removal in
TkOptimization.create_dialogandTkFrequencies.create_dialog.)xtbopt.xyzandxtbtopo.molwere not coming back from the work directory becausereturn_filesonly listed["xtbout.json", "xtbrestart"]. Extended to glob over the commonly-written xtb output files.
Files in this drop#
Replace existing#
xtb_step/tk_energy.pyOne-line change: removed the
self.reset_dialog()call at the end ofcreate_dialog, and added a comment explaining why it must not go there. Detailed reasoning below.xtb_step/tk_optimization.pySame one-line removal at the end of
create_dialog.xtb_step/tk_frequencies.pySame one-line removal at the end of
create_dialog.xtb_step/energy.pyChanged
return_filesfrom["xtbout.json", "xtbrestart"]to:return_files = [ "xtbout.json", "xtbrestart", "*.xyz", # xtbopt.xyz and any other xyz files "*.mol", # xtbtopo.mol topology file "*.log", # xtbopt.log optimization trajectory "vibspectrum", # Turbomole-format IR spectrum "hessian", # Turbomole-format Hessian matrix "g98.out", # Gaussian-98 output for visualization ]
Modeled on the Gaussian step’s use of
["*.cube"]/["*"]glob patterns in its CubeGen invocations.
Why the dialog bug happened#
The flow when the user double-clicks an Optimization step:
seamm.tk_node.edit()callsself.create_dialog().Python’s MRO dispatches to
TkOptimization.create_dialog().TkOptimization.create_dialogcallssuper().create_dialog(), which goes toTkEnergy.create_dialog().TkEnergy.create_dialogbuildsself["energy frame"], creates the energy widgets, binds the solvation-model widget, and (in Phase E) calledself.reset_dialog()at the end.self.reset_dialog()is also MRO-dispatched, so it goes toTkOptimization.reset_dialog().TkOptimization.reset_dialogdoesrow = super().reset_dialog()(which lays out the energy frame fine) then triesself["optimization frame"].grid(...)– but the optimization frame doesn’t exist yet. Subclasscreate_dialoghas not built it. KeyError.
The MOPAC pattern (which I should have copied more carefully) ends
each create_dialog with self.logger.debug("Finished creating
the dialog") and return frame, and never calls
self.reset_dialog from within create_dialog. The seamm
framework’s tk_node.edit() calls reset_dialog itself, after
create_dialog has fully unwound through all the subclass and
parent calls, so by the time reset_dialog runs every frame
exists.
This is now noted in the comments at the bottom of each
create_dialog.
Why the missing files happened#
Your directory listing for step 3.2 (Optimization) showed:
coord.xyz, stderr.txt, stdout.txt, step.out,
xtb.err, xtb.out, xtbout.json, xtbrestart
xtb’s own log (the xtb.out file you sent) reports:
Writing topology from bond orders to xtbtopo.mol
optimized geometry written to: xtbopt.xyz
So xtb did write both files into the working directory, but the
seamm executor’s “return files” mechanism only copies back the files
listed in return_files to the long-term step directory. The
defaults in Phase D were too restrictive.
The new globs are deliberately permissive – *.xyz / *.mol /
*.log will pick up anything xtb might write under those
extensions in any future xtb release, plus the explicit names for
the Turbomole-format files (vibspectrum, hessian) and the
Gaussian-format file (g98.out).
Not in this drop#
All the other files from Phase D / Phase E (substep.py,
metadata.py, frequencies.py, optimization.py,
energy_parameters.py, optimization_parameters.py,
frequencies_parameters.py, xtb.py, __init__.py,
setup.py, the data files, the installer) are unchanged.
Test plan after copying#
make lint && make install && make test– still pass.Open the Optimization step’s edit dialog. It should now open without a KeyError, and show two frames: the Hamiltonian Parameters frame at the top with the dynamic solvent visibility, and the Optimization frame below with optimization level / max iterations / structure handling.
Open the Frequencies step’s edit dialog. Three frames now: Hamiltonian, Optimization, Frequencies / Thermochemistry.
Re-run the water flowchart. After the run, the Optimization step directory should contain
xtbopt.xyz,xtbopt.log, andxtbtopo.molin addition to the Phase E files. The Frequencies step directory should additionally containvibspectrum,hessian, andg98.out.The
WARNING: xtbopt.xyz not foundlog messages fromOptimization._handle_optimized_structureshould now be silent for the optimization step (we have the file) and may still appear for the frequency step if xtb under--ohesswrites the optimized geometry to a different filename. If the latter persists, check what filename xtb actually used (likelyxtbopt.xyzstill –--ohessis just opt + hess in one invocation – but worth confirming).
Code style#
All four files compile cleanly, all lines <= 88 chars. The diffs against the previous phase are minimal (a 4-line block removed in each tk_*.py, a 9-line list extension in energy.py).