Numpydoc validation - ignore setters

オープン
#494 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
documentation

調査の方向性

numpydoc validation pre-commit hookから始め、プロパティとセッターをどのように処理しているかを調べ、RT01のreturnチェックとGL08のdocstringチェックに焦点を当てます。プロパティのreturnが無視され、セッターのdocstringが必須ではなく、バリデーションが引き続き他の該当する問題を報告すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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)?

主要言語
Python
スター
354
フォーク
185
平均マージ
4分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

numpy/numpydoc のほかの issue

numpy/numpydoc の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。