pyedb 0.52.0__py3-none-any.whl → 0.53.0__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.

@@ -2235,10 +2235,7 @@ class Stackup(LayerCollection):
2235
2235
  return True
2236
2236
 
2237
2237
  def _import_xml(self, file_path):
2238
- """Read external xml file and convert into json file.
2239
- You can use xml file to import layer stackup but using json file is recommended.
2240
- see :class:`pyedb.dotnet.database.edb_data.simulation_configuration.SimulationConfiguration´ class to
2241
- generate files`.
2238
+ """Load stackup from a XML file.
2242
2239
 
2243
2240
  Parameters
2244
2241
  ----------
@@ -2250,62 +2247,11 @@ class Stackup(LayerCollection):
2250
2247
  bool
2251
2248
  ``True`` when successful, ``False`` when failed.
2252
2249
  """
2253
- if not colors:
2254
- self._pedb.logger.error("Matplotlib is needed. Please, install it first.")
2255
- return False
2256
- tree = ET.parse(file_path)
2257
- root = tree.getroot()
2258
- stackup = root.find("Stackup")
2259
- stackup_dict = {}
2260
- if stackup.find("Materials"):
2261
- mats = []
2262
- for m in stackup.find("Materials").findall("Material"):
2263
- temp = dict()
2264
- for i in list(m):
2265
- value = list(i)[0].text
2266
- temp[i.tag] = value
2267
- mat = {"name": m.attrib["Name"]}
2268
- temp_dict = {
2269
- "Permittivity": "permittivity",
2270
- "Conductivity": "conductivity",
2271
- "DielectricLossTangent": "dielectric_loss_tangent",
2272
- }
2273
- for i in temp_dict.keys():
2274
- value = temp.get(i, None)
2275
- if value:
2276
- mat[temp_dict[i]] = value
2277
- mats.append(mat)
2278
- stackup_dict["materials"] = mats
2279
-
2280
- stackup_section = stackup.find("Layers")
2281
- if stackup_section:
2282
- length_unit = stackup_section.attrib["LengthUnit"]
2283
- layers = []
2284
- for l in stackup.find("Layers").findall("Layer"):
2285
- temp = l.attrib
2286
- layer = dict()
2287
- temp_dict = {
2288
- "Name": "name",
2289
- "Color": "color",
2290
- "Material": "material",
2291
- "Thickness": "thickness",
2292
- "Type": "type",
2293
- "FillMaterial": "fill_material",
2294
- }
2295
- for i in temp_dict.keys():
2296
- value = temp.get(i, None)
2297
- if value:
2298
- if i == "Thickness":
2299
- value = str(round(float(value), 6)) + length_unit
2300
- value = "signal" if value == "conductor" else value
2301
- if i == "Color":
2302
- value = [int(x * 255) for x in list(colors.to_rgb(value))]
2303
- layer[temp_dict[i]] = value
2304
- layers.append(layer)
2305
- stackup_dict["layers"] = layers
2306
- cfg = {"stackup": stackup_dict}
2307
- self._pedb.configuration.load(cfg)
2308
- return self._pedb.configuration.run()
2250
+
2251
+ self._edb_object.ImportFromControlFile(file_path)
2252
+ flag = self._pedb.layout._edb_object.SetLayerCollection(self._edb_object)
2253
+ self.refresh_layer_collection()
2254
+ return flag
2309
2255
 
2310
2256
  def _export_xml(self, file_path):
2311
2257
  """Export stackup information to an external XMLfile.
@@ -377,5 +377,5 @@ class SimulationSetup(object):
377
377
  ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"],
378
378
  ... ])
379
379
  """
380
- warnings.warn("`create_component_from_pins` is deprecated. Use `add_sweep` method instead.", DeprecationWarning)
380
+ warnings.warn("`add_frequency_sweep` is deprecated. Use `add_sweep` method instead.", DeprecationWarning)
381
381
  return self.add_sweep(name, frequency_sweep)