Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Grpc transition #782

Open
wants to merge 285 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
285 commits
Select commit Hold shift + click to select a range
f727158
Bondwire
svandenb-dev Sep 10, 2024
ad45a97
Terminal pass#1
svandenb-dev Sep 10, 2024
5985f6c
Terminal pass#1
svandenb-dev Sep 10, 2024
93f6e17
Terminal pass#1
svandenb-dev Sep 10, 2024
aa32ca4
grpc
svandenb-dev Sep 11, 2024
c441ad5
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 11, 2024
38fed8a
grpc
svandenb-dev Sep 11, 2024
14edfa6
grpc
svandenb-dev Sep 11, 2024
44fc86f
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 11, 2024
72de427
Merge branch 'main' into grpc-transition
svandenb-dev Sep 11, 2024
bdf457f
grpc
svandenb-dev Sep 12, 2024
4e622ef
grpc
svandenb-dev Sep 13, 2024
85bfe46
grpc
svandenb-dev Sep 13, 2024
1278ba5
grpc
svandenb-dev Sep 13, 2024
ddc4526
grpc
svandenb-dev Sep 13, 2024
90574c0
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 16, 2024
b1c85ab
Merge branch 'main' into grpc-transition
svandenb-dev Sep 16, 2024
6cc97e2
grpc
svandenb-dev Sep 16, 2024
8557233
grpc
svandenb-dev Sep 16, 2024
1acaa66
grpc
svandenb-dev Sep 16, 2024
255144e
grpc component pass #1
svandenb-dev Sep 18, 2024
d167d2d
grpc padstack pass #1
svandenb-dev Sep 19, 2024
39a58bd
grpc general pass #1
svandenb-dev Sep 19, 2024
eb684d3
grpc
svandenb-dev Sep 20, 2024
b5831ec
Merge remote-tracking branch 'origin/main'
svandenb-dev Sep 20, 2024
a1edd23
grpc
svandenb-dev Sep 20, 2024
12b5529
hfss class completed
svandenb-dev Sep 24, 2024
86dd77c
siwave class completed
svandenb-dev Sep 26, 2024
7a805be
layout validation completed
svandenb-dev Sep 26, 2024
7f65184
material completed
svandenb-dev Sep 26, 2024
4f17685
material completed
svandenb-dev Sep 26, 2024
218c8e0
modeler completed
svandenb-dev Sep 27, 2024
39cd9a4
nets completed
svandenb-dev Sep 27, 2024
28e9b4d
stackup completed
svandenb-dev Oct 1, 2024
db43e79
Merge remote-tracking branch 'origin/main'
svandenb-dev Oct 1, 2024
4b887dd
Merge branch 'main' into grpc-transition
svandenb-dev Oct 1, 2024
5a04cd7
edb completed
svandenb-dev Oct 2, 2024
dcb9a14
Merge remote-tracking branch 'origin/main'
svandenb-dev Oct 2, 2024
32075b2
Merge branch 'main' into grpc-transition
svandenb-dev Oct 2, 2024
793322a
unittest added
svandenb-dev Oct 2, 2024
9c62c88
first tests
svandenb-dev Oct 4, 2024
dbc569c
component done
svandenb-dev Oct 5, 2024
3bdfe0d
stackup connected
svandenb-dev Oct 6, 2024
bc97027
materials done
svandenb-dev Oct 7, 2024
99e2460
padstackdef done
svandenb-dev Oct 7, 2024
78493ad
padstackdef done
svandenb-dev Oct 7, 2024
d40d728
net classes done
svandenb-dev Oct 7, 2024
a1cf8d7
test #1 done
svandenb-dev Oct 7, 2024
52da4fd
test #4 done
svandenb-dev Oct 8, 2024
4324e44
test #5 done
svandenb-dev Oct 8, 2024
34b6881
test #6 done
svandenb-dev Oct 8, 2024
8fd31b4
test #7 done
svandenb-dev Oct 9, 2024
df34bc5
test #8 done
svandenb-dev Oct 9, 2024
89692f3
test #9 done
svandenb-dev Oct 9, 2024
bc1b5bf
test #10 done
svandenb-dev Oct 9, 2024
464ae38
test #11 done
svandenb-dev Oct 10, 2024
e1af7c3
test #12 done
svandenb-dev Oct 10, 2024
7441262
test #13 done
svandenb-dev Oct 11, 2024
681265e
test #14 done
svandenb-dev Oct 12, 2024
169d7dc
test #15 done
svandenb-dev Oct 13, 2024
2541950
test #16 done
svandenb-dev Oct 14, 2024
19075b0
test #17 done
svandenb-dev Oct 14, 2024
97d4b62
test #18 done
svandenb-dev Oct 14, 2024
b069d44
test #19 done
svandenb-dev Oct 15, 2024
c57303a
test #20 done
svandenb-dev Oct 15, 2024
3bd9e1a
test #21 done
svandenb-dev Oct 15, 2024
4add956
test #22 done
svandenb-dev Oct 15, 2024
2d184a1
test #23 done
svandenb-dev Oct 15, 2024
0e46a64
test #24 done
svandenb-dev Oct 16, 2024
7086282
test #25 done
svandenb-dev Oct 16, 2024
6d46384
test #26 done
svandenb-dev Oct 17, 2024
10ff73c
test #27 done
svandenb-dev Oct 17, 2024
e91e864
test #28 done
svandenb-dev Oct 17, 2024
de08380
test #29 done
svandenb-dev Oct 17, 2024
5914164
test #30 done
svandenb-dev Oct 17, 2024
5b15568
test #31 done
svandenb-dev Oct 17, 2024
af913ba
test #32 done
svandenb-dev Oct 17, 2024
b0ccc9c
test #35 done
svandenb-dev Oct 18, 2024
782bd55
test #36 done
svandenb-dev Oct 18, 2024
97ebb5e
test #37 done
svandenb-dev Oct 18, 2024
e749975
test #38 done
svandenb-dev Oct 18, 2024
e7b0c24
test #39 done
svandenb-dev Oct 18, 2024
e540642
test #40 done
svandenb-dev Oct 18, 2024
6a231ad
test #41 done
svandenb-dev Oct 18, 2024
d731876
test #42 done
svandenb-dev Oct 18, 2024
ed91d44
test #43 done
svandenb-dev Oct 20, 2024
261c2a7
test #44 done
svandenb-dev Oct 20, 2024
558a679
test #45 done
svandenb-dev Oct 21, 2024
e1c1d08
test #46 done
svandenb-dev Oct 21, 2024
552a038
test #46 done
svandenb-dev Oct 21, 2024
78dad94
test #47 done
svandenb-dev Oct 21, 2024
87c7f6f
test #48 done
svandenb-dev Oct 21, 2024
b5e4be7
test #49 done
svandenb-dev Oct 21, 2024
60e756c
test #49 done
svandenb-dev Oct 21, 2024
0fa2baa
test #50 done
svandenb-dev Oct 21, 2024
95e2105
test #51 done
svandenb-dev Oct 21, 2024
9b1bc4b
test #52 done
svandenb-dev Oct 22, 2024
1c269d4
test #53 done
svandenb-dev Oct 22, 2024
6bda3ed
test #54 done
svandenb-dev Oct 22, 2024
edf790b
test #55 done
svandenb-dev Oct 22, 2024
e86f48b
test #56 done
svandenb-dev Oct 22, 2024
de47d6f
test #57 done
svandenb-dev Oct 23, 2024
ecf555e
test #58 done
svandenb-dev Oct 23, 2024
1b76ec5
test #59 done
svandenb-dev Oct 23, 2024
b4ecf82
test #60 done
svandenb-dev Oct 23, 2024
f1e1433
test #61 done
svandenb-dev Oct 23, 2024
f51bef2
test #62 done
svandenb-dev Oct 23, 2024
0157bdf
test #62 done
svandenb-dev Oct 23, 2024
c4eb8fc
test #63 done
svandenb-dev Oct 23, 2024
f02eac3
test #64 done
svandenb-dev Oct 24, 2024
e484150
test #65 done
svandenb-dev Oct 24, 2024
9287c2a
Merge remote-tracking branch 'origin/main'
svandenb-dev Oct 24, 2024
774785d
Merge branch 'main' into grpc-transition
svandenb-dev Oct 24, 2024
80ca1ac
test #66 done
svandenb-dev Oct 24, 2024
c1b4261
test #67 done
svandenb-dev Oct 24, 2024
4595b24
test #68 done
svandenb-dev Oct 24, 2024
55a0ed5
test #69 done
svandenb-dev Oct 24, 2024
a36a134
test #70 done
svandenb-dev Oct 24, 2024
5ff34fc
test #71 done
svandenb-dev Oct 25, 2024
ad01710
Merge remote-tracking branch 'origin/main'
svandenb-dev Oct 25, 2024
6452786
test #72 done
svandenb-dev Oct 25, 2024
d91065b
test #73 done
svandenb-dev Oct 25, 2024
fcd8e74
test #74 done
svandenb-dev Oct 25, 2024
c400356
test #75 done
svandenb-dev Oct 25, 2024
bb52379
test #75 done
svandenb-dev Oct 28, 2024
b5f6c63
test #76 done
svandenb-dev Oct 28, 2024
076f95f
test #77 done
svandenb-dev Oct 28, 2024
8a7fb2d
test #78 done
svandenb-dev Oct 28, 2024
72fca6b
test #79 done
svandenb-dev Oct 28, 2024
579722b
test #80 done
svandenb-dev Oct 28, 2024
c0118e1
test #81 done
svandenb-dev Oct 28, 2024
b2171b2
test #82 done
svandenb-dev Oct 28, 2024
d45c575
test #83 done
svandenb-dev Oct 29, 2024
df81705
test #83 done
svandenb-dev Oct 29, 2024
a8a4608
test #84 done
svandenb-dev Oct 29, 2024
01ef4f4
test #85 done
svandenb-dev Oct 29, 2024
345d3d9
test #86 done
svandenb-dev Oct 29, 2024
428603e
test #87 done
svandenb-dev Oct 29, 2024
76ecfc0
test #88 done
svandenb-dev Oct 29, 2024
4a84506
test #89 done
svandenb-dev Oct 29, 2024
eca0ed0
test #90 done
svandenb-dev Oct 29, 2024
68f247b
test #91 done
svandenb-dev Oct 29, 2024
a5c5779
test #92 done
svandenb-dev Oct 29, 2024
cdf2125
test #93 done
svandenb-dev Oct 29, 2024
04d60d5
test #94 done
svandenb-dev Oct 29, 2024
693cb6c
test #95 done
svandenb-dev Oct 29, 2024
5fc8b76
test #96 done
svandenb-dev Oct 30, 2024
a74ca8f
test #96 done
svandenb-dev Oct 30, 2024
407c362
material done
svandenb-dev Oct 30, 2024
ec82da3
test #97
svandenb-dev Oct 30, 2024
e6f09c5
test #98
svandenb-dev Oct 30, 2024
75a15af
test #98
svandenb-dev Oct 30, 2024
94c913a
test #100
svandenb-dev Oct 30, 2024
65f21d2
test #101
svandenb-dev Oct 30, 2024
a330ab2
rpc init
svandenb-dev Nov 4, 2024
0f7b3df
rpc server
svandenb-dev Nov 4, 2024
7f8c8a3
rpc server
svandenb-dev Nov 4, 2024
4d47059
rpc server
svandenb-dev Nov 5, 2024
2671399
rpc server
svandenb-dev Nov 5, 2024
1e907ee
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 5, 2024
520408e
added new method to plot
Nov 6, 2024
e53668c
test #101
svandenb-dev Nov 6, 2024
396e29a
Merge remote-tracking branch 'origin/grpc-transition' into grpc-trans…
svandenb-dev Nov 6, 2024
f77d711
layout plot updated
svandenb-dev Nov 6, 2024
ee2d38d
refactor naming
Nov 6, 2024
78a4d57
test 104
svandenb-dev Nov 7, 2024
5832199
Merge remote-tracking branch 'origin/grpc-transition' into grpc-trans…
svandenb-dev Nov 7, 2024
9bfb547
Added new common class and refactored Plot method
Nov 7, 2024
8074335
Merge remote-tracking branch 'origin/grpc-transition' into grpc-trans…
Nov 7, 2024
a0dc259
Added new common class and refactored Plot method
Nov 7, 2024
31b4d8b
Added new common class and refactored Plot method
Nov 7, 2024
b6e8640
Fixed UT
Nov 7, 2024
65685f7
test 105
svandenb-dev Nov 7, 2024
c827ff1
Merge remote-tracking branch 'origin/grpc-transition' into grpc-trans…
svandenb-dev Nov 7, 2024
9d8d53b
test 110
svandenb-dev Nov 8, 2024
82ce4d5
test #112
svandenb-dev Nov 11, 2024
809dc1b
test #113
svandenb-dev Nov 11, 2024
528e476
test #114
svandenb-dev Nov 11, 2024
5f1ce9c
test #ipc
svandenb-dev Nov 12, 2024
347a3a8
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 12, 2024
7adf61c
ipc grpc
svandenb-dev Nov 13, 2024
a426330
added requirements
maxcapodi78 Nov 14, 2024
e1598fb
Merge remote-tracking branch 'origin/grpc-transition' into grpc-trans…
maxcapodi78 Nov 14, 2024
041789b
modeler
svandenb-dev Nov 14, 2024
2f050a5
Merge remote-tracking branch 'origin/grpc-transition' into grpc-trans…
svandenb-dev Nov 14, 2024
002c274
added requirements
maxcapodi78 Nov 15, 2024
2eb555b
Merge remote-tracking branch 'origin/grpc-transition' into grpc-trans…
maxcapodi78 Nov 15, 2024
6333db1
added requirements
maxcapodi78 Nov 18, 2024
f3b722d
REFACTOR: Material implementation
SMoraisAnsys Nov 19, 2024
3d41455
test modeler duplicate
svandenb-dev Nov 19, 2024
9e9cdb9
test modeler #2
svandenb-dev Nov 19, 2024
b816d30
test modeler #arbitrary waveports
svandenb-dev Nov 19, 2024
8c05252
test modeler #arbitrary waveports
svandenb-dev Nov 19, 2024
51ccefd
test modeler #4
svandenb-dev Nov 20, 2024
c9fec95
test modeler #5
svandenb-dev Nov 20, 2024
bab36db
test modeler #6
svandenb-dev Nov 20, 2024
6bcbfcc
test modeler #7
svandenb-dev Nov 20, 2024
8bfea31
test materials completed
svandenb-dev Nov 20, 2024
650c471
test materials completed
svandenb-dev Nov 20, 2024
81ce149
test materials completed
svandenb-dev Nov 21, 2024
5cc5819
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 21, 2024
ed49db0
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 21, 2024
844ab32
mesh op fix
svandenb-dev Nov 21, 2024
1eb4ee3
custom cutout 0 fixed
svandenb-dev Nov 21, 2024
db0e205
component
svandenb-dev Nov 22, 2024
50a1bc5
test #110
svandenb-dev Nov 25, 2024
bdc333d
test #111
svandenb-dev Nov 25, 2024
a27cc9f
test #112
svandenb-dev Nov 25, 2024
dd46f74
test #113
svandenb-dev Nov 25, 2024
d45b08b
test #114
svandenb-dev Nov 25, 2024
aa71a36
test #115
svandenb-dev Nov 25, 2024
eb5cd52
test #116
svandenb-dev Nov 26, 2024
62e6d30
test #117
svandenb-dev Nov 26, 2024
2700693
test #118
svandenb-dev Nov 27, 2024
c073283
test #119
svandenb-dev Nov 28, 2024
17d96c7
test #120
svandenb-dev Nov 28, 2024
80bc162
test #121
svandenb-dev Nov 29, 2024
28b65e1
Merge remote-tracking branch 'origin/main'
svandenb-dev Nov 29, 2024
77623dd
test #120
svandenb-dev Dec 2, 2024
43a700e
test #121
svandenb-dev Dec 2, 2024
a73662b
Merge remote-tracking branch 'origin/main'
svandenb-dev Dec 2, 2024
d03ebb9
test #130
svandenb-dev Dec 6, 2024
1bf8e2c
test #131
svandenb-dev Dec 6, 2024
63da3c3
test #132
svandenb-dev Dec 9, 2024
2bd0885
test #133
svandenb-dev Dec 9, 2024
8b26cdf
test #134
svandenb-dev Dec 10, 2024
851f964
test #134
svandenb-dev Dec 11, 2024
054467d
Merge remote-tracking branch 'origin/main'
svandenb-dev Dec 11, 2024
cd20577
new feature via clustering
svandenb-dev Dec 13, 2024
f8ce314
main
svandenb-dev Dec 13, 2024
bf6731f
Merge remote-tracking branch 'origin/main'
svandenb-dev Dec 17, 2024
cfb31f2
Merge remote-tracking branch 'origin/main'
svandenb-dev Dec 17, 2024
def8208
Merge branch 'main' into grpc-transition
svandenb-dev Dec 17, 2024
6ff5c45
Merge remote-tracking branch 'origin/main'
svandenb-dev Dec 18, 2024
490037f
Merge remote-tracking branch 'origin/main'
svandenb-dev Dec 20, 2024
c6d6763
Merge remote-tracking branch 'origin/main'
svandenb-dev Jan 7, 2025
fe693db
Merge remote-tracking branch 'origin/main'
svandenb-dev Jan 10, 2025
dea5354
Merge remote-tracking branch 'origin/main'
svandenb-dev Jan 14, 2025
424e3d0
edbcore doc removing
svandenb-dev Jan 16, 2025
f6be6d0
Merge remote-tracking branch 'origin/main'
svandenb-dev Jan 16, 2025
b889019
Merge branch 'main' into grpc-transition
svandenb-dev Jan 16, 2025
89935b3
edbcore doc removing
svandenb-dev Jan 16, 2025
4504f24
bug fix
svandenb-dev Jan 27, 2025
7aab401
grpc
svandenb-dev Jan 28, 2025
0a3a89f
grpc
svandenb-dev Jan 28, 2025
07a71e5
Fixed grpc layer construction
drewm102 Jan 28, 2025
ee53c8d
grpc
svandenb-dev Jan 29, 2025
785836d
Merge branch 'grpc-transition_dm_lyr_ctor_fix_0' into grpc-transition
svandenb-dev Jan 29, 2025
3e1453c
grpc
svandenb-dev Jan 29, 2025
ab2fcbf
grpc
svandenb-dev Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ testing:

grpc-transition:
- changed-files:
- any-glob-to-any-file: ['src/pyedb/dotnet/edb_core/*',]
- any-glob-to-any-file: ['src/pyedb/dotnet/database/*',]
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ coverage:
ignore:
- "examples" # ignore folders and all its contents
- "tests" # ignore folders and all its contents
- "src/pyedb/legacy/edb_core/siwave.py" # ignore folders and all its contents
- "src/pyedb/legacy/database/siwave.py" # ignore folders and all its contents
- "src/pyedb/misc/*.py" # ignore folders and all its contents
2 changes: 1 addition & 1 deletion doc/source/api/CoreEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This section lists the core EDB modules for reading and writing information
to AEDB files.


.. currentmodule:: pyedb.dotnet.edb_core
.. currentmodule:: pyedb.dotnet.database

.. autosummary::
:toctree: _autosummary
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/SimulationConfigurationEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Simulation configuration
These classes are the containers of simulation configuration constructors for the EDB.


.. currentmodule:: pyedb.dotnet.edb_core.edb_data.simulation_configuration
.. currentmodule:: pyedb.dotnet.database.edb_data.simulation_configuration

.. autosummary::
:toctree: _autosummary
Expand Down
2 changes: 1 addition & 1 deletion examples/legacy_standalone/10_GDS_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import tempfile

import pyedb
from pyedb.dotnet.edb_core.edb_data.control_file import ControlFile
from pyedb.dotnet.database.edb_data.control_file import ControlFile
from pyedb.misc.downloads import download_file

# -
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ dependencies = [
"pydantic>=2.6.4,<2.11",
"Rtree >= 1.2.0",
"toml == 0.10.2",
"scikit-rf"
"scikit-rf",
"ansys-edb-core",
"ansys-api-edb",
"psutil",
]

[project.optional-dependencies]
Expand Down
191 changes: 53 additions & 138 deletions src/pyedb/common/nets.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,9 @@
import math
import os
import time

from pyedb.generic.constants import CSS4_COLORS


def is_notebook():
"""Check if pyaedt is running in Jupyter or not.

Returns
-------
bool
"""
try:
shell = get_ipython().__class__.__name__
if shell in ["ZMQInteractiveShell"]: # pragma: no cover
return True # Jupyter notebook or qtconsole
else:
return False
except NameError:
return False # Probably standard Python interpreter


def is_ipython():
"""Check if pyaedt is running in Jupyter or not.

Returns
-------
bool
"""
try:
shell = get_ipython().__class__.__name__
if shell in ["TerminalInteractiveShell", "SpyderShell"]:
return True # Jupyter notebook or qtconsole
else: # pragma: no cover
return False
except NameError:
return False # Probably standard Python interpreter


class CommonNets:
def __init__(self, _pedb):
self._pedb = _pedb
Expand All @@ -57,8 +22,6 @@ def plot(
show=True,
annotate_component_names=True,
plot_vias=False,
include_outline=True,
plot_edges=True,
**kwargs,
):
"""Plot a Net to Matplotlib 2D Chart.
Expand All @@ -79,7 +42,7 @@ def plot(
If a path is specified the plot will be saved in this location.
If ``save_plot`` is provided, the ``show`` parameter is ignored.
outline : list, optional
Add a customer outline from a list of points of the outline to plot.
List of points of the outline to plot.
size : tuple, int, optional
Image size in pixel (width, height). Default value is ``(6000, 3000)``
top_view : bool, optional
Expand All @@ -96,10 +59,6 @@ def plot(
Default is ``False``.
show : bool, optional
Whether to show the plot or not. Default is `True`.
include_outline : bool, optional
Whether to include the internal layout outline or not. Default is `True`.
plot_edges : bool, optional
Whether to plot polygon edges or not. Default is `True`.

Returns
-------
Expand All @@ -118,30 +77,22 @@ def mirror_poly(poly):
sign = -1
return [[sign * i[0], i[1]] for i in poly]

try:
import matplotlib.pyplot as plt
except ImportError: # pragma: no cover
self._pedb.logger.error("Matplotlib is needed. Please, install it first.")
return False
import matplotlib.pyplot as plt

dpi = 100.0
figsize = (size[0] / dpi, size[1] / dpi)

fig = plt.figure(figsize=figsize)
ax = fig.add_subplot(1, 1, 1)
try:
from shapely import affinity, union_all
from shapely.geometry import (
LinearRing,
MultiLineString,
MultiPolygon,
Point,
Polygon,
)
from shapely.plotting import plot_line, plot_polygon
except ImportError: # pragma: no cover
self._pedb.logger.error("Shapely is needed. Please, install it first.")
return False
from shapely import affinity
from shapely.geometry import (
LinearRing,
MultiLineString,
MultiPolygon,
Point,
Polygon,
)
from shapely.plotting import plot_line, plot_polygon

start_time = time.time()
if not nets:
Expand All @@ -154,33 +105,19 @@ def mirror_poly(poly):
layers = [layers]
color_index = 0
label_colors = {}
edge_colors = {}
if outline:
poly = Polygon(outline)
plot_line(poly.boundary, add_points=False, color=(0.7, 0, 0), linewidth=4)
elif include_outline:
prims = self._pedb.modeler.primitives_by_layer.get("Outline", [])
if prims:
for prim in prims:
if prim.is_void:
continue
xt, yt = prim.points()
p1 = [(i, j) for i, j in zip(xt[::-1], yt[::-1])]
p1 = mirror_poly(p1)
poly = LinearRing(p1)
plot_line(poly, add_points=False, color=(0.7, 0, 0), linewidth=4)
else:
bbox = self._pedb.hfss.get_layout_bounding_box()
if not bbox:
return False, False
x1 = bbox[0]
x2 = bbox[2]
y1 = bbox[1]
y2 = bbox[3]
p = [(x1, y1), (x1, y2), (x2, y2), (x2, y1), (x1, y1)]
p = mirror_poly(p)
poly = LinearRing(p)
plot_line(poly, add_points=False, color=(0.7, 0, 0), linewidth=4)
else:
bbox = self._pedb.hfss.get_layout_bounding_box()
x1 = bbox[0]
x2 = bbox[2]
y1 = bbox[1]
y2 = bbox[3]
p = [(x1, y1), (x1, y2), (x2, y2), (x2, y1), (x1, y1)]
p = mirror_poly(p)
poly = LinearRing(p)
plot_line(poly, add_points=False, color=(0.7, 0, 0), linewidth=4)
layer_colors = {i: k.color for i, k in self._pedb.stackup.layers.items()}
top_layer = list(self._pedb.stackup.signal_layers.keys())[0]
bottom_layer = list(self._pedb.stackup.signal_layers.keys())[-1]
Expand Down Expand Up @@ -310,24 +247,14 @@ def create_poly(prim, polys, lines):
# poly = LineString(line).buffer(prim.width / 2)
# else:
xt, yt = prim.points()
if len(xt) < 3:
return
p1 = [(i, j) for i, j in zip(xt[::-1], yt[::-1])]
p1 = mirror_poly(p1)

holes = []
for void in prim.voids:
xvt, yvt = void.points(arc_segments=3)
if len(xvt) < 3:
continue
h1 = mirror_poly([(i, j) for i, j in zip(xvt, yvt)])
holes.append(h1)
if len(holes) > 1:
holes = union_all([Polygon(i) for i in holes])
if isinstance(holes, MultiPolygon):
holes = [i.boundary for i in list(holes.geoms)]
else:
holes = [holes.boundary]
poly = Polygon(p1, holes)
if layer_name == "Outline":
if label_colors[label] in lines:
Expand All @@ -338,36 +265,33 @@ def create_poly(prim, polys, lines):

if color_by_net:
for net in nets:
prims = self._pedb.nets.nets[net].primitives
polys = []
lines = []
if net not in nets:
continue
label = "Net " + net
label_colors[label] = list(CSS4_COLORS.keys())[color_index]
try:
edge_colors[label] = [i * 0.5 for i in label_colors[label]]
except TypeError:
edge_colors[label] = label_colors[label]
color_index += 1
if color_index >= len(CSS4_COLORS):
color_index = 0
for prim in prims:
create_poly(prim, polys, lines)
if polys:
ob = MultiPolygon(polys)
plot_polygon(
ob,
ax=ax,
color=label_colors[label],
add_points=False,
alpha=0.7,
label=label,
edgecolor="none" if not plot_edges else edge_colors[label],
)
if lines:
ob = MultiLineString(p)
plot_line(ob, ax=ax, add_points=False, color=label_colors[label], linewidth=1, label=label)
if net in self._pedb.nets.nets:
prims = self._pedb.nets.nets[net].primitives
polys = []
lines = []
if net not in nets:
continue
label = "Net " + net
label_colors[label] = list(CSS4_COLORS.keys())[color_index]
color_index += 1
if color_index >= len(CSS4_COLORS):
color_index = 0
for prim in prims:
create_poly(prim, polys, lines)
if polys:
ob = MultiPolygon(polys)
plot_polygon(
ob,
ax=ax,
color=label_colors[label],
add_points=False,
alpha=0.7,
label=label,
edgecolor="none",
)
if lines:
ob = MultiLineString(p)
plot_line(ob, ax=ax, add_points=False, color=label_colors[label], linewidth=1, label=label)
else:
prims_by_layers_dict = {i: j for i, j in self._pedb.modeler.primitives_by_layer.items()}
if not top_view:
Expand Down Expand Up @@ -397,10 +321,6 @@ def create_poly(prim, polys, lines):
if color_index >= len(CSS4_COLORS):
color_index = 0
label_colors[label] = c
try:
edge_colors[label] = [i * 0.5 for i in c]
except TypeError:
edge_colors[label] = label_colors[label]
for prim in prims:
create_poly(prim, polys, lines)
if polys:
Expand All @@ -412,7 +332,7 @@ def create_poly(prim, polys, lines):
add_points=False,
alpha=alpha,
label=label,
edgecolor="none" if not plot_edges else edge_colors[label],
edgecolor="none",
)
if lines:
ob = MultiLineString(p)
Expand Down Expand Up @@ -480,15 +400,10 @@ def create_poly(prim, polys, lines):
plt.title(message, size=20)
if show_legend:
plt.legend(loc="upper left", fontsize="x-large")
end_time = time.time() - start_time
self._logger.info(f"Plot Generation time {round(end_time, 3)}")
if save_plot:
plt.savefig(save_plot)
if show: # pragma: no cover
if is_notebook():
pass
elif is_ipython() or "PYTEST_CURRENT_TEST" in os.environ:
fig.show()
else:
plt.show()
elif show:
plt.show()
end_time = time.time() - start_time
self._logger.info(f"Plot Generation time {round(end_time, 3)}")
return fig, ax
2 changes: 1 addition & 1 deletion src/pyedb/configuration/cfg_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SOFTWARE.

from pyedb.configuration.cfg_common import CfgBase
from pyedb.dotnet.edb_core.general import pascal_to_snake, snake_to_pascal
from pyedb.dotnet.database.general import pascal_to_snake, snake_to_pascal


class CfgComponent(CfgBase):
Expand Down
6 changes: 4 additions & 2 deletions src/pyedb/configuration/cfg_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ def __init__(self, pedb, data):
self.suppress_pads = data.get("suppress_pads", True)

def apply(self):
self._pedb.design_options.antipads_always_on = self.anti_pads_always_on
self._pedb.design_options.suppress_pads = self.suppress_pads
# TODO check if design_options features exists in grpc
# self._pedb.design_options.antipads_always_on = self.anti_pads_always_on
# self._pedb.design_options.suppress_pads = self.suppress_pads
pass

def get_data_from_db(self):
self.anti_pads_always_on = self._pedb.design_options.antipads_always_on
Expand Down
2 changes: 1 addition & 1 deletion src/pyedb/configuration/cfg_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from pyedb.configuration.cfg_components import CfgComponent
from pyedb.configuration.cfg_padstacks import CfgPadstackDefinition, CfgPadstackInstance
from pyedb.dotnet.edb_core.edb_data.padstacks_data import EDBPadstack
from pyedb.dotnet.database.edb_data.padstacks_data import EDBPadstack


class CfgTrace:
Expand Down
2 changes: 1 addition & 1 deletion src/pyedb/configuration/cfg_package_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SOFTWARE.

from pyedb.configuration.cfg_common import CfgBase
from pyedb.dotnet.edb_core.definition.package_def import PackageDef
from pyedb.dotnet.database.definition.package_def import PackageDef


class CfgPackage(CfgBase):
Expand Down
2 changes: 1 addition & 1 deletion src/pyedb/configuration/cfg_padstacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SOFTWARE.

from pyedb.configuration.cfg_common import CfgBase
from pyedb.dotnet.edb_core.general import (
from pyedb.dotnet.database.general import (
convert_py_list_to_net_list,
pascal_to_snake,
snake_to_pascal,
Expand Down
Loading