Skip to content

Commit d4a2f75

Browse files
Further docstring classes
1 parent 2769ee8 commit d4a2f75

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

tidy3d/plugins/smatrix/data/data.py

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,56 @@
2121

2222

2323
class MicrowavePortSimulationData(Tidy3dBaseModel):
24-
data: dict[str, SimulationData]
24+
"""Stores raw simulation data from each microwave port-specific simulation."""
25+
26+
data: dict[str, SimulationData] = pd.Field(
27+
...,
28+
title="Port Simulation Data",
29+
description="A dictionary mapping each port name to its corresponding raw SimulationData object. "
30+
"This contains the raw field and mode data from the individual simulations "
31+
"run for each port to compute the S-parameters.",
32+
)
2533

2634

2735
class MicrowaveSMatrixData(Tidy3dBaseModel):
28-
port_reference_impedances: Optional[PortDataArray]
29-
data: TerminalPortDataArray
36+
"""Stores the computed S-matrix and reference impedances for the terminal ports."""
37+
38+
port_reference_impedances: Optional[PortDataArray] = pd.Field(
39+
None,
40+
title="Port Reference Impedances",
41+
description="Reference impedance for each port used in the S-parameter calculation. "
42+
"This is optional and may not be present if not specified or computed.",
43+
)
44+
data: TerminalPortDataArray = pd.Field(
45+
...,
46+
title="S-Matrix Data",
47+
description="An array containing the computed S-matrix of the device. The data is organized "
48+
"by terminal ports, representing the scattering parameters between them.",
49+
)
3050

3151

3252
class TerminalComponentModelerData(Tidy3dBaseModel):
3353
"""
34-
This class does not inherit from AbstractSimulationData intentionally, but does require some similar fields.
54+
Data associated with a :class:`TerminalComponentModeler` simulation run.
55+
56+
This class serves as a data container for the results of a component modeler simulation,
57+
holding the original simulation definition, the resulting S-matrix or raw port data,
58+
and the solver log.
3559
"""
3660

3761
simulation: TerminalComponentModeler = pd.Field(
3862
...,
3963
title="TerminalComponentModeler",
40-
description="Original :class:`TerminalComponentModeler` associated with the data.",
64+
description="The original :class:`TerminalComponentModeler` object that defines the simulation setup "
65+
"and from which this data was generated.",
4166
)
4267

4368
data: Union[MicrowaveSMatrixData, MicrowavePortSimulationData] = pd.Field(
4469
...,
45-
title="MicrowaveSMatrixData",
46-
description="List of :class:`AbstractMonitorData` instances "
47-
"associated with the monitors of the original :class:`AbstractSimulation`.",
70+
title="Microwave Data",
71+
description="The primary data output of the simulation. This can either be the computed "
72+
":class:`MicrowaveSMatrixData` containing the final S-parameters, or the "
73+
"raw :class:`MicrowavePortSimulationData` if the S-matrix computation was not performed.",
4874
)
4975

5076
log: str = pd.Field(

0 commit comments

Comments
 (0)