Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move class docs to the __init__ method #26

Open
jacobnzw opened this issue Jun 30, 2021 · 0 comments
Open

Move class docs to the __init__ method #26

jacobnzw opened this issue Jun 30, 2021 · 0 comments

Comments

@jacobnzw
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant