overreact/coords.py
def _update_mirror_axes(
    ax,
    axes,  # found axes
    atomcoords,
    groups,
    rtol,
    atol,
    proper_axes,
    nondeg_axes=None,
    normalize=False,
):
    """Update axes with ax and return it.

    Helper function for _get_mirror_planes.
    """
    if nondeg_axes is None:
        nondeg_axes = list()

    if normalize:
        norm = np.linalg.norm(ax)
        if np.isclose(norm, 0.0, rtol=rtol, atol=atol):
            return axes
        ax = ax / norm

    if not all(
        np.isclose(ax @ v, 0.0, rtol=rtol, atol=atol) for v in nondeg_axes
    ) or any(np.isclose(np.abs(ax @ v), 1.0, rtol=rtol, atol=atol) for c, v in axes):
        return axes

    if all(
        _is_symmetric(atomcoords[group], _operation("σ", axis=ax), rtol=rtol, atol=atol)
        for group in groups[::-1]
    ):
        class_ = ""
        if any(
            np.isclose(np.abs(ax @ v), 1.0, rtol=rtol, atol=atol)
            for n, v in proper_axes
            if proper_axes[0][0] == n
        ):
            class_ = "h"
        elif any(
            np.isclose(ax @ v, 0.0, rtol=rtol, atol=atol)
            for n, v in proper_axes
            if proper_axes[0][0] == n
        ):
            class_ = "v"
        axes.append((class_, tuple(ax)))

    return axes
Update axes with ax and return it.

    Helper function for _get_mirror_planes.
    
Update axes with ax and return it.
Helper function for _get_mirror_planes.
Update axes with ax and return it . Helper function for _get_mirror_planes .
def _update_mirror_axes(
    ax,
    axes,  
    atomcoords,
    groups,
    rtol,
    atol,
    proper_axes,
    nondeg_axes=None,
    normalize=False,
):
    if nondeg_axes is None:
        nondeg_axes = list()
    if normalize:
        norm = np.linalg.norm(ax)
        if np.isclose(norm, 0.0, rtol=rtol, atol=atol):
            return axes
        ax = ax / norm
    if not all(
        np.isclose(ax @ v, 0.0, rtol=rtol, atol=atol) for v in nondeg_axes
    ) or any(np.isclose(np.abs(ax @ v), 1.0, rtol=rtol, atol=atol) for c, v in axes):
        return axes
    if all(
        _is_symmetric(atomcoords[group], _operation("σ", axis=ax), rtol=rtol, atol=atol)
        for group in groups[::-1]
    ):
        class_ = ""
        if any(
            np.isclose(np.abs(ax @ v), 1.0, rtol=rtol, atol=atol)
            for n, v in proper_axes
            if proper_axes[0][0] == n
        ):
            class_ = "h"
        elif any(
            np.isclose(ax @ v, 0.0, rtol=rtol, atol=atol)
            for n, v in proper_axes
            if proper_axes[0][0] == n
        ):
            class_ = "v"
        axes.append((class_, tuple(ax)))
    return axes
def _update_mirror_axes ( ax , axes , atomcoords , groups , rtol , atol , proper_axes , nondeg_axes = None , normalize = False , ) : if nondeg_axes is None : nondeg_axes = list ( ) if normalize : norm = np . linalg . norm ( ax ) if np . isclose ( norm , 0.0 , rtol = rtol , atol = atol ) : return axes ax = ax / norm if not all ( np . isclose ( ax @ v , 0.0 , rtol = rtol , atol = atol ) for v in nondeg_axes ) or any ( np . isclose ( np . abs ( ax @ v ) , 1.0 , rtol = rtol , atol = atol ) for c , v in axes ) : return axes if all ( _is_symmetric ( atomcoords [ group ] , _operation ( "σ", xis= a x) , tol= r tol, tol= a tol) for group in groups [ : : - 1 ] ) : class_ = "" if any ( np . isclose ( np . abs ( ax @ v ) , 1.0 , rtol = rtol , atol = atol ) for n , v in proper_axes if proper_axes [ 0 ] [ 0 ] == n ) : class_ = "h" elif any ( np . isclose ( ax @ v , 0.0 , rtol = rtol , atol = atol ) for n , v in proper_axes if proper_axes [ 0 ] [ 0 ] == n ) : class_ = "v" axes . append ( ( class_ , tuple ( ax ) ) ) return axes
Update axes with ax and return it.
Update axes with ax and return it .
# found axes """Update axes with ax and return it.

    Helper function for _get_mirror_planes.
    """
ax
axes
atomcoords
groups
rtol
atol
proper_axes
nondeg_axes
normalize