Classes to manipulate output from job folders.
Bases: object
Collects extraction methods from different job-folders.
Wraps around a root job folder and provides means to access it (or something related to it). In practice, a derived class will hold a list of somethings which does something good for a particular folder. This is a base class, concerned mostly with providing a rich mapping and attribute access interface. It allows the user to focus on a small set of executable folders via the mapping ([]) methods, e.g. a view of the folders. The attributes of the wrapped somethings of the current view are retrieved into a forwarding dict <pylada.jobfolder.forwardingdict.ForwardingDict.
The __iter_alljobs__() method should be implemented within derived classes. It should yield for each executable folder a tuple consisting of the name of that folder and the relevant something.
Initializes extraction object.
Parameters: |
|
---|---|
Para excludes: | List of patterns which the job names must not match to be included in the extraction. Ignored if None. |
Current view into the map of extraction object. Filters out the names which do not fit the view. It should be either a regex or a unix file-completion like string. The behavior is controled by pylada.unix_re
Returns a view of the current job-dictionary.
Note
normpath returns a valid path when descending below root, e.g.``normpath(‘/../../other’) == ‘/other’), so there won’t be any errors on that account.
Returns a new object with further exclusions.
Parameters: | excludes (str or list of str or None) – Pattern or patterns to exclude from output. |
---|
The goal of this function is to work as an anti operator [], i.e. by excluding from the output anything that matches the patterns, rather including only those which match the pattern. This is strickly equivalent to:
>>> other = massextract.copy(excludes=excludes)
>>> other.excludes.extend(massextract.excludes)
and then doing calculations with other. The advantage is that it can all be done on one line.
If the excludes argument is None or an empty list, then the returned object will not exlude anything.
See also
pylada.vasp.extract.MassExtract extracts a directory and its subdirectories for vasp calculations.