Calculation datasets.
This module deals with the handling of series of calculations. Classes and functions of this module are meant to simplify the approach to ensemble calculations with the code, and to deal with parallel executions of multiple instances of the code.
BigDFT.Datasets.
Dataset
(label='BigDFT dataset', run_dir='runs', **kwargs)[source]¶Bases: BigDFT.Calculators.Runner
A set of calculations.
Such class contains the various instances of a set of calculations with the code. The different calculations are labelled by parameter values and information that might then be retrieved for inspection and plotting.
Parameters: |
|
---|
append_run
(id, runner, **kwargs)[source]¶Add a run into the dataset.
Append to the list of runs to be performed the corresponding runner and the arguments which are associated to it.
Parameters: |
|
---|---|
Raises: |
|
Todo
include id in the runs spcification
calculators
= None¶Calculators which will be used by the run method, useful to gather the inputs in the case of a multiple run.
fetch_results
(id=None, attribute=None)[source]¶Retrieve some attribute from some of the results.
Selects out of the results the objects which have in their id
at least the dictionary specified as input. May return an attribute
of each result if needed.
Parameters: |
|
---|
Example
>>> study=Dataset()
>>> study.append_run(id={'cr': 3},input={'dft':{'rmult':[3,8]}})
>>> study.append_run(id={'cr': 4},input={'dft':{'rmult':[4,8]}})
>>> study.append_run(id={'cr': 3, 'h': 0.5},
>>> input={'dft':{'hgrids': 0.5, 'rmult':[4,8]}})
>>> #append other runs if needed
>>> study.run() #run the calculations
>>> # returns a list of the energies of first and the third result in this example
>>> data=study.fetch_results(id={'cr': 3},attribute='energy')
ids
= None¶List of run ids, to be used in order to classify and fetch the results
names
= None¶List of run names, needed for distinguishing the logfiles and input files. Eah name should be unique to correctly identify a run.
post_processing
(**kwargs)[source]¶Calls the Dataset function with the results of the runs as arguments
process_run
()[source]¶Run the dataset, by performing explicit run of each of the item of the runs_list.
results
= None¶Set of the results of each of the runs. The set is not ordered as the runs may be executed asynchronously.
runs
= None¶List of the runs which have to be treated by the dataset these runs contain the input parameter to be passed to the various runners.