Skip to content
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

Add support for directories in cluster mol output #171

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion vayesta/solver/hamiltonian.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import dataclasses
from typing import Optional

Expand Down Expand Up @@ -309,7 +310,11 @@ def pad(a, diag_val):
# Copy over all output controls from original mol object.
clusmol.verbose = self.orig_mf.mol.verbose
if self.orig_mf.mol.output is not None:
clusmol.output = f"f{self._fragment.id}_{self.orig_mf.mol.output}"
fid = self._fragment.id
output = self.orig_mf.mol.output
dirname = os.path.dirname(output)
basename = os.path.basename(output)
clusmol.output = os.path.join(dirname, f"f{fid}_{basename}")
self.log.debugv("Setting solver output file to %s", clusmol.output)
# Set information as required for our cluster.
clusmol.nelec = self.nelec
Expand Down
Loading