diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 28a9c55aa..fb2feb614 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -321,12 +321,8 @@ def get_scf_group( ] else: scf_group.create_group("preconditioner")["type"] = "KERKER" - scf_group.preconditioner.set_parameter( - "scaling", self.input["rhoResidualScaling"] - ) - scf_group.preconditioner.set_parameter( - "spinScaling", self.input["spinResidualScaling"] - ) + scf_group.preconditioner["scaling"] = self.input["rhoResidualScaling"] + scf_group.preconditioner["spinScaling"] = self.input["spinResidualScaling"] scf_group.create_group(algorithm) if "maxStepsCCG" in self.input: scf_group[algorithm]["maxStepsCCG"] = self.input["maxStepsCCG"] @@ -2051,62 +2047,13 @@ class Group(DataContainer): expected by the given DFT code in its input files. """ - def set(self, name, content): - self[name] = content - - def set_group(self, name, content=None): - """ - Set a new group in SPHInX input. - - Args: - name (str): name of the group - content: content to append - - This creates an input group of the type `name { content }`. - """ - if content is None: - self.create_group(name) - else: - self.set(name, content) - - def set_flag(self, flag, val=True): - """ - Set a new flag in SPHInX input. - - Args: - flag (str): name of the flag - val (bool): boolean value - - This creates an input flag of the type `name = val`. - """ - self.set(flag, val) - - def set_parameter(self, parameter, val): - """ - Set a new parameter in SPHInX input. - - Args: - parameter (str): name of the flag - val (float): parameter value - - This creates an input parameter of the type `parameter = val`. - """ - self.set(parameter, val) - - def remove(self, name): - if name in self.keys(): - del self[name] - def to_sphinx(self, content="__self__", indent=0): if content == "__self__": content = self def format_value(v): if isinstance(v, bool): - if v: - return ";" - else: - return " = false;" + return f" = {v};".lower() elif isinstance(v, Group): if len(v) == 0: return " {}" diff --git a/pyiron_atomistics/sphinx/interactive.py b/pyiron_atomistics/sphinx/interactive.py index cba741c51..f4f8b576f 100644 --- a/pyiron_atomistics/sphinx/interactive.py +++ b/pyiron_atomistics/sphinx/interactive.py @@ -352,7 +352,7 @@ def load_main_group(self): ] ) self.input.sphinx.main.extControl = Group() - self.input.sphinx.main.extControl.set_group("bornOppenheimer") + self.input.sphinx.main.extControl.create_group("bornOppenheimer") self.input.sphinx.main.extControl.bornOppenheimer = commands else: super(SphinxInteractive, self).load_main_group() diff --git a/tests/sphinx/test_base.py b/tests/sphinx/test_base.py index a42b42b28..b51ed3579 100644 --- a/tests/sphinx/test_base.py +++ b/tests/sphinx/test_base.py @@ -154,7 +154,7 @@ def test_write_input(self): "\t\tatom {\n", '\t\t\tlabel = "spin_0.5";\n', "\t\t\tcoords = [0.0, 0.0, 0.0];\n", - "\t\t\tmovable;\n", + "\t\t\tmovable = true;\n", "\t\t}\n", "\t\tatom {\n", '\t\t\tlabel = "spin_0.5";\n', @@ -172,25 +172,25 @@ def test_write_input(self): "\tkPoint {\n", "\t\tcoords = [0.5, 0.5, 0.5];\n", "\t\tweight = 1;\n", - "\t\trelative;\n", + "\t\trelative = true;\n", "\t}\n", "\tfolding = [4, 4, 4];\n", - "\tsaveMemory;\n", + "\tsaveMemory = true;\n", "}\n", "PAWHamiltonian {\n", "\tnEmptyStates = 6;\n", "\tekt = 0.2;\n", "\tMethfesselPaxton = 1;\n", "\txc = PBE;\n", - "\tspinPolarized;\n", + "\tspinPolarized = true;\n", "}\n", "initialGuess {\n", "\twaves {\n", - "\t\tpawBasis;\n", + "\t\tpawBasis = true;\n", "\t\tlcao {}\n", "\t}\n", "\trho {\n", - "\t\tatomicOrbitals;\n", + "\t\tatomicOrbitals = true;\n", "\t\tatomicSpin {\n", '\t\t\tlabel = "spin_0.5";\n', "\t\t\tspin = 0.5;\n", @@ -578,7 +578,7 @@ def test_write_structure(self): "\tatom {\n", '\t\tlabel = "spin_0.5";\n', "\t\tcoords = [0.0, 0.0, 0.0];\n", - "\t\tmovable;\n", + "\t\tmovable = true;\n", "\t}\n", "\tatom {\n", '\t\tlabel = "spin_0.5";\n',