Utilities
qcio.json_dumps
¶
json_dumps(
obj: BaseModel | list[BaseModel],
exclude_unset: bool = True,
**model_dump_kwargs,
) -> str
Serialization helper for lists of pydantic objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
BaseModel | list[BaseModel]
|
The object to serialize. Either a single pydantic object or a list of pydantic objects. |
required |
exclude_unset
|
bool
|
Whether to exclude unset fields from the serialized output. |
True
|
**model_dump_kwargs
|
Additional keyword arguments to pass to model_dump. |
{}
|
Source code in src/qcio/utils.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
qcio.to_multi_xyz
¶
to_multi_xyz(structures: Iterable[Structure]) -> str
Create a multi-structure XYZ string from a list of structures.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
structures
|
Iterable[Structure]
|
An Iterable of Structure objects. |
required |
Returns:
Type | Description |
---|---|
str
|
The multi-structure XYZ string. |
Source code in src/qcio/models/utils.py
89 90 91 92 93 94 95 96 97 98 |
|