diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-02-21 08:18:52 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-02-21 08:21:06 +0100 |
commit | b9c8e02072ea6da04ddc9fe9795f699697f25d07 (patch) | |
tree | e4c71df9d67a7e535cb7ab81aeea3cb27b974a33 /src/ee/kicad/__init__.py | |
parent | 3937c49feaca7883f025b4f4e86958dc1ada09fe (diff) | |
download | ee-python-b9c8e02072ea6da04ddc9fe9795f699697f25d07.tar.gz ee-python-b9c8e02072ea6da04ddc9fe9795f699697f25d07.tar.bz2 ee-python-b9c8e02072ea6da04ddc9fe9795f699697f25d07.tar.xz ee-python-b9c8e02072ea6da04ddc9fe9795f699697f25d07.zip |
o Reformat.
to_bom: export to_tom_xml too.
model:
o More type annotations.
o Parse ref_type and ref_num when constructed.
Diffstat (limited to 'src/ee/kicad/__init__.py')
-rw-r--r-- | src/ee/kicad/__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ee/kicad/__init__.py b/src/ee/kicad/__init__.py index 1492fc4..d28dcdc 100644 --- a/src/ee/kicad/__init__.py +++ b/src/ee/kicad/__init__.py @@ -1,10 +1,9 @@ from typing import Any -from ee import EeException from ee.kicad.read_schematic import read_schematic, read_schematics from ee.kicad.to_bom import to_bom, to_bom_xml -from .._utils import run_filters from .model import * +from .._utils import run_filters __all__ = [ "Component", @@ -18,19 +17,20 @@ __all__ = [ "to_pandas", ] + def parse_ref(ref): m = parse_ref.r.match(ref) if not m: return g = m.groups() -# print("groups={}".format(g)) - return (g[0], None if g[1] == "?" else int(g[1])) + return g[0], None if g[1] == "?" else int(g[1]) + parse_ref.r = re.compile("([^0-9]+)([0-9]+|\?)$") + def to_pandas(obj: Any, **kwarg): import pandas - import numpy as np def to_pandas_schematics(ss: Schematics): dfs = [to_pandas_schematic(schematic) for schematic in ss.schematics] |