pyedb 0.34.1__py3-none-any.whl → 0.34.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyedb might be problematic. Click here for more details.
- pyedb/__init__.py +1 -1
- pyedb/common/nets.py +19 -13
- pyedb/configuration/cfg_components.py +1 -1
- pyedb/dotnet/clr_module.py +39 -57
- pyedb/dotnet/edb_core/layout_validation.py +1 -1
- {pyedb-0.34.1.dist-info → pyedb-0.34.3.dist-info}/METADATA +1 -1
- {pyedb-0.34.1.dist-info → pyedb-0.34.3.dist-info}/RECORD +9 -9
- {pyedb-0.34.1.dist-info → pyedb-0.34.3.dist-info}/LICENSE +0 -0
- {pyedb-0.34.1.dist-info → pyedb-0.34.3.dist-info}/WHEEL +0 -0
pyedb/__init__.py
CHANGED
pyedb/common/nets.py
CHANGED
|
@@ -2,8 +2,6 @@ import math
|
|
|
2
2
|
import os
|
|
3
3
|
import time
|
|
4
4
|
|
|
5
|
-
import shapely
|
|
6
|
-
|
|
7
5
|
from pyedb.generic.constants import CSS4_COLORS
|
|
8
6
|
|
|
9
7
|
|
|
@@ -120,22 +118,30 @@ class CommonNets:
|
|
|
120
118
|
sign = -1
|
|
121
119
|
return [[sign * i[0], i[1]] for i in poly]
|
|
122
120
|
|
|
123
|
-
|
|
121
|
+
try:
|
|
122
|
+
import matplotlib.pyplot as plt
|
|
123
|
+
except ImportError: # pragma: no cover
|
|
124
|
+
self._pedb.logger.error("Matplotlib is needed. Please, install it first.")
|
|
125
|
+
return False
|
|
124
126
|
|
|
125
127
|
dpi = 100.0
|
|
126
128
|
figsize = (size[0] / dpi, size[1] / dpi)
|
|
127
129
|
|
|
128
130
|
fig = plt.figure(figsize=figsize)
|
|
129
131
|
ax = fig.add_subplot(1, 1, 1)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
try:
|
|
133
|
+
from shapely import affinity, union_all
|
|
134
|
+
from shapely.geometry import (
|
|
135
|
+
LinearRing,
|
|
136
|
+
MultiLineString,
|
|
137
|
+
MultiPolygon,
|
|
138
|
+
Point,
|
|
139
|
+
Polygon,
|
|
140
|
+
)
|
|
141
|
+
from shapely.plotting import plot_line, plot_polygon
|
|
142
|
+
except ImportError: # pragma: no cover
|
|
143
|
+
self._pedb.logger.error("Shapely is needed. Please, install it first.")
|
|
144
|
+
return False
|
|
139
145
|
|
|
140
146
|
start_time = time.time()
|
|
141
147
|
if not nets:
|
|
@@ -317,7 +323,7 @@ class CommonNets:
|
|
|
317
323
|
h1 = mirror_poly([(i, j) for i, j in zip(xvt, yvt)])
|
|
318
324
|
holes.append(h1)
|
|
319
325
|
if len(holes) > 1:
|
|
320
|
-
holes =
|
|
326
|
+
holes = union_all([Polygon(i) for i in holes])
|
|
321
327
|
if isinstance(holes, MultiPolygon):
|
|
322
328
|
holes = [i.boundary for i in list(holes.geoms)]
|
|
323
329
|
else:
|
|
@@ -201,7 +201,7 @@ class CfgComponent(CfgBase):
|
|
|
201
201
|
if height:
|
|
202
202
|
port_prop.SetReferenceHeight(self._pedb.edb_value(height))
|
|
203
203
|
reference_size_auto = self.port_properties.get("reference_size_auto")
|
|
204
|
-
if reference_size_auto:
|
|
204
|
+
if reference_size_auto is not None:
|
|
205
205
|
port_prop.SetReferenceSizeAuto(reference_size_auto)
|
|
206
206
|
reference_size_x = self.port_properties.get("reference_size_x", 0)
|
|
207
207
|
reference_size_y = self.port_properties.get("reference_size_y", 0)
|
pyedb/dotnet/clr_module.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
import pkgutil
|
|
4
|
-
import shutil
|
|
5
4
|
import sys
|
|
6
5
|
import warnings
|
|
7
6
|
|
|
@@ -34,79 +33,62 @@ pyedb_path = Path(pyedb.__file__).parent
|
|
|
34
33
|
sys.path.append(str(pyedb_path / "dlls" / "PDFReport"))
|
|
35
34
|
|
|
36
35
|
|
|
37
|
-
def find_dotnet_root() -> Path:
|
|
38
|
-
"""Find dotnet root path."""
|
|
39
|
-
dotnet_path = shutil.which("dotnet")
|
|
40
|
-
if not dotnet_path:
|
|
41
|
-
raise FileNotFoundError("The 'dotnet' executable was not found in the PATH.")
|
|
42
|
-
|
|
43
|
-
dotnet_path = Path(dotnet_path).resolve()
|
|
44
|
-
dotnet_root = dotnet_path.parent
|
|
45
|
-
return dotnet_root
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def find_runtime_config(dotnet_root: Path) -> Path:
|
|
49
|
-
"""Find dotnet runtime configuration file path."""
|
|
50
|
-
sdk_path = dotnet_root / "sdk"
|
|
51
|
-
if not sdk_path.is_dir():
|
|
52
|
-
raise EnvironmentError(f"The 'sdk' directory could not be found in: {dotnet_root}")
|
|
53
|
-
sdk_versions = sorted(sdk_path.iterdir(), key=lambda x: x.name, reverse=True)
|
|
54
|
-
if not sdk_versions:
|
|
55
|
-
raise FileNotFoundError("No SDK versions were found.")
|
|
56
|
-
runtime_config = sdk_versions[0] / "dotnet.runtimeconfig.json"
|
|
57
|
-
if not runtime_config.is_file():
|
|
58
|
-
raise FileNotFoundError(f"The configuration file '{runtime_config}' does not exist.")
|
|
59
|
-
return runtime_config
|
|
60
|
-
|
|
61
|
-
|
|
62
36
|
if is_linux: # pragma: no cover
|
|
63
37
|
from pythonnet import load
|
|
64
38
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
is_clr = True
|
|
72
|
-
# Define DOTNET root and runtime config file to load DOTNET core runtime
|
|
73
|
-
except Exception:
|
|
74
|
-
if os.environ.get("DOTNET_ROOT") is None:
|
|
75
|
-
try:
|
|
76
|
-
dotnet_root = find_dotnet_root()
|
|
77
|
-
runtime_config = find_runtime_config(dotnet_root)
|
|
78
|
-
except Exception:
|
|
79
|
-
warnings.warn(
|
|
80
|
-
"Unable to set DOTNET root and locate the runtime configuration file. "
|
|
81
|
-
"Falling back to using dotnetcore2."
|
|
82
|
-
)
|
|
83
|
-
warnings.warn(LINUX_WARNING)
|
|
84
|
-
|
|
85
|
-
import dotnetcore2
|
|
39
|
+
dotnet_root = None
|
|
40
|
+
runtime_config = None
|
|
41
|
+
# Use system .NET core runtime or fall back to dotnetcore2
|
|
42
|
+
if os.environ.get("DOTNET_ROOT") is None:
|
|
43
|
+
try:
|
|
44
|
+
from clr_loader import get_coreclr
|
|
86
45
|
|
|
87
|
-
|
|
88
|
-
|
|
46
|
+
runtime = get_coreclr()
|
|
47
|
+
load(runtime)
|
|
48
|
+
os.environ["DOTNET_ROOT"] = runtime.dotnet_root.as_posix()
|
|
49
|
+
is_clr = True
|
|
50
|
+
# TODO: Fall backing to dotnetcore2 should be removed in a near future.
|
|
51
|
+
except Exception:
|
|
52
|
+
warnings.warn(
|
|
53
|
+
"Unable to set .NET root and locate the runtime configuration file. "
|
|
54
|
+
"Falling back to using dotnetcore2."
|
|
55
|
+
)
|
|
56
|
+
warnings.warn(LINUX_WARNING)
|
|
57
|
+
|
|
58
|
+
import dotnetcore2
|
|
59
|
+
|
|
60
|
+
dotnet_root = Path(dotnetcore2.__file__).parent / "bin"
|
|
61
|
+
runtime_config = pyedb_path / "misc" / "pyedb.runtimeconfig.json"
|
|
62
|
+
# Use specified .NET root folder
|
|
63
|
+
else:
|
|
64
|
+
dotnet_root = Path(os.environ["DOTNET_ROOT"])
|
|
65
|
+
# Patch the case where DOTNET_ROOT leads to dotnetcore2 for more information
|
|
66
|
+
# see https://github.com/ansys/pyedb/issues/922
|
|
67
|
+
# TODO: Remove once dotnetcore2 is deprecated
|
|
68
|
+
if dotnet_root.parent.name == "dotnetcore2":
|
|
69
|
+
runtime_config = pyedb_path / "misc" / "pyedb.runtimeconfig.json"
|
|
89
70
|
else:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
71
|
+
from clr_loader import find_runtimes
|
|
72
|
+
|
|
73
|
+
candidates = [rt for rt in find_runtimes() if rt.name == "Microsoft.NETCore.App"]
|
|
74
|
+
candidates.sort(key=lambda spec: spec.version, reverse=True)
|
|
75
|
+
if not candidates:
|
|
94
76
|
raise RuntimeError(
|
|
95
77
|
"Configuration file could not be found from DOTNET_ROOT. "
|
|
96
78
|
"Please ensure that .NET SDK is correctly installed or "
|
|
97
79
|
"that DOTNET_ROOT is correctly set."
|
|
98
80
|
)
|
|
81
|
+
runtime_config = candidates[0]
|
|
82
|
+
# Use specific .NET core runtime
|
|
83
|
+
if dotnet_root is not None and runtime_config is not None:
|
|
99
84
|
try:
|
|
100
85
|
load("coreclr", runtime_config=str(runtime_config), dotnet_root=str(dotnet_root))
|
|
86
|
+
os.environ["DOTNET_ROOT"] = dotnet_root.as_posix()
|
|
101
87
|
if "mono" not in os.getenv("LD_LIBRARY_PATH", ""):
|
|
102
88
|
warnings.warn("LD_LIBRARY_PATH needs to be setup to use pyedb.")
|
|
103
89
|
warnings.warn("export ANSYSEM_ROOT242=/path/to/AnsysEM/v242/Linux64")
|
|
104
90
|
msg = "export LD_LIBRARY_PATH="
|
|
105
91
|
msg += "$ANSYSEM_ROOT242/common/mono/Linux64/lib64:$LD_LIBRARY_PATH"
|
|
106
|
-
msg += (
|
|
107
|
-
"If PyEDB is used with AEDT<2023.2 then /path/to/AnsysEM/v2XY/Linux64/Delcross "
|
|
108
|
-
"should be added to LD_LIBRARY_PATH."
|
|
109
|
-
)
|
|
110
92
|
warnings.warn(msg)
|
|
111
93
|
is_clr = True
|
|
112
94
|
except ImportError:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
pyedb/__init__.py,sha256=
|
|
1
|
+
pyedb/__init__.py,sha256=0dRu57BoHyuvB7u7RRssPBfZo1KowB3EMM0XJq4Xww8,1525
|
|
2
2
|
pyedb/edb_logger.py,sha256=7KXPvAMCKzlzJ5zioiNO5A3zkqbpCHhWHB4aXKfgu5Y,14959
|
|
3
3
|
pyedb/exceptions.py,sha256=n94xluzUks6BA24vd_L6HkrvoP_H_l6__hQmqzdCyPo,111
|
|
4
4
|
pyedb/siwave.py,sha256=Mgg5ZGzOUOtNdlePHcnrgN3rletQ7jrqRi3WfxF58uU,17727
|
|
5
5
|
pyedb/workflow.py,sha256=Y0ya4FUHwlSmoLP45zjdYLsSpyKduHUSpT9GGK9MGd8,814
|
|
6
6
|
pyedb/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
pyedb/common/nets.py,sha256=
|
|
7
|
+
pyedb/common/nets.py,sha256=eOJn_WBbyjZWT-sDWrUOvO4ZQyh_6OK9DtoTb8Dp3Hs,20600
|
|
8
8
|
pyedb/component_libraries/ansys_components.py,sha256=O3ypt832IHY9zG2AD_yrRrbH2KH9P1yFaoi1EO6Zllw,4830
|
|
9
9
|
pyedb/configuration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
pyedb/configuration/cfg_boundaries.py,sha256=5_v6HD0VgkFCJHgx5zTIn_nxPv3KpcCuGz9P4Kk4ywM,6246
|
|
11
11
|
pyedb/configuration/cfg_common.py,sha256=feXGIBSlTPAewSsmu0m1SgyfF9DuK4C7SNP_RNQGD2A,2549
|
|
12
|
-
pyedb/configuration/cfg_components.py,sha256=
|
|
12
|
+
pyedb/configuration/cfg_components.py,sha256=JcyBzNNGNvfw0HaCh1HV0fmnCOL3rrpgUCsOTb6J8to,12400
|
|
13
13
|
pyedb/configuration/cfg_data.py,sha256=qCCR-Oo5_le61qWWmjrK4gIt_HH9jVqu4K0GbekAJkU,3773
|
|
14
14
|
pyedb/configuration/cfg_general.py,sha256=DJAKTW8Sqojfqzc3jO3MU1-J8MrmVi37jUIkTD_Tw6o,2068
|
|
15
15
|
pyedb/configuration/cfg_modeler.py,sha256=tgeTs-if1d_vQvnGzD6qqMGnJlqqG302APHUu0b5jtE,5889
|
|
@@ -25,7 +25,7 @@ pyedb/configuration/cfg_spice_models.py,sha256=Q_5j2-V6cepSFcnijot8iypTqzanLp7HO
|
|
|
25
25
|
pyedb/configuration/cfg_stackup.py,sha256=ZKUcTh4UAFLJgES2W-5J7uXkUdz_q0URg28lUZUyfdo,6433
|
|
26
26
|
pyedb/configuration/configuration.py,sha256=MnoO5H5VZSogQSZ3MUJqWiO3DB-_QUYOfM4qROTHcnY,15470
|
|
27
27
|
pyedb/dotnet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
pyedb/dotnet/clr_module.py,sha256=
|
|
28
|
+
pyedb/dotnet/clr_module.py,sha256=EabqZgZgBZOhJD9_V8Ll8sEKgBFj9xe9zARNYIvYM_s,5304
|
|
29
29
|
pyedb/dotnet/edb.py,sha256=Ut1lpxs_YwagTRjcmrANr8xyIOVu-BzedW_YtU6kIcU,186395
|
|
30
30
|
pyedb/dotnet/application/Variables.py,sha256=awNhyiLASBYrNjWIyW8IJowgqt7FfFPKF9UElRWyjZg,77750
|
|
31
31
|
pyedb/dotnet/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -34,7 +34,7 @@ pyedb/dotnet/edb_core/components.py,sha256=r8Gr9mV4Cuky7lVKOg-JWhRR2bflGYESsnOGG
|
|
|
34
34
|
pyedb/dotnet/edb_core/general.py,sha256=k2Bcr5VV-QUzEZlYorqYCX1ZchHBH7WqUvc8maMxId0,4716
|
|
35
35
|
pyedb/dotnet/edb_core/hfss.py,sha256=oQFC6PwRbjAwfR60RoklwpZ_2sDI4OheNNdwaqY23ok,68671
|
|
36
36
|
pyedb/dotnet/edb_core/layout_obj_instance.py,sha256=Pd8rfdO3b6HLFGwXBMw-tfE4LPIcW_9_X5KEdFaiito,1407
|
|
37
|
-
pyedb/dotnet/edb_core/layout_validation.py,sha256=
|
|
37
|
+
pyedb/dotnet/edb_core/layout_validation.py,sha256=S0IFx9t5toVpuTLTI2Cs9vvgR4BCebJLXnj0ydW2Op8,13597
|
|
38
38
|
pyedb/dotnet/edb_core/materials.py,sha256=s105DUTFkQoQRWgtRMp02DKcU2YcSrfLbJoi8hcTQII,42293
|
|
39
39
|
pyedb/dotnet/edb_core/modeler.py,sha256=rVJ-eh3eKOnCHENaBLZ8D7duH7tUtUqZJNLKGLFsZ_M,55519
|
|
40
40
|
pyedb/dotnet/edb_core/net_class.py,sha256=4U6Cc1Gn7ZJ_ub9uKmtrsoz5wD1XS42afci3Y3ewRp0,11354
|
|
@@ -188,7 +188,7 @@ pyedb/misc/siw_feature_config/xtalk_scan/scan_config.py,sha256=YmYI6WTQulL5Uf8Wx
|
|
|
188
188
|
pyedb/misc/siw_feature_config/xtalk_scan/td_xtalk_config.py,sha256=KHa-UqcXuabiVfT2CV-UvWl5Q2qGYHF2Ye9azcAlnXc,3966
|
|
189
189
|
pyedb/modeler/geometry_operators.py,sha256=g_Sy7a6R23sP6RtboJn1rl8uTuo8oeLmMF21rNkzwjk,74198
|
|
190
190
|
pyedb/siwave_core/icepak.py,sha256=WnZ-t8mik7LDY06V8hZFV-TxRZJQWK7bu_8Ichx-oBs,5206
|
|
191
|
-
pyedb-0.34.
|
|
192
|
-
pyedb-0.34.
|
|
193
|
-
pyedb-0.34.
|
|
194
|
-
pyedb-0.34.
|
|
191
|
+
pyedb-0.34.3.dist-info/LICENSE,sha256=qQWivZ12ETN5l3QxvTARY-QI5eoRRlyHdwLlAj0Bg5I,1089
|
|
192
|
+
pyedb-0.34.3.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
|
193
|
+
pyedb-0.34.3.dist-info/METADATA,sha256=eqa7ECjzgtHBuASB2HAbcxjEn3aV7STZutrAfdJU8Uo,8512
|
|
194
|
+
pyedb-0.34.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|