def portfolio_vol(weights, covmat):
    """
    :param weights:  weights are a numpy array or N x 1 maxtrix
    :param covmat: covmat is an N x N matrix
    :return: Computes the vol of a portfolio from a covariance matrix and constituent weights
    """
    return (weights.T @ covmat @ weights) ** 0.5