Sweeper¶
- class Sweeper(parent)[source]¶
The methods allow users to sweep a variable in a components’s options. Need access to renderers which are registered in QDesign.
Connect to the QAnalysis child we sweeping can happen.
- Parameters:
parent (QAnalysis) – Will not be just QAnalysis, but a child or grandchild, etc. of QAnalysis.
Methods
- error_check_sweep_input(qcomp_name: str, option_name: str, option_sweep: list) Tuple[list, Dict, int] [source]¶
Implement error checking of data for sweeping.
- Parameters:
qcomp_name (str) – Component that contains the option to be swept.
option_name (str) – The option within qcomp_name to sweep.
option_sweep (list) – Each entry in the list is a value for option_name.
- Returns:
The list has traversed the option Dict. addict.addict.Dict has the value from the dictionary of the searched key. The int is the observation of searching for data from arguments.
0 Error not detected in the input-data.
1 qcomp_name not registered in design.
2 option_name is empty.
3 option_name is not found as key in Dict.
4 option_sweep is empty, need at least one entry.
- Return type:
Tuple[list, Dict, int]
- iterate_option_sweep(args: list, all_dicts: Dict, option_path: list, a_value: Dict, all_sweep: Dict) Tuple[Dict, int] [source]¶
Iterate through the values that user gave in option_sweep.
- Parameters:
args (Dict) – Holds the three mandatory arguments in an expected sequence.
all_dicts (Dict) – User arguments manipulated to account for using previous_run.
option_path (list) – The list has traversed the option Dict.
a_value (Dict) – Has the value from the dictionary of the searched key.
all_sweep (Dict) – Will be populated during the iteration.
- Returns:
The dict key is each value of option_sweep, the value is the solution-data for each sweep. The int is the observation of searching for data from arguments as defined below.
0 Have list of capacitance matrix.
5 last key in option_name is not in Dict.
- Return type:
Tuple[Dict, int]
- classmethod option_value(a_dict: Dict, search: str) str [source]¶
Get value from dict based on key. This method is used for unknown depth, dict search, within a dict.
- Parameters:
a_dict (Dict) – Dictionary to get values from
search (str) – String to search for
- Returns:
Value from the dictionary of the searched term.
- Return type:
str
- populate_all_sweep(all_sweep: Dict, item: str, option_name: str)[source]¶
Populate the Dict passed in all_sweep from QAnalysis.
- Parameters:
all_sweep (Dict) – Reference to hold each item which corresponds to option_name.
item (str) – The value of each item that we want to sweep in option_name.
option_name (str) – The option of QComponent that we want to sweep.
- run_sweep(*args, **kwarg) Tuple[Dict, int] [source]¶
Ansys will be opened, if not already open, with an inserted project. A design will be inserted by this method.
There are two ways to pass arguments. You can use the previous run or use updated arguments. With both scenarios, qcomp_name, option_name, and option_sweep must be passed.
For the previous run, the arguments are all but the three required.
- Parameters:
qcomp_name (str) – A component that contains the option to be swept.
option_name (str) – The option within qcomp_name to sweep.
option_sweep (list) – Each entry in the list is a value for option_name.
qcomp_render (list) – The component to render to simulation software.
open_terminations (list) – Identify which kind of pins. Follow the details from renderer QQ3DRenderer.render_design, or QHFSSRenderer.render_design.
port_list (list) – List of tuples of jj’s that shouldn’t be rendered. Follow details from renderer in QHFSSRenderer.render_design.
jj_to_port (list) – List of junctions (qcomp, qgeometry_name, impedance, draw_ind) to render as lumped ports or as lumped port in parallel with a sheet inductance. Follow details from renderer in QHFSSRenderer.render_design.
ignored_jjs (Union[list,None]) – This is not used by all renderers, just hfss.
design_name (str) – Name of design (workspace) to use in project.
box_plus_buffer (bool) – Render the entire chip or create a box_plus_buffer around the components which are rendered.
- Returns:
The dict key is each value of option_sweep, the value is the solution-data for each sweep. The int is the observation of searching for data from arguments as defined below.
0 Have list of capacitance matrix.
1 qcomp_name not registered in design.
2 option_name is empty.
3 option_name is not found as key in Dict.
4 option_sweep is empty, need at least one entry.
5 last key in option_name is not in Dict.
6 need to have at least three arguments
- Return type:
Tuple[Dict, int]