ERC warning for parts that are obviously incorrectly connected

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

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

評価

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

調査の方向性

Start by reading dflt_part_erc and the ERC unit tests that use mock resistors connected to themselves; the issue says the proposed check breaks 10 tests. Check how pin connectivity and Pin.types.NOCONNECT are represented, then assess whether the warning should distinguish accidental duplicate connections from valid test circuits. Done means reaching a maintainer decision and, if accepted, adding the check with updated tests.

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

説明

enhancement

Is your feature request related to a problem? Please describe.

I had a case where I was intending to do something along the lines of

ic['A'] & r1 & net 

However, I accidentally did a double assignment while making additions to code written earlier

ic[...multiple pins... 'A'] += ...multiple nets..., net
...
... quite a few lines of some other stuff
...
ic['A'] & r1 & net 

The end result was naturally that r1 was connected to net on both pins. This didn't raise any ERC warnings. OK, not unreasonable, eeschema doesn't raise any warnings from such either, but on the other hand this kind of mistake is much more obvious when viewed visually on a schematic. In fact, I noticed it from netlistsvg output.. heh.

Describe the solution you'd like
I experimented a bit with adding a check to dflt_part_erc

    # Check that the total net count is not less than two
    connected_pins = [pin for pin in part.pins if pin.do_erc and pin.net and pin.func != Pin.types.NOCONNECT]
    if len(connected_pins) >= 2:
        connected_nets = {pin.net for pin in connected_pins}
        if len(connected_nets) < 2:
            erc_logger.warning(
                "Part has {p} pins active but has only {n} nets".format(
                    p=len(connected_pins), n=len(connected_nets)
                )
            )

However this broke 10 other ERC related unit tests (quite a few tests that test other areas of the ERC by just using a single mock resistor connected to itself). Not a big deal to fix those, but I'd like a second opinion on whether this is a good idea in the first place. Any foreseeable drawbacks?

主要言語
Python
スター
1.7k
フォーク
184
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

devbisme/skidl のほかの issue

devbisme/skidl の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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