dragonfruit.vasp.base module

class dragonfruit.vasp.base.VaspRun(*_args, **_kwargs)

Bases: dragonfruit.mince.process.Process, dragonfruit.ase_utils.AseVisualizable

ATTRS = (AttrSpec(name='initial_atoms', as_ref=True), '_atom_steps', '_result_steps', '_settings', '_sort', '_resort', '_run_path', '_vasp_stdout', '_scheduler_env', 'description', '_files', 'keep_files', '_files', '_settings_overwrites', 'post_calculation_state')
TYPE_ID = UUID('139d0f75-7178-43fe-85e4-f609469122e1')
property atoms: ase.atoms.Atoms

Get the latest atoms

property atoms_history: Sequence[ase.atoms.Atoms]

Get a list of all the atoms from this run

property converged: bool
property crashed: bool
create_restart(new_path: pathlib.Path = None, atoms: ase.atoms.Atoms = None, copy_files=('WAVECAR',), init_kwargs: dict = None)

Create a restart from this VaspRun and give back a new VaspRun ready to be executed

Parameters
  • new_path – the new path to run the restart in

  • atoms – Optionally specify a specific atoms object to use. Default: Use the last atoms in the task.

  • copy_files – the files to copy over to the new path for the restart

  • init_kwargs – will be passed on to the constructor of the new VaspRun

fake_run()

Run VASP with the current settings, atoms in the running path

classmethod from_vasp_run(run_directory: pathlib.Path)
get_file_contents(filename, encoding='utf-8')

Get the content of a stored file

get_visualizable()
load_instance_state(saved_state, loader)

Take the given object and load the instance state into it

print_file_contents(filename, encoding='utf-8')

“Prints the contents from .get_file_contents

property resort: List
property results: Optional[dict]

Get the latest results, returns None if there aren’t any yet

property results_history: Sequence[dict]

Get a list of all the results dictionaries for this run

run()

Run VASP with the current settings, atoms in the running path. We don’t run if we already did the calculation

property run_path: pathlib.Path

The folder where this VASP calculation runs

property run_settings: Dict

The _actual_ settings this will run with if calling run(). This returns a dictionary that is a copy of self.settings.update(self.settings_overwrites).

save_instance_state(saver)

Save the instance state of an object, should return a saved instance

property scheduler_env: Optional[<class 'dragonfruit.environments.SchedulerEnvironment'>]
property settings: Dict

The vasp calculator settings

property settings_overwrites: Dict

A dictionary that can be used to overwrite particular keys for this run without propagating them to any restarts of this run

property sort: List
property stored_files: Dict[str, mincepy.files.File]

The dictionary of stored files. These are updated each time the run is saved based on the keep files attribute

update_and_set_results() None

Update the results, and set as completed.

update_results() bool

Returns true if it managed to update with new results. Will not update if we already have results present

property vasp_stdout
class dragonfruit.vasp.base.VaspTask(*_args, **_kwargs)

Bases: dragonfruit.mince.process.Process, dragonfruit.ase_utils.AseVisualizable

Represents a particular VASP task like geometry optimisation or singlepoint calculation. This could involve multiple restarts until it is completed which is why it has a list of individual vasp executions called `VaspRun`s.

ATTRS = (AttrSpec(name='_initial_atoms', as_ref=True), '_initial_settings', '_runs', '_restarter')
TYPE_ID = UUID('0420e8e1-1315-4d0c-b1b1-0f20f3686fa0')
append_run(vasp_run: <class 'dragonfruit.vasp.base.VaspRun'>)
property atoms

The current atoms

property atoms_history: List[ase.atoms.Atoms]

Get a list of all the atoms from this task (spanning all runs)

property converged: bool
property crashed: bool
execute_run(vasp_run: <class 'dragonfruit.vasp.base.VaspRun'>)
get_last_run() Optional[<class 'dragonfruit.vasp.base.VaspRun'>]
get_restarter() <class 'dragonfruit.vasp.vasp_errors.RunRestarter'>
get_visualizable()
property initial_atoms: ase.atoms.Atoms

Get the initial atoms object

property initial_settings: dict
new_run(**kwargs) <class 'dragonfruit.vasp.base.VaspRun'>

Gives you a new run for this task. If there are previous runs in this task the new run will be initialised with atoms and settings from the previous. Otherwise initial settings are used.

The new run will be appended to our list of runs. THe previous run (if present) will have its state set to done if not already done so which means it can no longer be modified.

property results: Optional[dict]

Get the latest results, returns None if there aren’t any yet

property results_history

Get a list of all the results dictionaries for this task (spanning all runs)

property runs: Sequence[<class 'dragonfruit.vasp.base.VaspRun'>]
save_instance_state(saver) dict

Save the instance state of an object, should return a saved instance

property settings

The current settings