class ParameterFloat[source]#

Bases: ParameterNumeric

Parameter containing floats.

  • attrs (dict = {}) – 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().

  • name (str) – Unique name for the variable. Used as a key into the parameter sweep results.

  • values (Optional[Tuple[Any, ...]] = None) – If specified, the parameter scan uses these values for grid search methods.

  • span (Tuple[Union[float, int], Union[float, int]]) – (min, max) inclusive range within which the variable should be swept.

  • num_points (Optional[PositiveInt] = None) – Number of uniform sampling points for this variable. Only used for ‘MethodGrid’.


>>> import tidy3d.plugins.design as tdd
>>> var = tdd.ParameterFloat(name="x", num_points=10, span=(1, 2.5))




Sample this design variable randomly 'num_samples' times.


Select values given a set of points between 0, 1.

Inherited Common Usage


Sample this design variable randomly ‘num_samples’ times.


Select values given a set of points between 0, 1.


Hash method.