예제 #1
0
def test_restart(aiida_profile, fixture_localhost, generate_calc_job_node):
    """Test the generics of the `get_builder_restart`."""
    entry_point_calc_job = 'quantumespresso.dos'
    node = generate_calc_job_node(entry_point_calc_job, fixture_localhost,
                                  'default', generate_inputs())

    # The `DosCalculation` class is not yet supported
    with pytest.raises(TypeError):
        restart.get_builder_restart(node)
예제 #2
0
def test_restart_pw(aiida_profile, fixture_localhost, generate_calc_job_node):
    """Test the `get_builder_restart` for a completed `PwCalculation`."""
    entry_point_calc_job = 'quantumespresso.pw'
    node = generate_calc_job_node(entry_point_calc_job, fixture_localhost,
                                  'default', generate_inputs())

    builder = restart.get_builder_restart(node)
    parameters = builder.parameters.get_dict()

    assert isinstance(builder, ProcessBuilder)
    assert parameters['CONTROL']['restart_mode'] == 'restart'

    # Force `from_scratch`
    builder = restart.get_builder_restart(node, from_scratch=True)
    parameters = builder.parameters.get_dict()

    assert isinstance(builder, ProcessBuilder)
    assert parameters['CONTROL']['restart_mode'] == 'from_scratch'
예제 #3
0
    def test_restart_neb(self, fixture_database, fixture_computer_localhost,
                         generate_calc_job_node, generate_inputs):
        """Test the `get_builder_restart` for a completed `NebCalculation`."""
        entry_point_calc_job = 'quantumespresso.neb'
        node = generate_calc_job_node(entry_point_calc_job,
                                      fixture_computer_localhost, 'default',
                                      generate_inputs)

        builder = restart.get_builder_restart(node)
        parameters = builder.parameters.get_dict()

        assert isinstance(builder, ProcessBuilder)
        assert parameters['PATH']['restart_mode'] == 'restart'

        # Force `from_scratch`
        builder = restart.get_builder_restart(node, from_scratch=True)
        parameters = builder.parameters.get_dict()

        assert isinstance(builder, ProcessBuilder)
        assert parameters['PATH']['restart_mode'] == 'from_scratch'
예제 #4
0
def test_restart_ph(aiida_profile, fixture_localhost, generate_calc_job_node):
    """Test the `get_builder_restart` for a completed `PhCalculation`."""
    entry_point_calc_job = 'quantumespresso.ph'
    node = generate_calc_job_node(entry_point_calc_job, fixture_localhost,
                                  'default', generate_inputs())

    builder = restart.get_builder_restart(node)
    parameters = builder.parameters.get_dict()

    assert isinstance(builder, ProcessBuilder)
    assert parameters['INPUTPH']['recover'] is True