ParsedLog#
- class pyedb.workflows.utilities.hfss_log_parser.ParsedLog#
Root container returned by HFSSLogParser.parse().
This class holds all parsed information from an HFSS log file and provides convenience methods for checking convergence, completion status, and extracting specific metrics.
- Attributes:
Examples
>>> from pathlib import Path >>> parsed = ParsedLog( ... project=ProjectInfo(name="Test", file=Path("/tmp/test.aedt")), ... init_mesh=InitMesh(tetrahedra=5000, memory_mb=100, real_time_sec=30, cpu_time_sec=28), ... adaptive=[], ... sweep=None, ... ) >>> parsed.project.name 'Test'
Overview#
Deep-convert the entire object to JSON-serializable primitives. |
|
Check if the adaptive solver declared convergence. |
|
Return the list of adaptive passes. |
|
Memory consumed by the last converged adaptive pass. |
|
Check if the simulation completed successfully. |
|
Extract error lines from the log file. |
Import detail#
from pyedb.workflows.utilities.hfss_log_parser import ParsedLog
Attribute detail#
- ParsedLog.project: ProjectInfo#
- ParsedLog.adaptive: list[AdaptivePass]#
Method detail#
- ParsedLog.to_dict() dict#
Deep-convert the entire object to JSON-serializable primitives.
- Returns:
dictPlain dict/list/scalar structure suitable for JSON serialization.
Examples
>>> parsed = ParsedLog(project=..., init_mesh=..., adaptive=[], sweep=None) >>> data_dict = parsed.to_dict() >>> isinstance(data_dict, dict) True
- ParsedLog.is_converged() bool#
Check if the adaptive solver declared convergence.
- Returns:
- bool
Trueif at least one adaptive pass converged,Falseotherwise.
Examples
>>> parsed = ParsedLog( ... project=ProjectInfo(name="T", file=Path("/t")), ... init_mesh=InitMesh(tetrahedra=100, memory_mb=10, real_time_sec=5, cpu_time_sec=5), ... adaptive=[ ... AdaptivePass( ... pass_nr=1, ... freq_hz=1e9, ... tetrahedra=100, ... matrix_size=50, ... memory_mb=10, ... delta_s=0.01, ... converged=True, ... elapsed_sec=10, ... ) ... ], ... sweep=None, ... ) >>> parsed.is_converged() True
- ParsedLog.adaptive_passes() list[AdaptivePass]#
Return the list of adaptive passes.
- Returns:
listofAdaptivePassAll adaptive passes in chronological order.
Examples
>>> parsed = ParsedLog(project=..., init_mesh=..., adaptive=[pass1, pass2], sweep=None) >>> passes = parsed.adaptive_passes() >>> len(passes) 2
- ParsedLog.memory_on_convergence() float#
Memory consumed by the last converged adaptive pass.
- Returns:
floatMemory in megabytes, or
math.nanif no pass converged.
Examples
>>> parsed = ParsedLog( ... project=ProjectInfo(name="T", file=Path("/t")), ... init_mesh=InitMesh(tetrahedra=100, memory_mb=10, real_time_sec=5, cpu_time_sec=5), ... adaptive=[ ... AdaptivePass( ... pass_nr=1, ... freq_hz=1e9, ... tetrahedra=100, ... matrix_size=50, ... memory_mb=256.5, ... delta_s=0.01, ... converged=True, ... elapsed_sec=10, ... ) ... ], ... sweep=None, ... ) >>> parsed.memory_on_convergence() 256.5
- ParsedLog.is_completed() bool#
Check if the simulation completed successfully.
A simulation is considered complete when both adaptive convergence occurred and a frequency sweep was executed.
- Returns:
- bool
Trueif converged and sweep completed,Falseotherwise.
Examples
>>> parsed = ParsedLog( ... project=ProjectInfo(name="T", file=Path("/t")), ... init_mesh=InitMesh(tetrahedra=100, memory_mb=10, real_time_sec=5, cpu_time_sec=5), ... adaptive=[ ... AdaptivePass( ... pass_nr=1, ... freq_hz=1e9, ... tetrahedra=100, ... matrix_size=50, ... memory_mb=256, ... delta_s=0.01, ... converged=True, ... elapsed_sec=10, ... ) ... ], ... sweep=Sweep(type="Interpolating", frequencies=11, solved=[1e9], elapsed_sec=30), ... ) >>> parsed.is_completed() True
- ParsedLog.errors() list[str]#
Extract error lines from the log file.
Searches the log for lines containing error markers like
[error]or*** ERROR ***. Warnings are ignored.Examples
>>> parsed = ParsedLog(project=..., init_mesh=..., adaptive=[], sweep=None) >>> errs = parsed.errors() >>> len(errs) 0