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

change calculate_efs and calculate_energy to instance variables #319

Merged
merged 1 commit into from
Aug 31, 2022
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
10 changes: 6 additions & 4 deletions flare/otf.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,19 @@ def __init__(
self.last_dft_step = 0

# Set the prediction function based on user inputs.
self.calculate_energy = calculate_energy
self.calculate_efs = calculate_efs
# Force only prediction.
if (n_cpus > 1 and gp.per_atom_par and gp.parallel) and not (
calculate_energy or calculate_efs
self.calculate_energy or self.calculate_efs
):
self.pred_func = predict.predict_on_structure_par
elif not (calculate_energy or calculate_efs):
elif not (self.calculate_energy or self.calculate_efs):
self.pred_func = predict.predict_on_structure
# Energy and force prediction.
elif (n_cpus > 1 and gp.per_atom_par and gp.parallel) and not (calculate_efs):
elif (n_cpus > 1 and gp.per_atom_par and gp.parallel) and not (self.calculate_efs):
self.pred_func = predict.predict_on_structure_par_en
elif not calculate_efs:
elif not self.calculate_efs:
self.pred_func = predict.predict_on_structure_en
# Energy, force, and stress prediction.
elif n_cpus > 1 and gp.per_atom_par and gp.parallel:
Expand Down