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

Numpydoc validation - ignore setters #494

Open
akaszynski opened this issue Aug 19, 2023 · 0 comments
Open

Numpydoc validation - ignore setters #494

akaszynski opened this issue Aug 19, 2023 · 0 comments

Comments

@akaszynski
Copy link

Excellent work on implementing the numpydoc validation as a pre-commit hook.

I've noticed that it is flagging getters and sellers. For example:

    @property
    def x(self) -> np.ndarray:
        """Return or set the coordinates along the X-direction.

        Examples
        --------
        Return the x coordinates of a RectilinearGrid.

        >>> import numpy as np
        >>> import pyvista
        >>> xrng = np.arange(-10, 10, 10, dtype=float)
        >>> yrng = np.arange(-10, 10, 10, dtype=float)
        >>> zrng = np.arange(-10, 10, 10, dtype=float)
        >>> grid = pyvista.RectilinearGrid(xrng, yrng, zrng)
        >>> grid.x
        array([-10.,   0.])

        Set the x coordinates of a RectilinearGrid.

        >>> grid.x = [-10.0, 0.0, 10.0]
        >>> grid.x
        array([-10.,   0.,  10.])

        """
        return convert_array(self.GetXCoordinates())

    @x.setter
    def x(self, coords: Sequence):
        self.SetXCoordinates(convert_array(coords))
        self._update_dimensions()
        self.Modified()

Is it possible to ignore the returns (RT01) of properties and the docstring all together of setters (GL08)?

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

No branches or pull requests

1 participant