pyiron.testing.executable module

class pyiron.testing.executable.ExampleExecutable[source]

Bases: object

Simple python executable that resembles the behavior of a real job, i.e., it processes input files, generates output files and can perform restarts. Will be mainly used to test the genericJob class.

get_energy(alat)[source]

Based on the lattice constant a random energy is calculated.

Parameters

alat (float) – lattice constant

Returns

list of n random energy values, where n equals self._count

Return type

(list)

read_restart()[source]

Read a restart file for a continous simulation divided into multiple jobs.

run()[source]

Run executes the job as part of a subprocess. The input is written to an input file, then the executable is executed and finally the output file is collected and converted to HDF5 format for future processing.

run_lib(input_dict)[source]

Run lib executes the job directly in Python instead of calling a separate subprocess, this is faster for all Python jobs but not available for non Python jobs. No input or output files are generated when running in library mode, instead all input is provided as an input dictionary and the output is returned as a list.

Parameters

input_dict (dict) – input consisting of [“alpha”, “alat”, “count”]

Returns

alat(float), count(int), energy(list)

Return type

list

write_restart()[source]

Write a restart file for a continous simulation divided into multiple jobs.