def set_values(zma, val_dct): """ set coordinate values for the z-matrix """ vma = var_(zma) _names = _v_.names(vma) assert set(val_dct.keys()) <= set(_names) new_val_dct = values(zma).copy() new_val_dct.update(val_dct) return automol.create.zmatrix.from_data( _v_.symbols(vma), _v_.key_matrix(vma), _v_.name_matrix(vma), new_val_dct)
def is_valid(zma): """ is this a valid zmatrix? """ ret = hasattr(zma, '__len__') and len(zma) == 2 if ret: vma, val_dct = zma ret = _v_.is_valid(vma) and set(_v_.names(vma)) == set(val_dct) if ret: try: automol.create.zmatrix.from_data( _v_.symbols(vma), _v_.key_matrix(vma), _v_.name_matrix(vma), val_dct) except AssertionError: ret = False return ret
def names(zma): """ coordinate names """ return _v_.names(var_(zma))