HFSSSimulationConfig#
- class pyedb.workflows.job_manager.backend.job_submission.HFSSSimulationConfig(**data)#
Bases:
pydantic.BaseModelComplete, validated simulation configuration.
The class is a frozen dataclass (after
__post_init__) and can be serialised to/from JSON viato_dict()/from_dict(). e Parameters ———- ansys_edt_path : strPath to
ansysedtexecutable.- solverstr, optional
Solver name. Defaults to
"Hfss3DLayout".- jobidstr, optional
Unique identifier. Auto-generated with timestamp if omitted.
- distributedbool, optional
Enable MPI distribution. Defaults to
True.- machine_nodeslist[MachineNode], optional
Compute nodes. Defaults to
[MachineNode()].- autobool, optional
Non-interactive mode. Defaults to
True.- non_graphicalbool, optional
Hide GUI. Defaults to
True.- monitorbool, optional
Stream solver log. Defaults to
True.- layout_optionsHFSS3DLayoutBatchOptions, optional
Solver flags. Defaults to a new instance.
- project_pathstr, optional
.aedtor.aedbfile. Defaults to platform temp.- design_namestr, optional
Design inside project. Defaults to
""(use active).- design_modestr, optional
Variation name. Defaults to
"".- setup_namestr, optional
Setup to solve. Defaults to
"".- scheduler_typeSchedulerType, optional
External scheduler. Defaults to
SchedulerType.NONE.- scheduler_optionsSchedulerOptions, optional
Scheduler directives. Defaults to a new instance.
- Raises:
ValueErrorOn validation failure.
FileNotFoundErrorIf project_path does not exist.
Overview#
Validate all options and raise |
|
Return HFSS |
|
Generate HFSS batch options string from layout options. |
|
Generate design specification string for HFSS command. |
|
Returns a proper SLURM batch script with shebang. |
|
Return LSF batch script that matches the reference command. |
|
Delegate to the correct generator based on |
|
Platform-escaped command line. |
|
Write the batch script (if script_path given) and submit to the |
|
Main entry point — run the simulation either |
|
List form for subprocess.run(shell=False). |
|
Serialize the complete configuration to a JSON-safe dictionary. |
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict]. |
|
String representation of the complete HFSS command. |
Import detail#
from pyedb.workflows.job_manager.backend.job_submission import HFSSSimulationConfig
Attribute detail#
- HFSSSimulationConfig.model_config#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- HFSSSimulationConfig.machine_nodes: List[MachineNode] = None#
- HFSSSimulationConfig.layout_options: HFSS3DLayoutBatchOptions = None#
- HFSSSimulationConfig.scheduler_type: SchedulerType#
- HFSSSimulationConfig.scheduler_options: SchedulerOptions = None#
Method detail#
- HFSSSimulationConfig.validate_fields() None#
Validate all options and raise
ValueErroron violation. Checks ranges, formats, and scheduler-specific rules.
- HFSSSimulationConfig.generate_machinelist_string() str#
Return HFSS
-machinelistargument.- Returns:
strMachine list string.
- HFSSSimulationConfig.generate_batch_options_string() str#
Generate HFSS batch options string from layout options. Converts HFSS3DLayoutOptions to command-line batch options format. Format matches Ansys reference: “key1=value1 key2=value2”
- Returns:
strBatch options string with space-separated key=value pairs.
- HFSSSimulationConfig.generate_design_string() str#
Generate design specification string for HFSS command.
- Returns:
strDesign string.
- HFSSSimulationConfig.generate_slurm_script() str#
Returns a proper SLURM batch script with shebang. This script can be written to a file and submitted via sbatch.
- HFSSSimulationConfig.generate_lsf_script() str#
Return LSF batch script that matches the reference command.
- HFSSSimulationConfig.generate_scheduler_script() str#
Delegate to the correct generator based on
scheduler_type.- Returns:
strBatch script or PowerShell code.
- Raises:
ValueErrorIf scheduler_type is unsupported.
- HFSSSimulationConfig.generate_command_string() str#
Platform-escaped command line. Local → list=… Scheduler → distributed numcores=… + -auto
- HFSSSimulationConfig.submit_to_scheduler(script_path: str | None = None) subprocess.CompletedProcess#
Write the batch script (if script_path given) and submit to the configured scheduler.
- Parameters:
- script_path
str,optional Destination file name. Auto-generated if omitted.
- script_path
- Returns:
subprocess.CompletedProcessResult of
sbatch/bsub/qsub/ PowerShell.
- Raises:
ValueErrorIf scheduler_type is
SchedulerType.NONE. subprocess.TimeoutExpired If submission takes longer than 30 s.
- HFSSSimulationConfig.run_simulation(**subprocess_kwargs) subprocess.CompletedProcess | str#
Main entry point — run the simulation either
locally (subprocess), or
by submitting to an external scheduler.
- Parameters:
- **subprocess_kwargs
Forwarded to
subprocess.runfor local execution.
- Returns:
subprocess.CompletedProcessFor local runs (contains
stdout,stderr,returncode).strFor scheduler runs — external job ID such as
"slurm_job_12345".
- Raises:
ExceptionOn any failure (solver not found, submission error, timeout, …).
- HFSSSimulationConfig.generate_command_list() List[str]#
List form for subprocess.run(shell=False). Local → list=… Scheduler → distributed numcores=… + -auto
- HFSSSimulationConfig.to_dict() Dict[str, Any]#
Serialize the complete configuration to a JSON-safe dictionary.
- Returns:
dictContains all fields including nested BaseModels and enums.
- classmethod HFSSSimulationConfig.from_dict(data: Dict[str, Any]) HFSSSimulationConfig#
Deserialize a dictionary produced by
to_dict().- Parameters:
- data
dict Dictionary obtained via
json.loador equivalent.
- data
- Returns:
HFSSSimulationConfigNew validated instance.