aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-14 23:10:49 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-14 23:10:49 +0200
commit66e4ca88a41dccdf6bc537929ea2bd3beb2001a3 (patch)
tree06b21416f1507b969f20403777a29864ec13c09d
parent702d7900b646a9d873e6eaa4c61088c618eba9f1 (diff)
downloadee-python-66e4ca88a41dccdf6bc537929ea2bd3beb2001a3.tar.gz
ee-python-66e4ca88a41dccdf6bc537929ea2bd3beb2001a3.tar.bz2
ee-python-66e4ca88a41dccdf6bc537929ea2bd3beb2001a3.tar.xz
ee-python-66e4ca88a41dccdf6bc537929ea2bd3beb2001a3.zip
Optimizing imports.
-rw-r--r--src/ee/__main__.py2
-rw-r--r--src/ee/bom.py4
-rw-r--r--src/ee/formatting/__init__.py3
-rw-r--r--src/ee/kicad/bom/io.py1
-rw-r--r--src/ee/kicad/bom_tool/__init__.py4
-rwxr-xr-xsrc/ee/kicad/export_gerber.py7
-rw-r--r--src/ee/kicad/make_bom.py2
-rw-r--r--src/ee/kicad/model.py3
-rw-r--r--src/ee/kicad/read_schematic.py4
-rw-r--r--src/ee/kicad/to_bom.py1
-rw-r--r--src/ee/tools/import_parts_yaml.py3
-rw-r--r--src/ee/tools/init.py2
-rwxr-xr-xsrc/ee/tools/kicad_gerber.py5
-rw-r--r--src/ee/tools/kicad_make_pos.py4
-rw-r--r--src/ee/tools/kicad_mkdeps.py3
-rw-r--r--src/ee/tools/read_ltspice_raw.py4
-rw-r--r--src/ee/xml/types.py6
17 files changed, 32 insertions, 26 deletions
diff --git a/src/ee/__main__.py b/src/ee/__main__.py
index 177987d..3feec33 100644
--- a/src/ee/__main__.py
+++ b/src/ee/__main__.py
@@ -1,8 +1,8 @@
import importlib
import logging
+import os
import pkgutil
import sys
-import os
from functools import total_ordering
import ee.tools
diff --git a/src/ee/bom.py b/src/ee/bom.py
index 731f5b4..0a0225d 100644
--- a/src/ee/bom.py
+++ b/src/ee/bom.py
@@ -1,11 +1,11 @@
import os.path
import pydoc
from pathlib import Path
-from typing import List, MutableMapping, Optional
+from typing import List, Optional
from ee import EeException
-from ee.logging import log
from ee.db import ObjDb
+from ee.logging import log
from ee.part import PartDb, load_db, save_db, Part
from ee.project import Project, report, SupplierDescriptor
from ee.xml import types
diff --git a/src/ee/formatting/__init__.py b/src/ee/formatting/__init__.py
index 46e99f7..d32f7f9 100644
--- a/src/ee/formatting/__init__.py
+++ b/src/ee/formatting/__init__.py
@@ -1,5 +1,4 @@
import math
-import re
__all__ = [
'e6', 'e12', 'e24', 'e48', 'e96', 'e192',
@@ -62,8 +61,6 @@ e48 = ESeries(_e_series_48)
e96 = ESeries(_e_series_96)
e192 = ESeries(_e_series_192)
-import numpy
-
def eng_str(value, unit=None):
if value == 0:
diff --git a/src/ee/kicad/bom/io.py b/src/ee/kicad/bom/io.py
index d7c0367..afba5da 100644
--- a/src/ee/kicad/bom/io.py
+++ b/src/ee/kicad/bom/io.py
@@ -1,4 +1,5 @@
import xml.etree.ElementTree as ElementTree
+
from ee.kicad.bom import *
diff --git a/src/ee/kicad/bom_tool/__init__.py b/src/ee/kicad/bom_tool/__init__.py
index 3e28eaf..6a546a0 100644
--- a/src/ee/kicad/bom_tool/__init__.py
+++ b/src/ee/kicad/bom_tool/__init__.py
@@ -1,8 +1,10 @@
-from ee.kicad.bom import *
import functools
import itertools
+
import pandas as pd
+from ee.kicad.bom import *
+
def _none_if_empty(l):
return l if l is not None and len(l) > 0 else None
diff --git a/src/ee/kicad/export_gerber.py b/src/ee/kicad/export_gerber.py
index fb3247f..45c88c0 100755
--- a/src/ee/kicad/export_gerber.py
+++ b/src/ee/kicad/export_gerber.py
@@ -1,10 +1,13 @@
#!/usr/bin/env python2
from __future__ import print_function
-import sys
-import os
+
import argparse
+import os
+import sys
+
from pcbnew import *
+
def layer_name_parser(s):
parts = s.split('=')
if len(parts) != 2:
diff --git a/src/ee/kicad/make_bom.py b/src/ee/kicad/make_bom.py
index 8d5e6cf..dcdf96b 100644
--- a/src/ee/kicad/make_bom.py
+++ b/src/ee/kicad/make_bom.py
@@ -1,5 +1,5 @@
-import re
import pydoc
+import re
from pathlib import Path
from typing import Optional, List, Callable, Mapping
from xml.dom import minidom
diff --git a/src/ee/kicad/model.py b/src/ee/kicad/model.py
index 116d2ac..295a40a 100644
--- a/src/ee/kicad/model.py
+++ b/src/ee/kicad/model.py
@@ -1,7 +1,6 @@
import re
-from typing import List, Set
-
from functools import total_ordering
+from typing import List, Set
from ee import EeException
diff --git a/src/ee/kicad/read_schematic.py b/src/ee/kicad/read_schematic.py
index b5b4a1b..d45b9cf 100644
--- a/src/ee/kicad/read_schematic.py
+++ b/src/ee/kicad/read_schematic.py
@@ -1,7 +1,7 @@
+import os.path
import shlex
-from ee import EeException
+
from ee.kicad.model import *
-import os.path
# Reads all .sch files referenced from the given .sch file.
diff --git a/src/ee/kicad/to_bom.py b/src/ee/kicad/to_bom.py
index 6cce5a5..235bd5e 100644
--- a/src/ee/kicad/to_bom.py
+++ b/src/ee/kicad/to_bom.py
@@ -1,5 +1,6 @@
from typing import Iterable, Union
from xml.etree.ElementTree import Element
+
from ee.kicad.model import *
__all__ = ["to_bom", "to_bom_xml"]
diff --git a/src/ee/tools/import_parts_yaml.py b/src/ee/tools/import_parts_yaml.py
index 9b8e3bf..25c1b9c 100644
--- a/src/ee/tools/import_parts_yaml.py
+++ b/src/ee/tools/import_parts_yaml.py
@@ -1,8 +1,9 @@
import argparse
import sys
-import yaml
from pathlib import Path
+import yaml
+
from ee.part import PartDb, save_db
from ee.xml import types
diff --git a/src/ee/tools/init.py b/src/ee/tools/init.py
index c3d7e41..156d1b7 100644
--- a/src/ee/tools/init.py
+++ b/src/ee/tools/init.py
@@ -1,9 +1,9 @@
import argparse
+import configparser
from pathlib import Path
from typing import List
from ee.project import Project
-import configparser
def init_kicad_project(basedir: Path, cfg, args):
diff --git a/src/ee/tools/kicad_gerber.py b/src/ee/tools/kicad_gerber.py
index 7f15154..0389509 100755
--- a/src/ee/tools/kicad_gerber.py
+++ b/src/ee/tools/kicad_gerber.py
@@ -1,7 +1,8 @@
from __future__ import print_function
-import sys
-import os
+
import argparse
+import os
+import sys
try:
from pcbnew import *
diff --git a/src/ee/tools/kicad_make_pos.py b/src/ee/tools/kicad_make_pos.py
index 0b5e9b4..8986871 100644
--- a/src/ee/tools/kicad_make_pos.py
+++ b/src/ee/tools/kicad_make_pos.py
@@ -1,10 +1,10 @@
-import sys
import argparse
import csv
import datetime as dt
+import sys
+
from . import mk_parents
from ..kicad import pcb, parse_ref
-from .._utils import run_filters
parser = argparse.ArgumentParser(description="Create a pick and place file from a KiCAD schematic")
diff --git a/src/ee/tools/kicad_mkdeps.py b/src/ee/tools/kicad_mkdeps.py
index 0973416..91411d9 100644
--- a/src/ee/tools/kicad_mkdeps.py
+++ b/src/ee/tools/kicad_mkdeps.py
@@ -1,5 +1,6 @@
-import sys
import argparse
+import sys
+
import ee.kicad as kicad
out_file = sys.stdout
diff --git a/src/ee/tools/read_ltspice_raw.py b/src/ee/tools/read_ltspice_raw.py
index c5cd71b..cd837ea 100644
--- a/src/ee/tools/read_ltspice_raw.py
+++ b/src/ee/tools/read_ltspice_raw.py
@@ -1,6 +1,7 @@
-import ee.ltspice
import sys
+import ee.ltspice
+
raw = ee.ltspice.read_ltspice_raw(sys.argv[1])
# print("Variables:")
@@ -21,7 +22,6 @@ import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
-from matplotlib.ticker import FuncFormatter, MaxNLocator
fig = plt.figure()
ax = fig.add_subplot(111)
diff --git a/src/ee/xml/types.py b/src/ee/xml/types.py
index bfda4fa..9409cf2 100644
--- a/src/ee/xml/types.py
+++ b/src/ee/xml/types.py
@@ -23,11 +23,11 @@
# ee-python
#
-import sys
-import re as re_
import base64
import datetime as datetime_
-import warnings as warnings_
+import re as re_
+import sys
+
try:
from lxml import etree as etree_
except ImportError: