Skip to content

Commit

Permalink
Merge pull request #114 from LibrePCB/use-numpy-instead-of-numpy-stubs
Browse files Browse the repository at this point in the history
Remove direct numpy dependency
  • Loading branch information
rnestler authored Sep 11, 2023
2 parents d6619be + 27f7744 commit dc0e4bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions generate_dfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

from typing import List, Optional

import numpy as np

from common import format_float as ff
from common import format_ipc_dimension as fd
from common import init_cache, now, save_cache
Expand Down Expand Up @@ -202,7 +200,7 @@ def _generate_footprint(key: str, name: str, pad_extension: float) -> None:

# Measure clearance pad-exposed pad
clearance = abs(pad_pos_x) - (pad_length / 2) - (exposed_length / 2)
if np.around(clearance, decimals=2) < MIN_CLEARANCE:
if round(clearance, ndigits=2) < MIN_CLEARANCE:
print("Warning: minimal clearance violated in {}: {:.4f} < {:.2f}".format(full_name, clearance, MIN_CLEARANCE))

# Create Silk Screen (lines and dot only)
Expand All @@ -215,7 +213,7 @@ def _generate_footprint(key: str, name: str, pad_extension: float) -> None:
silk_top_line_height = config.length / 2
if make_exposed:
silk_clearance = silk_top_line_height - (SILKSCREEN_LINE_WIDTH / 2) - (config.exposed_width / 2)
if np.around(silk_clearance, decimals=2) < SILKSCREEN_OFFSET:
if round(silk_clearance, ndigits=2) < SILKSCREEN_OFFSET:
silk_top_line_height = silk_top_line_height + (SILKSCREEN_OFFSET - silk_clearance)
silk_down = silk_down + (SILKSCREEN_OFFSET - silk_clearance)
print("Increasing exp-silk clearance from {:.4f} to {:.2f}".format(silk_clearance, SILKSCREEN_OFFSET))
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pytest~=6.2.5
flake8~=4.0.1
mypy==1.5.1
git+https://github.com/numpy/numpy-stubs
isort~=5.10.1
cadquery==2.3.1

0 comments on commit dc0e4bd

Please sign in to comment.