Skip to content

Commit 7aac129

Browse files
committed
feat: add mil and inch units to plot_length_units
1 parent 15d1342 commit 7aac129

File tree

11 files changed

+148
-25
lines changed

11 files changed

+148
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- Selective simulation capabilities to `TerminalComponentModeler` via `run_only` and `element_mappings` fields, allowing users to run fewer simulations and extract only needed scattering matrix elements.
1212
- Added KLayout plugin, with DRC functionality for running design rule checks in `plugins.klayout.drc`. Supports running DRC on GDS files as well as `Geometry`, `Structure`, and `Simulation` objects.
13+
- Added "mil" and "in" (inch) units to `plot_length_units`.
1314

1415
### Changed
1516
- Validate mode solver object for large number of grid points on the modal plane.

schemas/EMESimulation.json

Lines changed: 4 additions & 2 deletions
Large diffs are not rendered by default.

schemas/HeatChargeSimulation.json

Lines changed: 4 additions & 2 deletions
Large diffs are not rendered by default.

schemas/HeatSimulation.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"title": "HeatSimulation",
3-
"description": "Contains all information about heat simulation.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nExample\n-------\n>>> import tidy3d as td\n>>> heat_sim = td.HeatSimulation( # doctest: +SKIP\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0, heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )",
3+
"description": "Contains all information about heat simulation.\n\nParameters\n----------\nattrs : dict = {}\n Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, ``attrs`` are mutable. For example, the following is allowed for setting an ``attr`` ``obj.attrs['foo'] = bar``. Also note that `Tidy3D`` will raise a ``TypeError`` if ``attrs`` contain objects that can not be serialized. One can check if ``attrs`` are serializable by calling ``obj.json()``.\ncenter : Union[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]], Box] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Union[tuple[Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box], Union[pydantic.v1.types.NonNegativeFloat, autograd.tracer.Box]], Box]\n [units = um]. Size in x, y, and z directions.\nmedium : Union[MultiPhysicsMedium, Medium, AnisotropicMedium, PECMedium, PMCMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, LossyMetalMedium, Medium2D, AnisotropicMediumFromMedium2D, FluidSpec, SolidSpec, SolidMedium, FluidMedium, ChargeConductorMedium, ChargeInsulatorMedium, SemiconductorMedium] = Medium(attrs={}, name=None, frequency_range=None, allow_gain=False, nonlinear_spec=None, modulation_spec=None, viz_spec=None, heat_spec=None, type='Medium', permittivity=1.0, conductivity=0.0)\n Background medium of simulation, defaults to a standard dispersion-less :class:`Medium` if not specified.\nstructures : Tuple[Structure, ...] = ()\n Tuple of structures present in simulation. Note: Structures defined later in this list override the simulation material properties in regions of spatial overlap.\nsymmetry : Tuple[Literal[0, 1], Literal[0, 1], Literal[0, 1]] = (0, 0, 0)\n Tuple of integers defining reflection symmetry across a plane bisecting the simulation domain normal to the x-, y-, and z-axis at the simulation center of each axis, respectively. Each element can be ``0`` (symmetry off) or ``1`` (symmetry on).\nsources : Tuple[Annotated[Union[tidy3d.components.tcad.source.heat.HeatSource, tidy3d.components.tcad.source.coupled.HeatFromElectricSource, tidy3d.components.tcad.source.heat.UniformHeatSource], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of heat and/or charge sources.\nboundary_spec : Tuple[Annotated[Union[tidy3d.components.tcad.boundary.specification.HeatChargeBoundarySpec, tidy3d.components.tcad.boundary.specification.HeatBoundarySpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n List of boundary condition specifications.\nmonitors : Tuple[Annotated[Union[tidy3d.components.tcad.monitors.heat.TemperatureMonitor, tidy3d.components.tcad.monitors.charge.SteadyPotentialMonitor, tidy3d.components.tcad.monitors.charge.SteadyFreeCarrierMonitor, tidy3d.components.tcad.monitors.charge.SteadyEnergyBandMonitor, tidy3d.components.tcad.monitors.charge.SteadyElectricFieldMonitor, tidy3d.components.tcad.monitors.charge.SteadyCapacitanceMonitor], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], ...] = ()\n Monitors in the simulation.\ngrid_spec : Union[UniformUnstructuredGrid, DistanceUnstructuredGrid]\n Grid specification for heat-charge simulation.\nversion : str = 2.10.0rc1\n String specifying the front end version number.\nplot_length_units : Optional[Literal['nm', '\u03bcm', 'um', 'mm', 'cm', 'm', 'mil', 'in']] = \u03bcm\n When set to a supported ``LengthUnit``, plots will be produced with proper scaling of axes and include the desired unit specifier in labels.\nstructure_priority_mode : Literal['equal', 'conductor'] = equal\n This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.\nanalysis_spec : Union[IsothermalSteadyChargeDCAnalysis, UnsteadyHeatAnalysis] = None\n The `analysis_spec` is used to specify the type of simulation. Currently, it is used to specify Charge simulations or transient Heat simulations.\n\nExample\n-------\n>>> import tidy3d as td\n>>> heat_sim = td.HeatSimulation( # doctest: +SKIP\n... size=(3.0, 3.0, 3.0),\n... structures=[\n... td.Structure(\n... geometry=td.Box(size=(1, 1, 1), center=(0, 0, 0)),\n... medium=td.Medium(\n... permittivity=2.0, heat_spec=td.SolidSpec(\n... conductivity=1,\n... capacity=1,\n... )\n... ),\n... name=\"box\",\n... ),\n... ],\n... medium=td.Medium(permittivity=3.0, heat_spec=td.FluidSpec()),\n... grid_spec=td.UniformUnstructuredGrid(dl=0.1),\n... sources=[td.HeatSource(rate=1, structures=[\"box\"])],\n... boundary_spec=[\n... td.HeatChargeBoundarySpec(\n... placement=td.StructureBoundary(structure=\"box\"),\n... condition=td.TemperatureBC(temperature=500),\n... )\n... ],\n... monitors=[td.TemperatureMonitor(size=(1, 2, 3), name=\"sample\")],\n... )",
44
"type": "object",
55
"properties": {
66
"attrs": {
@@ -439,7 +439,9 @@
439439
"um",
440440
"mm",
441441
"cm",
442-
"m"
442+
"m",
443+
"mil",
444+
"in"
443445
],
444446
"type": "string"
445447
},

0 commit comments

Comments
 (0)