summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2019-11-25 15:45:47 -0300
committerGitHub <noreply@github.com>2019-11-25 15:45:47 -0300
commit0a45f0ae5770f5975d0f1c85d38cc737a00cc4d1 (patch)
tree4cc45b51f961285ac43ba429a174778f39bd86cc
parentc87bad8dedc0ea2a52171840d24451e2117c8325 (diff)
parent2830fd268dbcdc52fdf67221a00e3a72cb4e9cb9 (diff)
downloadgerbonara-0a45f0ae5770f5975d0f1c85d38cc737a00cc4d1.tar.gz
gerbonara-0a45f0ae5770f5975d0f1c85d38cc737a00cc4d1.tar.bz2
gerbonara-0a45f0ae5770f5975d0f1c85d38cc737a00cc4d1.zip
Merge branch 'master' into patch-1
-rw-r--r--.travis.yml3
-rw-r--r--README.md4
-rw-r--r--doc-requirements.txt4
-rw-r--r--gerber/excellon_statements.py11
-rw-r--r--gerber/utils.py4
-rw-r--r--requirements-dev.txt5
-rw-r--r--requirements-docs.txt6
-rw-r--r--requirements.txt2
-rw-r--r--test-requirements.txt4
9 files changed, 25 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml
index 725a0b0..1226075 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,8 +10,7 @@ python:
# command to install dependencies
install:
- - "pip install -r requirements.txt"
- - "pip install -r test-requirements.txt"
+ - "pip install -r requirements-dev.txt"
- "pip install coveralls"
# command to run tests
diff --git a/README.md b/README.md
index f741f80..42c90f4 100644
--- a/README.md
+++ b/README.md
@@ -48,11 +48,11 @@ Documentation:
Development and Testing:
------------------------
-Dependencies for developing and testing pcb-tools are listed in test-requirements.txt. Use of a virtual environment is strongly recommended.
+Dependencies for developing and testing pcb-tools are listed in requirements-dev.txt. Use of a virtual environment is strongly recommended.
$ virtualenv venv
$ source venv/bin/activate
- (venv)$ pip install -r test-requirements.txt
+ (venv)$ pip install -r requirements-dev.txt
(venv)$ pip install -e .
We use nose to run pcb-tools's suite of unittests and doctests.
diff --git a/doc-requirements.txt b/doc-requirements.txt
deleted file mode 100644
index a163c9b..0000000
--- a/doc-requirements.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Doc requirements
-Sphinx==1.2.3
-numpydoc==0.5
-
diff --git a/gerber/excellon_statements.py b/gerber/excellon_statements.py
index bcf35e4..2c50ef9 100644
--- a/gerber/excellon_statements.py
+++ b/gerber/excellon_statements.py
@@ -23,6 +23,7 @@ Excellon Statements
import re
import uuid
+import itertools
from .utils import (parse_gerber_value, write_gerber_value, decimal_string,
inch, metric)
@@ -151,8 +152,7 @@ class ExcellonTool(ExcellonStatement):
tool : Tool
An ExcellonTool representing the tool defined in `line`
"""
- commands = re.split('([BCFHSTZ])', line)[1:]
- commands = [(command, value) for command, value in pairwise(commands)]
+ commands = pairwise(re.split('([BCFHSTZ])', line)[1:])
args = {}
args['id'] = id
nformat = settings.format
@@ -973,6 +973,7 @@ def pairwise(iterator):
e.g. [1, 2, 3, 4, 5, 6] ==> [(1, 2), (3, 4), (5, 6)]
"""
- itr = iter(iterator)
- while True:
- yield tuple([next(itr) for i in range(2)])
+ a, b = itertools.tee(iterator)
+ itr = zip(itertools.islice(a, 0, None, 2), itertools.islice(b, 1, None, 2))
+ for elem in itr:
+ yield elem
diff --git a/gerber/utils.py b/gerber/utils.py
index 817a36e..3d39df9 100644
--- a/gerber/utils.py
+++ b/gerber/utils.py
@@ -123,6 +123,10 @@ def write_gerber_value(value, format=(2, 5), zero_suppression='trailing'):
value : string
The specified value as a Gerber/Excellon-formatted string.
"""
+
+ if format[0] == float:
+ return "%f" %value
+
# Format precision
integer_digits, decimal_digits = format
MAX_DIGITS = integer_digits + decimal_digits
diff --git a/requirements-dev.txt b/requirements-dev.txt
new file mode 100644
index 0000000..c1e695d
--- /dev/null
+++ b/requirements-dev.txt
@@ -0,0 +1,5 @@
+# install base requirements
+-r requirements.txt
+
+coverage==4.5.4
+nose==1.3.7
diff --git a/requirements-docs.txt b/requirements-docs.txt
new file mode 100644
index 0000000..a2cc5a1
--- /dev/null
+++ b/requirements-docs.txt
@@ -0,0 +1,6 @@
+# install base requirements
+-r requirements.txt
+
+# documentation generation support
+Sphinx==1.2.3
+numpydoc==0.5
diff --git a/requirements.txt b/requirements.txt
index a7f5f01..1f769f2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
-## The following requirements were added by pip --freeze:
+# cairo rendering support
cairocffi==0.6
diff --git a/test-requirements.txt b/test-requirements.txt
deleted file mode 100644
index 826da33..0000000
--- a/test-requirements.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Test requirements
-cairocffi==0.6
-coverage==3.7.1
-nose==1.3.4