Esempio n. 1
0
def test_write_settings(clean_dir):
    settings_file = Path("test_settings.yaml")
    write_settings(defaults, settings_file)
    contents = settings_file.read_text()

    assert "scattering_type: auto" in contents
    assert "acceptor_charge: 1" in contents
Esempio n. 2
0
    def write_settings(self, directory: str = ".", prefix: Optional[str] = None):
        if prefix is None:
            prefix = ""
        else:
            prefix += "_"

        filename = joinpath(directory, "{}amset_settings.yaml".format(prefix))
        write_settings(self.settings, filename)
Esempio n. 3
0
 def write_settings(self,
                    directory: str = ".",
                    prefix: Optional[str] = None):
     prefix = "" if prefix is None else f"{prefix}_"
     filename = Path(directory) / f"{prefix}amset_settings.yaml"
     write_settings(self.settings, filename)