Skip to content

Commit d7bb1a9

Browse files
committed
Fix charge doc
1 parent 72955b8 commit d7bb1a9

File tree

11 files changed

+64
-49
lines changed

11 files changed

+64
-49
lines changed

tidy3d/components/grid/grid_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ class GridSpec(Tidy3dBaseModel):
21082108
wavelength: float = pd.Field(
21092109
None,
21102110
title="Free-space wavelength",
2111-
description="Free-space wavelength for automatic nonuniform grid. It can be 'None' "
2111+
description="Free-space wavelength for automatic nonuniform grid. It can be ``None`` "
21122112
"if there is at least one source in the simulation, in which case it is defined by "
21132113
"the source central frequency. "
21142114
"Note: it only takes effect when at least one of the three dimensions "

tidy3d/components/material/tcad/charge.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
MobilityModelType,
1515
RecombinationModelType,
1616
)
17-
from tidy3d.constants import (
18-
CONDUCTIVITY,
19-
ELECTRON_VOLT,
20-
PERMITTIVITY,
21-
)
17+
from tidy3d.constants import CONDUCTIVITY, ELECTRON_VOLT, PERCMCUBE, PERMITTIVITY
2218

2319

2420
class AbstractChargeMedium(AbstractMedium):
@@ -47,7 +43,7 @@ def n_cfl(self):
4743
class ChargeInsulatorMedium(AbstractChargeMedium):
4844
"""
4945
Insulating medium. Conduction simulations will not solve for electric
50-
potential in a structure that has a medium with this 'charge'.
46+
potential in a structure that has a medium with this ``charge``.
5147
5248
Example
5349
-------
@@ -258,21 +254,21 @@ class SemiconductorMedium(AbstractChargeMedium):
258254
N_c: pd.PositiveFloat = pd.Field(
259255
...,
260256
title="Effective density of electron states",
261-
description=r"$N_c$ Effective density of states in the conduction band.",
262-
units="cm^(-3)",
257+
description=":math:`N_c` Effective density of states in the conduction band.",
258+
units=PERCMCUBE,
263259
)
264260

265261
N_v: pd.PositiveFloat = pd.Field(
266262
...,
267263
title="Effective density of hole states",
268-
description=r"$N_v$ Effective density of states in the valence band.",
269-
units="cm^(-3)",
264+
description=":math:`N_v` Effective density of states in the valence band.",
265+
units=PERCMCUBE,
270266
)
271267

272268
E_g: pd.PositiveFloat = pd.Field(
273269
...,
274270
title="Band-gap energy",
275-
description="Band-gap energy",
271+
description=":math:`E_g` Band-gap energy",
276272
units=ELECTRON_VOLT,
277273
)
278274

@@ -296,8 +292,9 @@ class SemiconductorMedium(AbstractChargeMedium):
296292

297293
delta_E_g: BandGapNarrowingModelType = pd.Field(
298294
None,
299-
title=":math:`\\Delta E_g` Bandgap narrowing model.",
300-
description="Bandgap narrowing model.",
295+
title="Bandgap narrowing model.",
296+
description=":math:`\\Delta E_g` Bandgap narrowing model.",
297+
units=ELECTRON_VOLT,
301298
)
302299

303300
N_a: Union[pd.NonNegativeFloat, SpatialDataArray, tuple[DopingBoxType, ...]] = pd.Field(
@@ -306,7 +303,7 @@ class SemiconductorMedium(AbstractChargeMedium):
306303
description="Concentration of acceptor impurities, which create mobile holes, resulting in p-type material. "
307304
"Can be specified as a single float for uniform doping, a :class:`SpatialDataArray` for a custom profile, "
308305
"or a tuple of geometric shapes to define specific doped regions.",
309-
units="1/cm^3",
306+
units=PERCMCUBE,
310307
)
311308

312309
N_d: Union[pd.NonNegativeFloat, SpatialDataArray, tuple[DopingBoxType, ...]] = pd.Field(
@@ -315,5 +312,5 @@ class SemiconductorMedium(AbstractChargeMedium):
315312
description="Concentration of donor impurities, which create mobile electrons, resulting in n-type material. "
316313
"Can be specified as a single float for uniform doping, a :class:`SpatialDataArray` for a custom profile, "
317314
"or a tuple of geometric shapes to define specific doped regions.",
318-
units="1/cm^3",
315+
units=PERCMCUBE,
319316
)

tidy3d/components/medium.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,17 @@ class NonlinearSusceptibility(NonlinearModel):
315315
chi3: float = pd.Field(
316316
0,
317317
title="Chi3",
318-
description="Chi3 nonlinear susceptibility.",
318+
description=":math:`\\chi_3` nonlinear susceptibility.",
319319
units=f"{MICROMETER}^2 / {VOLT}^2",
320320
)
321321

322322
numiters: pd.PositiveInt = pd.Field(
323323
None,
324324
title="Number of iterations",
325-
description="Deprecated. The old usage 'nonlinear_spec=model' with 'model.numiters' "
325+
description="Deprecated. The old usage ``nonlinear_spec=model`` with ``model.numiters`` "
326326
"is deprecated and will be removed in a future release. The new usage is "
327-
r"'nonlinear_spec=NonlinearSpec(models=\[model], num_iters=num_iters)'. Under the new "
328-
"usage, this parameter is ignored, and 'NonlinearSpec.num_iters' is used instead.",
327+
"``nonlinear_spec=NonlinearSpec(models=[model], num_iters=num_iters)``. Under the new "
328+
"usage, this parameter is ignored, and ``NonlinearSpec.num_iters`` is used instead.",
329329
)
330330

331331
@pd.validator("numiters", always=True)
@@ -762,7 +762,7 @@ class AbstractMedium(ABC, Tidy3dBaseModel):
762762
title="Allow gain medium",
763763
description="Allow the medium to be active. Caution: "
764764
"simulations with a gain medium are unstable, and are likely to diverge."
765-
"Simulations where 'allow_gain' is set to 'True' will still be charged even if "
765+
"Simulations where ``allow_gain`` is set to ``True`` will still be charged even if "
766766
"diverged. Monitor data up to the divergence point will still be returned and can be "
767767
"useful in some cases.",
768768
)
@@ -6080,7 +6080,7 @@ class LossyMetalMedium(Medium):
60806080
title="Allow gain medium",
60816081
description="Allow the medium to be active. Caution: "
60826082
"simulations with a gain medium are unstable, and are likely to diverge."
6083-
"Simulations where 'allow_gain' is set to 'True' will still be charged even if "
6083+
"Simulations where ``allow_gain`` is set to ``True`` will still be charged even if "
60846084
"diverged. Monitor data up to the divergence point will still be returned and can be "
60856085
"useful in some cases.",
60866086
)
@@ -6866,8 +6866,8 @@ class CustomAnisotropicMedium(AbstractCustomMedium, AnisotropicMedium):
68666866
interp_method: Optional[InterpMethod] = pd.Field(
68676867
None,
68686868
title="Interpolation method",
6869-
description="When the value is 'None', each component will follow its own "
6870-
"interpolation method. When the value is other than 'None', the interpolation "
6869+
description="When the value is ``None`` each component will follow its own "
6870+
"interpolation method. When the value is other than ``None`` the interpolation "
68716871
"method specified by this field will override the one in each component.",
68726872
)
68736873

tidy3d/components/spice/sources/dc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class DCVoltageSource(Tidy3dBaseModel):
5252
voltage: ArrayFloat1D = pd.Field(
5353
...,
5454
title="Voltage",
55-
description="DC voltage usually used as source in 'VoltageBC' boundary conditions.",
55+
description="DC voltage usually used as source in :class:`VoltageBC` boundary conditions.",
5656
units=VOLT,
5757
)
5858

@@ -81,7 +81,7 @@ class DCCurrentSource(Tidy3dBaseModel):
8181
name: Optional[str]
8282
current: pd.FiniteFloat = pd.Field(
8383
title="Current",
84-
description="DC current usually used as source in 'CurrentBC' boundary conditions.",
84+
description="DC current usually used as source in :class:`CurrentBC` boundary conditions.",
8585
units=AMP,
8686
)
8787

tidy3d/components/tcad/bandgap.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ class SlotboomBandGapNarrowing(Tidy3dBaseModel):
3939

4040
v1: pd.PositiveFloat = pd.Field(
4141
...,
42-
title=r"$V_{1,bgn}$ parameter",
43-
description=r"$V_{1,bgn}$ parameter",
42+
title=":math:`V_{1,bgn}` parameter",
43+
description=":math:`V_{1,bgn}` parameter",
4444
units=VOLT,
4545
)
4646

4747
n2: pd.PositiveFloat = pd.Field(
4848
...,
49-
title=r"$N_{2,bgn}$ parameter",
50-
description=r"$N_{2,bgn}$ parameter",
49+
title=":math:`N_{2,bgn}` parameter",
50+
description=":math:`N_{2,bgn}` parameter",
5151
units=PERCMCUBE,
5252
)
5353

5454
c2: float = pd.Field(
55-
title=r"$C_{2,bgn}$ parameter",
56-
description=r"$C_{2,bgn}$ parameter",
55+
title=":math:`C_{2,bgn}` parameter",
56+
description=":math:`C_{2,bgn}` parameter",
5757
)
5858

5959
min_N: pd.NonNegativeFloat = pd.Field(

tidy3d/components/tcad/data/monitor_data/abstract.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
HeatChargeMonitorType,
1919
)
2020
from tidy3d.components.types import Coordinate, ScalarSymmetry, annotate_type
21+
from tidy3d.constants import MICROMETER
2122
from tidy3d.log import log
2223

2324
FieldDataset = Union[
@@ -45,6 +46,7 @@ class HeatChargeMonitorData(AbstractMonitorData, ABC):
4546
(0, 0, 0),
4647
title="Symmetry Center",
4748
description="Symmetry center of the original simulation in x, y, and z.",
49+
units=MICROMETER,
4850
)
4951

5052
@abstractmethod

tidy3d/components/tcad/data/monitor_data/charge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,9 @@ class SteadyElectricFieldData(HeatChargeMonitorData):
380380
E: UnstructuredFieldType = pd.Field(
381381
None,
382382
title="Electric field",
383-
description="Contains the computed electric field in :math:`V/\\mu m`.",
383+
description="Contains the computed electric field.",
384384
discriminator=TYPE_TAG_STR,
385+
units=":math:`V/\\mu m`",
385386
)
386387

387388
@property
@@ -422,8 +423,9 @@ class SteadyCurrentDensityData(HeatChargeMonitorData):
422423
J: UnstructuredFieldType = pd.Field(
423424
None,
424425
title="Current density",
425-
description="Contains the computed current density in :math:`A/\\mu m^2`.",
426+
description="Contains the computed current density.",
426427
discriminator=TYPE_TAG_STR,
428+
units=":math:`A/\\mu m^2`",
427429
)
428430

429431
@property

tidy3d/components/tcad/doping.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from tidy3d.components.base import cached_property
1111
from tidy3d.components.geometry.base import Box
12-
from tidy3d.constants import PERCMCUBE
12+
from tidy3d.constants import MICROMETER, PERCMCUBE
1313
from tidy3d.exceptions import SetupError
1414

1515

@@ -115,7 +115,7 @@ class ConstantDoping(AbstractDopingBox):
115115
concentration: pd.NonNegativeFloat = pd.Field(
116116
default=0,
117117
title="Doping concentration density.",
118-
description="Doping concentration density in #/cm^3.",
118+
description="Doping concentration density.",
119119
units=PERCMCUBE,
120120
)
121121

@@ -189,27 +189,30 @@ class GaussianDoping(AbstractDopingBox):
189189
title="Reference concentration.",
190190
description="Reference concentration. This is the minimum concentration in the box "
191191
"and it is attained at the edges/faces of the box.",
192+
units=PERCMCUBE,
192193
)
193194

194195
concentration: pd.PositiveFloat = pd.Field(
195196
title="Concentration",
196197
description="The concentration at the center of the box.",
198+
units=PERCMCUBE,
197199
)
198200

199201
width: pd.PositiveFloat = pd.Field(
200202
title="Width of the gaussian.",
201203
description="Width of the gaussian. The concentration will transition from "
202204
"``concentration`` at the center of the box to ``ref_con`` at the edge/face "
203205
"of the box in a distance equal to ``width``. ",
206+
units=MICROMETER,
204207
)
205208

206209
source: str = pd.Field(
207210
"xmin",
208211
title="Source face",
209212
description="Specifies the side of the box acting as the source, i.e., "
210213
"the face specified does not have a gaussian evolution normal to it, instead "
211-
"the concentration is constant from this face. Accepted values for 'source' "
212-
"are ['xmin', 'xmax', 'ymin', 'ymax', 'zmin', 'zmax']",
214+
"the concentration is constant from this face. Accepted values for ``source`` "
215+
"are [``xmin``, ``xmax``, ``ymin``, ``ymax``, ``zmin``, ``zmax``]",
213216
)
214217

215218
@cached_property

tidy3d/components/tcad/generation_recombination.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,17 @@ class AugerRecombination(Tidy3dBaseModel):
9191
"""
9292

9393
c_n: pd.PositiveFloat = pd.Field(
94-
..., title="Constant for electrons", description="Constant for electrons in cm^6/s"
94+
...,
95+
title="Constant for electrons",
96+
description="Constant for electrons.",
97+
units="cm^6/s",
9598
)
9699

97100
c_p: pd.PositiveFloat = pd.Field(
98-
..., title="Constant for holes", description="Constant for holes in cm^6/s"
101+
...,
102+
title="Constant for holes",
103+
description="Constant for holes.",
104+
units="cm^6/s",
99105
)
100106

101107

@@ -122,8 +128,9 @@ class RadiativeRecombination(Tidy3dBaseModel):
122128

123129
r_const: float = pd.Field(
124130
...,
125-
title="Radiation constant in cm^3/s",
126-
description="Radiation constant in cm^3/s",
131+
title="Radiation constant",
132+
description="Radiation constant of the radiative recombination model.",
133+
units="cm^3/s",
127134
)
128135

129136

@@ -193,8 +200,8 @@ class DistributedGeneration(Tidy3dBaseModel):
193200
rate: SpatialDataArray = pd.Field(
194201
...,
195202
title="Generation rate",
196-
description="Spatially varying generation rate in cm^-3 s^-1",
197-
units="cm^-3 s^-1",
203+
description="Spatially varying generation rate.",
204+
units="1/(cm^3 s^1)",
198205
)
199206

200207
@classmethod

tidy3d/components/tcad/mobility.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pydantic.v1 as pd
44

55
from tidy3d.components.base import Tidy3dBaseModel
6+
from tidy3d.constants import PERCMCUBE
67

78

89
class ConstantMobilityModel(Tidy3dBaseModel):
@@ -116,14 +117,16 @@ class CaugheyThomasMobility(Tidy3dBaseModel):
116117
# mobilities
117118
mu_min: pd.PositiveFloat = pd.Field(
118119
...,
119-
title=r"$\mu_{min}$ Minimum electron mobility",
120-
description="Minimum electron mobility at reference temperature (300K) in cm^2/V-s. ",
120+
title="Minimum electron mobility",
121+
description="Minimum electron mobility :math:`\\mu_{\\text{min}}` at reference temperature (300K).",
122+
units="cm^2/V-s",
121123
)
122124

123125
mu: pd.PositiveFloat = pd.Field(
124126
...,
125127
title="Reference mobility",
126-
description="Reference mobility at reference temperature (300K) in cm^2/V-s",
128+
description="Reference mobility at reference temperature (300K).",
129+
units="cm^2/V-s",
127130
)
128131

129132
# thermal exponent for reference mobility
@@ -142,7 +145,8 @@ class CaugheyThomasMobility(Tidy3dBaseModel):
142145
ref_N: pd.PositiveFloat = pd.Field(
143146
...,
144147
title="Reference doping",
145-
description="Reference doping at reference temperature (300K) in #/cm^3.",
148+
description="Reference doping at reference temperature (300K).",
149+
units=PERCMCUBE,
146150
)
147151

148152
# temperature exponent

0 commit comments

Comments
 (0)