Esempio n. 1
0
def test_toplevel_pass():
    data = {
        # "title": "a title",
        # "geometry": {},
        # "basis_set": {},
        "scf": {
            "k_points": [8, 8]
        }
    }
    validate_with_json(data)
def test_full_pass():
    data = {
        "band": {
            "title": "some title",
            "shrink": 12,
            "k_points": 30,
            "first": 7,
            "last": 14,
            "bands": [[[0, 3, 6], [6, 6, 6]]],
            "store": True,
            "print": False
        }
    }
    validate_with_json(data, "d3")
def test_toplevel_pass():
    data = {
        "band": {
            "shrink": 12,
            "k_points": 30,
            "first": 7,
            "last": 14,
            "bands": [["G", "Y"]]
        },
        "newk": {
            "k_points": [8, 8],
            "fermi": False,
        },
        "dos": {
            "n_e": 100,
            "first": 5,
            "last": 10,
            "projections_atoms": [[1], [2]]
        }
    }
    validate_with_json(data, name="d3")
def test_band_toplevel_fail(test_input):
    with pytest.raises(ValidationError):
        validate_with_json(test_input, name='d3')
Esempio n. 5
0
 def use_parameters(self, parameters):
     """A ParameterData (or a simple dict) to use for making INPUT"""
     input_dict = parameters if isinstance(parameters,
                                           dict) else parameters.get_dict()
     validate_with_json(input_dict, name="d12")
     self._input = input_dict
Esempio n. 6
0
 def use_parameters(self, parameters):
     validate_with_json(parameters, name="d3")
     self._parameters = parameters
Esempio n. 7
0
def test_toplevel_fail():
    with pytest.raises(ValidationError):
        validate_with_json({})
    with pytest.raises(ValidationError):
        validate_with_json({"a": 1})
Esempio n. 8
0
def test_full_pass():
    data = {
        "title": "a title",
        "geometry": {
            "info_print": ["ATOMSYMM", "SYMMOPS"],
            "info_external": ["STRUCPRT"],
            "optimise": {
                "type": "FULLOPTG",
                "hessian": "HESSIDEN",
                "gradient": "NUMGRATO",
                "info_print": ["PRINTOPT", "PRINTFORCES"],
                "convergence": {
                    "TOLDEG": 0.0003,
                    "TOLDEX": 0.0012,
                    "TOLDEE": 7,
                    "MAXCYCLE": 50,
                    "FINALRUN": 4
                },
            }
        },
        "basis_set": {
            "CHARGED": False,
        },
        "scf": {
            "dft": {
                "xc": ["LDA", "PZ"],
                # or
                # "xc": "HSE06",
                # or
                # "xc": {"LSRSH-PBE": [0.11, 0.25, 0.00001]},
                "SPIN": True,
                "grid": "XLGRID",
                "grid_weights": "BECKE",
                "numerical": {
                    "TOLLDENS": 6,
                    "TOLLGRID": 14,
                    "LIMBEK": 400
                }
            },
            # or
            # "single": "UHF",
            "k_points": [8, 8],
            "numerical": {
                "BIPOLAR": [18, 14],
                "BIPOSIZE": 4000000,
                "EXCHSIZE": 4000000,
                "EXCHPERM": False,
                "ILASIZE": 6000,
                "INTGPACK": 0,
                "MADELIND": 50,
                "NOBIPCOU": False,
                "NOBIPEXCH": False,
                "NOBIPOLA": False,
                "POLEORDR": 4,
                "TOLINTEG": [6, 6, 6, 6, 12],
                "TOLPSEUD": 6,
                "FMIXING": 0,
                "MAXCYCLE": 50,
                "TOLDEE": 6,
                "LEVSHIFT": [2, 1],
                "SMEAR": 0.1
            },
            "fock_mixing": "DIIS",
            # or
            # "fock_mixing": {"BROYDEN": [0.0001, 50, 2]},
            "spinlock": {
                "SPINLOCK": [1, 10]
            },
            "post_scf": ["GRADCAL", "PPAN"]
        }
    }
    validate_with_json(data)