plump_qcvar

psi4.driver.p4util.plump_qcvar(key, val)[source]

Prepare serialized QCVariables for QCSchema AtomicResult.extras[“qcvars”] by converting flat arrays into numpy, shaped ones and floating strings. Unlike _qcvar_reshape_get/set, multipoles aren’t compressed or plumped, only reshaped.

Parameters:
  • key (str) – Shape clue (usually QCVariable key) that includes (case insensitive) an identifier like ‘gradient’ as a clue to the array’s natural dimensions.

  • val (Union[float, str, List]) – flat (?, ) list or scalar or string, probably from JSON storage.

Returns:

Reshaped array of val with natural dimensions of key.

Return type:

float or numpy.ndarray