ProtoModel

pydantic model qcelemental.models.v2.ProtoModel[source]

QCSchema extension of pydantic.BaseModel.

Show JSON schema
{
   "title": "ProtoModel",
   "description": "QCSchema extension of pydantic.BaseModel.",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

compare(other, **kwargs)[source]

Compares the current object to the provided object recursively.

Parameters:
Returns:

True if the objects match.

Return type:

bool

dict(**kwargs)[source]
Return type:

Dict[str, Any]

json(**kwargs)[source]
classmethod parse_file(path, *, encoding=None)[source]

Parses a file into a Model object.

This overwrites the deprecated parse_file of v2 Pydantic to eventually call parse_model or parse_model_json, but is kept to preserve our own API

May also be deprecated from QCElemental in time

Parameters:
  • path (str | Path) – The path to the file.

  • encoding (str | None) – The type of the files, available types are: {‘json’, ‘msgpack’, ‘pickle’}. Attempts to automatically infer the file type from the file extension if None.

Returns:

The requested model from a serialized format.

Return type:

Model

classmethod parse_raw(data, *, encoding=None)[source]

Parses raw string or bytes into a Model object.

This overwrites the deprecated parse_file of v2 Pydantic to eventually call parse_model or parse_model_json, but is kept to preserve our own API

May also be deprecated from QCElemental in time

Parameters:
  • data (bytes | str) – A serialized data blob to be deserialized into a Model.

  • encoding (str | None) – The type of the serialized array, available types are: {‘json’, ‘json-ext’, ‘msgpack-ext’, ‘pickle’}

Returns:

The requested model from a serialized format.

Return type:

Model

serialize(encoding, *, include=None, exclude=None, exclude_unset=None, exclude_defaults=None, exclude_none=None)[source]

Generates a serialized representation of the model

Parameters:
  • encoding (str) – The serialization type, available types are: {‘json’, ‘json-ext’, ‘msgpack-ext’}

  • include (Set[str] | None) – Fields to be included in the serialization.

  • exclude (Set[str] | None) – Fields to be excluded in the serialization.

  • exclude_unset (bool | None) – If True, skips fields that have default values provided.

  • exclude_defaults (bool | None) – If True, skips fields that have set or defaulted values equal to the default.

  • exclude_none (bool | None) – If True, skips fields that have value None.

Returns:

The serialized model.

Return type:

Union[bytes, str]