OptimizationResultCollection

class openff.qcsubmit.results.OptimizationResultCollection(*, entries, provenance={}, type='OptimizationResultCollection')[source]

A class which stores a reference to, and allows the retrieval of, data from a single optimization result record stored in a QCFractal instance.

Parameters
Return type

None

__init__(**data)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Parameters

data (Any) –

Return type

None

Methods

__init__(**data)

Create a new model by parsing and validating input data from keyword arguments.

construct([_fields_set])

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.

copy(*[, include, exclude, update, deep])

Duplicate a model, optionally choose which fields to include, exclude and change.

create_basic_dataset(dataset_name, ...[, ...])

Create a basic dataset from the results of the current dataset.

dict(*[, include, exclude, by_alias, ...])

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

filter(*filters)

Filter this collection by applying a set of filters sequentially, returning a new collection containing only the retained entries.

from_datasets(datasets[, spec_name])

Retrieve the COMPLETE record ids referenced by the specified datasets.

from_orm(obj)

from_server(client, datasets[, spec_name])

Retrieve (and deduplicate) the COMPLETE record ids referenced by the specified datasets.

json(*[, include, exclude, by_alias, ...])

Generate a JSON representation of the model, include and exclude arguments as per dict().

parse_file(path, *[, content_type, ...])

parse_obj(obj)

parse_raw(b, *[, content_type, encoding, ...])

schema([by_alias, ref_template])

schema_json(*[, by_alias, ref_template])

smirnoff_coverage(force_field[, verbose])

Returns a summary of how many unique molecules within this collection would be assigned each of the parameters in a force field.

to_basic_result_collection(driver)

Returns a basic results collection which references results records which were created from the final structure of one of the optimizations in this collection, and used the same program, method, and basis as the parent optimization record.

to_records()

Returns the native QCPortal record objects for each of the records referenced in this collection along with a corresponding OpenFF molecule object.

update_forward_refs(**localns)

Try to update ForwardRefs on fields based on this Model, globalns and localns.

validate(value)

Attributes

n_molecules

Returns the number of unique molecules referenced by this collection.

n_results

Returns the number of results in this collection.

type

entries

classmethod from_datasets(datasets, spec_name='default')[source]

Retrieve the COMPLETE record ids referenced by the specified datasets.

Parameters
  • datasets (Union[qcportal.optimization.dataset_models.OptimizationDataset, Iterable[qcportal.optimization.dataset_models.OptimizationDataset]]) – The datasets to retrieve the records from.

  • spec_name (str) – The name of the QC specification that the records to retrieve should have been computed using.

Returns

A results collection object containing the record ids and a minimal amount of associated metadata such as the CMILES of the associated molecule.

Return type

openff.qcsubmit.results.results.OptimizationResultCollection

classmethod from_server(client, datasets, spec_name='default')[source]

Retrieve (and deduplicate) the COMPLETE record ids referenced by the specified datasets.

Parameters
  • client (qcportal.client.PortalClient) – The fractal client that should be used to interface with the running QCFractal instance which stores the datasets and their associated results records.

  • datasets (Union[str, Iterable[str]]) – The names of the datasets

  • spec_name (str) – The name of the QC specification that the records to retrieve should have been computed using.

Returns

A results collection object containing the record ids and a minimal amount of associated metadata such as the CMILES of the associated molecule.

Return type

openff.qcsubmit.results.results.OptimizationResultCollection

to_records()[source]

Returns the native QCPortal record objects for each of the records referenced in this collection along with a corresponding OpenFF molecule object.

Each molecule will contain the minimum energy conformer referenced by the record.

Return type

List[Tuple[qcportal.optimization.record_models.OptimizationRecord, openff.toolkit.topology.molecule.Molecule]]

to_basic_result_collection(driver)[source]

Returns a basic results collection which references results records which were created from the final structure of one of the optimizations in this collection, and used the same program, method, and basis as the parent optimization record.

Returns

The results collection referencing records created from the final optimized structures referenced by this collection.

Return type

openff.qcsubmit.results.results.BasicResultCollection

create_basic_dataset(dataset_name, description, tagline, driver, metadata=None, qc_specifications=None)[source]

Create a basic dataset from the results of the current dataset.

Notes

  • This may be used, for example, to evaluate the hessians of each optimized geometry.

Parameters
  • dataset_name (str) – The name that will be given to the new dataset.

  • tagline (str) – The tagline that should be given to the new dataset.

  • description (str) – The description that should be given to the new dataset.

  • driver (qcportal.singlepoint.record_models.SinglepointDriver) – The driver to be used on the basic dataset.

  • metadata (Optional[openff.qcsubmit.common_structures.Metadata]) – The metadata for the new dataset.

  • qc_specifications (Optional[List[openff.qcsubmit.common_structures.QCSpec]]) – The QC specifications to be used on the new dataset. If no value is provided, the default OpenFF QCSpec will be added.

Returns

The created basic dataset.

Return type

openff.qcsubmit.datasets.datasets.BasicDataset

filter(*filters)

Filter this collection by applying a set of filters sequentially, returning a new collection containing only the retained entries.

Notes

Information about any applied filters will be stored in the provenance dictionary in the ‘applied-filters’ field. Any existing information in this field will be overwritten here.

Parameters

filters (ResultFilter) – The filters to apply, in the order to apply them in.

Returns

The collection containing only the retained entries.

Example:

>>> filtered_collection = self.filter(
>>>     RecordStatusFilter(status=RecordStatusEnum.complete),
>>>     ConnectivityFilter(tolerance=1.2),
>>>     UnperceivableStereoFilter(),
>>>     ElementFilter(allowed_elements=elements),
>>>     ConformerRMSDFilter(max_conformers=max_opt_conformers),
>>> )
property n_molecules: int

Returns the number of unique molecules referenced by this collection.

property n_results: int

Returns the number of results in this collection.

smirnoff_coverage(force_field, verbose=False)

Returns a summary of how many unique molecules within this collection would be assigned each of the parameters in a force field.

Notes

  • Parameters which would not be assigned to any molecules in the collection will not be included in the returned summary.

Parameters
Returns

A dictionary of the form coverage[handler_name][parameter_smirks] = count which stores the number of unique molecules within this collection that would be assigned to each parameter.