QPyaedt¶
- class QPyaedt(design: QDesign, renderer_type: str, project_name: str | None = None, design_name: str | None = None, initiate=False, options: Dict = None)[source]¶
Will fill this out later.
_summary_
- Parameters:
design (QDesign) – Use QGeometry within either QDesign or MultiPlanar design to obtain elements for Ansys.
renderer_type (str) – Choose string from list [‘HFSS_DM’, ‘HFSS_EM’, ‘Q3D’] for the type of design to insert into project.
project_name (Union[str, None], optional) – Give a name, or one will be made based on class name of renderer. Defaults to None.
design_name (Union[str, None], optional) – Give a name, or one will be made based on class name of renderer. Defaults to None.
initiate (bool, optional) – True to initiate the renderer. Defaults to False.
options (Dict, optional) – Used to override all options. Defaults to None.
Attributes
- GROUPS = ['Non Model', 'Solids', 'Unclassified', 'Sheets', 'Lines']¶
- NAME_DELIM = '_'¶
Name delimiter
- default_options = {'Cj': 0, 'Lj': 1e-08, 'begin_disable_autosave': True, 'close_enable_autosave': True, 'sample_holder_bottom': '-1.2mm', 'sample_holder_top': '1.2mm', 'x_buffer_width_mm': 0.25, 'y_buffer_width_mm': 0.25}¶
Default options
- default_setup = {}¶
Default setup.
- design¶
Return a reference to the parent design object.
- desktop¶
Access to hidden variable for Ansys desktop.
- Returns:
easier reference to pyaedt desktop.
- Return type:
Desktop
- element_extensions = {}¶
Element extensions dictionary
- element_table_data = {'junction': {'capacitance': 0, 'inductance': 1e-08}, 'path': {'wire_bonds': False}}¶
Element table data.
- logger¶
Returns the logger.
- name = 'base'¶
Name
- options¶
Options for the QRenderer.
- renderer_types = ['HFSS_DM', 'HFSS_EM', 'Q3D']¶
Methods
- activate_user_project_design()[source]¶
If Ansys is not started, then start using the project and name defined by user. Otherwise, activate the project and design that user chose. It appears that pyaedt can identify the project, if needed, we can pro-actively activate the project.
- add_endcaps(layer_open_pins_list: list, layer_num: int, endcap_str: str = 'endcap')[source]¶
Add a list of end-caps for open pins for a specific layer ONLY. This method ASSUMES there is something in open_pins list. This method ASSUMES that the components and corresponding pins are within design. This method ASSUMES the list already corresponds to the layer number. This method wil make a sublist of open_pins for each the layer_num passed.
- add_fillet_linestring(qgeom: Series, points_3d: list, qc_fillet: float, a_polyline: None)[source]¶
Determine the idx of Polyline vertices to fillet and fillet them.
- add_linestring_width(qc_width: float, a_polyline: None, points_3d: list, material: str) None[source]¶
Determine the orthogonal vector. Then sweep along a_polyline using qc_width. Then return the reference to new polyline with sweep in Ansys.
- Parameters:
- Returns:
Reference to polyline that was widened.
- Return type:
Polyline
- add_one_endcap(comp_name: str, pin_name: str, layer: int, endcap_str: str = 'endcap')[source]¶
Create a rectangle, then add thickness and denote to be subtracted for open pin.
- add_table_data_to_QDesign(class_name: str)¶
During init of renderer, this needs to happen. In particular, each renderer needs to update custom columns and values within QDesign.
- Parameters:
class_name (str) – Name from cls.name for each renderer.
- aedt_render_by_layer_then_tables(open_pins: list | None, port_list: list | None, jj_to_port: list | None, ignored_jjs: list | None, skip_junction: bool = False, data_type: int = 0)[source]¶
- auto_wirebonds(table)[source]¶
Adds wirebonds to the Ansys model for path elements where; subtract = True and wire_bonds = True.
Uses render options for determining of the: * wb_threshold – the minimum distance between two vertices of a path for a wirebond to be added. * wb_offset – offset distance for wirebond placement (along the direction of the cpw) * wb_size – controls the width of the wirebond (wb_size * path[‘width’])
- chip_designation_error()[source]¶
Warning message that appears when the Ansys renderer fails to locate a component’s chip designation. Provides instructions for a temporary workaround until the layer stack is finalized.
- chip_not_main()[source]¶
Warning message that appears when a component’s chip designation is not ‘main’. As of 05/10/21, all chip designations should be ‘main’ until the layer stack is finalized. Provides instructions for a temporary workaround until the layer stack is finalized.
- clean_user_design()[source]¶
Clean the user project and design corresponding to the current_app
Args: None
Returns: None
- confirm_open_pins_are_valid_names(open_pins: list, pair_used: list) bool[source]¶
Check if all names of components and corresponding pins are within design. Otherwise log an error
- create_fill_true_box()[source]¶
Create 3D box used for both fill and or as a subtract box for geometries when subtract==True from qgeometry table.
- get_chip_names() List[str][source]¶
Obtain a list of chips on which the selection of components, if valid, resides.
- Returns:
Chips to render.
- Return type:
List[str]
- get_open_pins_in_layer(open_pins: list, layer_num: int) list[source]¶
Reduce the open_pins list and only return the open_pins for layer_nums.
- classmethod get_template_options(design: QDesign, render_template: Dict = None, logger_: Logger = None, template_key: str = None) Dict¶
Creates template options for the Metal QRenderer class required for the class to function, based on the design template; i.e., be created, made, and rendered. Provides the blank option structure required.
The options can be extended by plugins, such as renderers.
- Parameters:
design (QDesign) – A design class.
render_template (Dict, optional) – Template options to overwrite the class ones. Defaults to None.
logger (logging.Logger, optional) – A logger for errors. Defaults to None.
template_key (str, optional) – The design.template_options key identifier. If None, then use _get_unique_class_name(). Defaults to None.
- Returns:
Dictionary of renderer’s default options based on design.template_options.
- Return type:
Dict
- get_unique_component_ids(highlight_qcomponents: list | None = None) Tuple[list, int]¶
Confirm the list doesn’t have names of components repeated. Confirm that the name of component exists in QDesign. If QDesign doesn’t contain any component, or if all components in QDesign are found in highlight_qcomponents, return an empty list; otherwise return a list of unique components to be sent to the renderer. The second returned item, an integer, specifies which of these 3 cases applies.
- initialized()[source]¶
Abstract method. Must be implemented by the subclass. Is renderer ready to be used? Implementation must return boolean True if successful. False otherwise.
- classmethod load()¶
Load the renderer and register all its extensions. Only performed once.
Once complete, the renderer is added to the class attribute ‘__loaded_renderers__’ of QRenderer
- Returns:
True if success, otherwise throws an error.
- Return type:
- open_pin_names_not_valid(comp_name: str, pin_name: str)[source]¶
Stop and give error if the component name or pin name from open_pins are not valid within design.
- parse_value(value: Any | List | Dict | Iterable) Any¶
Same as design.parse_value. See design for help.
- Returns:
Parsed value of input.
- Return type:
- classmethod populate_element_extensions()¶
Populate cls.element_extensions which will be used to create columns for tables in QGeometry tables.
The structure of cls.element_table_data should be same as cls.element_extensions.
- render_chips(draw_sample_holder: bool = True, box_plus_buffer: bool = True)[source]¶
Render all chips containing components in self.qcomp_ids.
- render_component(component)[source]¶
Abstract method. Must be implemented by the subclass. Render the specified component.
- Parameters:
component (QComponent) – Component to render.
- render_components(table_type: str, layer_num: int, port_list: list | None, jj_to_port: list | None, ignored_jjs: list | None)[source]¶
Render components by breaking them down into individual elements. Render all components of the design. If selection is none, then render all components.
- Parameters:
table_type (str) – Table type (poly, path, or junction).
- render_design(selection: List | None = None, box_plus_buffer: bool = True)[source]¶
Must be implemented by the subclass to finish the logic for HFSS OR Q3D within project.
Renders all design chips and components. Note: This needs to be extended with additional logic for Q3D and HFSS.
- render_element(qgeom: Series, is_junction: bool, port_list: list | None, jj_to_port: list | None, ignored_jjs: list | None)[source]¶
Abstract method. Must be implemented by the subclass. Render the specified element
- Parameters:
element (Element) – Element to render.
- render_element_path(qgeom: Series)[source]¶
Render one row from the qgeometry table.
- Parameters:
qgeom (pd.Series) – One row from the qgeometry table.
- render_element_poly(qgeom: Series)[source]¶
Render a closed polygon.
- Parameters:
qgeom (pd.Series) – GeoSeries of element properties.
- save_screenshot(path: str = None, show: bool = True)[source]¶
Save the screenshot.
- Parameters:
- Returns:
path to png formatted screenshot.
- Return type:
- start(force: bool = False) bool¶
Call any initialization (single run) step required to setup the renderer for the first execution, such as connecting to some API or COM, or importing the correct material libraries, etc.
- subtract_from_ground(layer_num: int, data_type: int = 0)[source]¶
For each chip, subtract all “negative” shapes residing on its surface if any such shapes exist. Data is stored by layer, but we always assume each layer to be unique
Need to use a rectangular for each layer, which has fill, has been made as part of create_fill_true_box.
- update_options(render_options: Dict = None, render_template: Dict = None)¶
If template options has not been set for this renderer, then gather all the default options for children and add to design. The GUI would use this to store the template options.
Then give the template options to render to store in self.options. Then user can over-ride the render_options.
- Parameters:
render_options (Dict, optional) – If user wants to over-ride the template options. Defaults to None.
render_template (Dict, optional) – All the template options for each child. Defaults to None.