From 8d7c1f320544d47e5715dbd544f7bd29baeafef0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 10 Nov 2017 13:42:51 +0100 Subject: o Only include ref_num fields in the DataFrame if the symbol is annotated. --- src/ee/kicad/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ee/kicad/__init__.py b/src/ee/kicad/__init__.py index b51e7db..d949fbe 100644 --- a/src/ee/kicad/__init__.py +++ b/src/ee/kicad/__init__.py @@ -45,10 +45,11 @@ def to_pandas(obj: Any, **kwarg): fields = { "ref": c.ref, "ref_type": c.ref_type, - "ref_num": c.ref_num, "value": c.value, "footprint": c.footprint, } + if c.has_ref_num: + fields["ref_num"] = c.ref_num fields.update({f.name: f.value for f in c.fields if f.is_custom}) return fields -- cgit v1.2.3