plotly / plotly/plotly.py

useless line in the _Quiver class definition

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

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

bug P3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

In the _Quiver class definition (more precisely within the body of one of its methods) there is a useless line https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/figure_factory/_quiver.py#L257 which just leads to repeating the calculations of the elements in the four lists under the for loop:

for index in range(len(self.end_x)):
    point1_x = [i - j * self.scaleratio for i, j in zip(self.end_x, seg1_x)]
    point1_y = [i - j for i, j in zip(self.end_y, seg1_y)]
    point2_x = [i - j * self.scaleratio for i, j in zip(self.end_x, seg2_x)]
    point2_y = [i - j for i, j in zip(self.end_y, seg2_y)]

The for line must be removed and the next four lines moved a tab at left.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

packages/python/plotly/plotly/figure_factory/_quiver.py の257行目を開き、周辺の _Quiver メソッドを確認してください。ループ行を削除し、指定された4つの代入を要求どおり外側に移動してください。各インデックスごとに繰り返すのではなく、計算が1回だけ実行されれば完了です。その後、既存の quiver の動作を確認してください。

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

評価

技術スタック
python
領域
data-visualization
issue の種類
リファクタリング
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

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

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