jacobnzw / SSMToybox

Nonlinear Sigma-Point Kalman Filters based on Bayesian Quadrature
MIT License
12 stars 0 forks source link

Move class docs to the __init__ method #26

Open jacobnzw opened 3 years ago

jacobnzw commented 3 years ago

For example, docs like these

class GaussianProcessTransform(BQTransform):
    """
    Gaussian process quadrature moment transform.

    Parameters
    ----------
    dim_in : int
        Dimensionality of the input.

    kern_par : ndarray
        Kernel parameters.

    kern_str : str {'rbf'}
        Kernel of the integrand model.

    point_str : str {'ut', 'sr', 'gh', 'fs'}
        Sigma-point set for representing the input probability density.

    point_par : dict
        Sigma-point set parameters.
    """
    def __init__(self, dim_in, dim_out, kern_par, kern_str='rbf', point_str='ut', point_par=None, estimate_par=False):
        super(GaussianProcessTransform, self).__init__(dim_in, dim_out, kern_par, 'gp', kern_str, point_str, point_par,
                                                       estimate_par)
        # BQ transform weights for the mean, covariance and cross-covariance
        self.wm, self.Wc, self.Wcc = self.weights(kern_par)

should be moved to __init__(), like this:

class GaussianProcessTransform(BQTransform):

    def __init__(self, dim_in, dim_out, kern_par, kern_str='rbf', point_str='ut', point_par=None, estimate_par=False):
        """
        Gaussian process quadrature moment transform.

        Parameters
        ----------
        dim_in : int
            Dimensionality of the input.

        kern_par : ndarray
            Kernel parameters.

        kern_str : str {'rbf'}
            Kernel of the integrand model.

        point_str : str {'ut', 'sr', 'gh', 'fs'}
            Sigma-point set for representing the input probability density.

        point_par : dict
            Sigma-point set parameters.
        """
        super(GaussianProcessTransform, self).__init__(dim_in, dim_out, kern_par, 'gp', kern_str, point_str, point_par,
                                                       estimate_par)
        # BQ transform weights for the mean, covariance and cross-covariance
        self.wm, self.Wc, self.Wcc = self.weights(kern_par)

The documentation doesn't show up in the PyCharm hints otherwise.