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:
projectProjectInfo

Project meta-data including name, file path, and design information.

init_meshInitMesh

Initial mesh statistics.

adaptivelist of AdaptivePass

Adaptive passes in chronological order.

sweepSweep or None

Frequency-sweep summary, or None if no sweep was performed.

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#

to_dict

Deep-convert the entire object to JSON-serializable primitives.

is_converged

Check if the adaptive solver declared convergence.

adaptive_passes

Return the list of adaptive passes.

memory_on_convergence

Memory consumed by the last converged adaptive pass.

is_completed

Check if the simulation completed successfully.

errors

Extract error lines from the log file.

Import detail#

from pyedb.workflows.utilities.hfss_log_parser import ParsedLog

Attribute detail#

ParsedLog.project: ProjectInfo#
ParsedLog.init_mesh: InitMesh#
ParsedLog.adaptive: list[AdaptivePass]#
ParsedLog.sweep: Sweep | None#

Method detail#

ParsedLog.to_dict() dict#

Deep-convert the entire object to JSON-serializable primitives.

Returns:
dict

Plain 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

True if at least one adaptive pass converged, False otherwise.

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:
list of AdaptivePass

All 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:
float

Memory in megabytes, or math.nan if 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

True if converged and sweep completed, False otherwise.

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.

Returns:
list of str

List of stripped error lines, empty if none found.

Examples

>>> parsed = ParsedLog(project=..., init_mesh=..., adaptive=[], sweep=None)
>>> errs = parsed.errors()
>>> len(errs)
0