PyFrag
Public Member Functions | Public Attributes | List of all members
qmworks.plams.core.jobmanager.JobManager Class Reference
Inheritance diagram for qmworks.plams.core.jobmanager.JobManager:
Inheritance graph
[legend]
Collaboration diagram for qmworks.plams.core.jobmanager.JobManager:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, settings, path=None, folder=None)
 
def load_job (self, filename)
 
def remove_job (self, job)
 

Public Attributes

 settings
 
 jobs
 
 names
 
 hashes
 
 path
 
 foldername
 
 workdir
 
 logfile
 
 input
 

Detailed Description

Class responsible for jobs and files management.

Every instance has the following attributes:
    *   ``folder`` -- the working folder name.
    *   ``path`` -- the absolute path to the directory with the working folder.
    *   ``workdir`` -- the absolute path to the working folder (``path/folder``).
    *   ``settings`` -- a |Settings| instance for this job manager (see below).
    *   ``jobs`` -- a list of all jobs managed with this instance (in order of |run| calls).
    *   ``names`` -- a dictionary with names of jobs. For each name an integer value is stored indicating how many jobs with that name have already been run.
    *   ``hashes`` -- a dictionary working as a hash-table for jobs.

``path`` and ``folder`` can be adjusted with constructor arguments *path* and *folder*. If not supplied, Python current working directory and string ``plams.`` appended with PID of the current process are used.

``settings`` attribute is directly set to the value of *settings* argument (unlike in other classes where they are copied) and it should be a |Settings| instance with the following keys:
    *   ``hashing`` -- chosen hashing method (see |RPM|).
    *   ``counter_len`` -- length of number appended to the job name in case of name conflict.
    *   ``remove_empty_directories`` -- if ``True``, all empty subdirectories of the working folder are removed on |finish|.

Member Function Documentation

◆ load_job()

def qmworks.plams.core.jobmanager.JobManager.load_job (   self,
  filename 
)
Load previously saved job from *filename*.

*Filename* should be a path to ``.dill`` file in some job folder. A |Job| instance stored there is loaded and returned. All attributes of this instance removed before pickling are restored. This includes ``jobmanager``, ``path`` (absolute path to *filename* is used), ``default_setting`` (list containing only ``config.job``) and also ``parent`` in case of children of some |MultiJob|.

See :ref:`pickling` for details.

◆ remove_job()

def qmworks.plams.core.jobmanager.JobManager.remove_job (   self,
  job 
)
Remove *job* from job manager. Forget its hash.

The documentation for this class was generated from the following file: