Skip to content

Commit

Permalink
Added a new function of set_label to auto override the prefix of the …
Browse files Browse the repository at this point in the history
…calculation
  • Loading branch information
mesonepigreco committed Mar 16, 2022
1 parent 973e51b commit 830babf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cellconstructor/calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ def __init__(self, input_data, pseudopotentials, masses = None, command = "pw.x

assert len(list(self.pseudopotentials)) == len(list(self.masses)), "Error, pseudopotential and masses must match"


def set_label(self, lbl, override_prefix = True, *args, **kwargs):
FileIOCalculator.set_label(self, lbl, *args, **kwargs)

# Enforce the override of the prefix
if override_prefix:
if "control" in self.input_data:
self.input_data["control"].update({"prefix" : lbl})

def setup_from_ase(self, ase_calc):
"""
Copy the parameters from the ASE calculator
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
packages = ["cellconstructor"],
package_dir = {"cellconstructor": "cellconstructor"},
package_data = {"cellconstructor": ["SymData/*.dat"]},
install_requires = ["numpy", "ase", "scipy"],
setup_requires = ["numpy", "ase", "scipy"],
license = "MIT",
include_package_data = True,
scripts = ["scripts/symmetrize_dynmat.py", "scripts/cellconstructor_test.py", "scripts/view_scf_atoms.py"],
Expand Down

0 comments on commit 830babf

Please sign in to comment.