From 700a0b6610fb7ff7aa9cd77193e2348382fa7912 Mon Sep 17 00:00:00 2001 From: svandenb Date: Thu, 30 Nov 2023 11:01:18 +0100 Subject: [PATCH] edb doc fix --- doc/source/EDBAPI/CoreEdb.rst | 2 +- src/pyedb/legacy/edb.py | 53 +++++++++++++++++++------------ src/pyedb/legacy/edb_core/nets.py | 4 +-- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/doc/source/EDBAPI/CoreEdb.rst b/doc/source/EDBAPI/CoreEdb.rst index 53c7643441..851eb7ec6f 100644 --- a/doc/source/EDBAPI/CoreEdb.rst +++ b/doc/source/EDBAPI/CoreEdb.rst @@ -12,7 +12,7 @@ It can be opened and edited using the ``Edb`` class. .. autosummary:: :toctree: _autosummary - pyedb.legacy.edb + pyedb.legacy.edb.EdbLegacy pyedb.legacy.edb_core.edb_data.variables.Variable pyedb.legacy.edb_core.edb_data.edbvalue.EdbValue diff --git a/src/pyedb/legacy/edb.py b/src/pyedb/legacy/edb.py index 91c6ed4680..4e0f7b8538 100644 --- a/src/pyedb/legacy/edb.py +++ b/src/pyedb/legacy/edb.py @@ -104,7 +104,7 @@ class EdbLegacy(Database): Create an ``Edb`` object and a new EDB cell. >>> from pyedb.legacy.edb import EdbLegacy - >>> app = Edb() + >>> app = EdbLegacy() Add a new variable named "s1" to the ``Edb`` instance. @@ -125,12 +125,12 @@ class EdbLegacy(Database): Create an ``Edb`` object and open the specified project. - >>> app = Edb("myfile.aedb") + >>> app = EdbLegacy("myfile.aedb") Create an ``Edb`` object from GDS and control files. The XML control file resides in the same directory as the GDS file: (myfile.xml). - >>> app = Edb("/path/to/file/myfile.gds") + >>> app = EdbLegacy("/path/to/file/myfile.gds") """ @@ -228,7 +228,7 @@ def __getitem__(self, variable_name): Returns ------- - :class:`legacy.edb_core.edb_data.variables.Variable` + :class:`pyedb.legacy.edb_core.edb_data.variables.Variable` """ if self.variable_exists(variable_name)[0]: @@ -273,8 +273,6 @@ def _clean_variables(self): self._variables = None self._active_cell = None self._layout = None - # time.sleep(2) - # gc.collect() @pyedb_function_handler() def _init_objects(self): @@ -306,7 +304,7 @@ def design_variables(self): Returns ------- - Dict[str, :class:`legacy.edb_core.edb_data.variables.Variable`] + Dict[str, :class:`pyedb.legacy.edb_core.edb_data.variables.Variable`] """ d_var = dict() for i in self.active_cell.GetVariableServer().GetAllVariableNames(): @@ -329,7 +327,7 @@ def project_variables(self): @property def layout_validation(self): - """:class:`legacy.edb_core.edb_data.layout_validation.LayoutValidation`.""" + """:class:`pyedb.egacy.edb_core.edb_data.layout_validation.LayoutValidation`.""" return LayoutValidation(self) @property @@ -338,7 +336,7 @@ def variables(self): Returns ------- - Dict[str, :class:`legacy.edb_core.edb_data.variables.Variable`] + Dict[str, :class:`pyedb.legacy.edb_core.edb_data.variables.Variable`] """ all_vars = dict() @@ -433,7 +431,7 @@ def open_edb(self): Returns ------- - + ``True`` when succeed ``False`` if failed : bool """ # self.logger.info("EDB Path is %s", self.edbpath) # self.logger.info("EDB Version is %s", self.edbversion) @@ -472,10 +470,11 @@ def open_edb(self): @pyedb_function_handler() def open_edb_inside_aedt(self): - """Open EDB inside of AEDT. + """Open EDB inside AEDT. Returns ------- + ``True`` when succeed ``False`` if failed : bool """ self.logger.info("Opening EDB from HDL") @@ -504,7 +503,12 @@ def open_edb_inside_aedt(self): @pyedb_function_handler() def create_edb(self): - """Create EDB.""" + """Create EDB. + + Returns + ------- + ``True`` when succeed ``False`` if failed : bool + """ # if self.edbversion > "2023.1": # self.standalone = False @@ -548,8 +552,8 @@ def import_layout_pcb(self, input_file, working_dir, anstranslator_full_path="", Returns ------- - str - Full path to the AEDB file. + Full path to the AEDB file : str + """ self._components = None self._core_primitives = None @@ -599,7 +603,7 @@ def export_to_ipc2581(self, ipc_path=None, units="MILLIMETER"): The method works only in CPython because of some limitations on Ironpython in XML parsing and because it's time-consuming. This method is still being tested and may need further debugging. - Any feedback is welcome. Backdrills and custom pads are not supported yet. + Any feedback is welcome. Back drills and custom pads are not supported yet. Parameters ---------- @@ -614,8 +618,8 @@ def export_to_ipc2581(self, ipc_path=None, units="MILLIMETER"): Returns ------- - bool - ``True`` if successful, ``False`` if failed. + ``True`` if successful, ``False`` if failed : bool + """ if units.lower() not in ["millimeter", "inch", "micron"]: # pragma no cover self.logger.warning("The wrong unit is entered. Setting to the default, millimeter.") @@ -649,6 +653,7 @@ def edb_exception(self, ex_value, tb_data): Returns ------- + None """ tb_trace = traceback.format_tb(tb_data) @@ -693,7 +698,7 @@ def components(self): Returns ------- - :class:`pyedb.legacy.edb_core.components.Components` + Instance of :class:`legacy.edb_core.components.Components` Examples -------- @@ -888,8 +893,16 @@ def hfss(self): Examples -------- >>> from pyedb.legacy.edb import EdbLegacy - >>> edbapp = EdbLegacyb("myproject.aedb") + >>> edbapp = EdbLegacy("myproject.aedb") + >>> sim_config = edbapp.new_simulation_configuration() + >>> sim_config.mesh_freq = "10Ghz" >>> edbapp.hfss.configure_hfss_analysis_setup(sim_config) + + See Also + -------- + :class:`legacy.edb_core.edb_data.simulation_configuration.SimulationConfiguration` + for more information on configuration options. + """ if not self._hfss and self.active_db: self._hfss = EdbHfss(self) @@ -922,7 +935,7 @@ def nets(self): Returns ------- - :class:`pyedb.legacy.edb_core.nets.EdbNets` + :class:`legacy.edb_core.nets.EdbNets` Examples -------- diff --git a/src/pyedb/legacy/edb_core/nets.py b/src/pyedb/legacy/edb_core/nets.py index f9d33b7d12..5647aedede 100644 --- a/src/pyedb/legacy/edb_core/nets.py +++ b/src/pyedb/legacy/edb_core/nets.py @@ -20,8 +20,8 @@ class EdbNets(object): Examples -------- - >>> from legacy import Edb - >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") + >>> from pyedb.legacy.edb import EdbLegacy + >>> edbapp = EdbLegacy("myaedbfolder", edbversion="2021.2") >>> edb_nets = edbapp.nets """