tidy3d.plugins.design.method.Method#

class Method[source]#

Bases: Tidy3dBaseModel, ABC

Spec for a sweep algorithm, with a method to run it.

Parameters:
  • 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 (Optional[str] = None) โ€“ Optional name for the sweep method.

Attributes

Methods

assert_hashable(fn_args)

Raise error if the function arguments aren't hashable (do before computation).

run(parameters,ย fn)

Defines the search algorithm (sequential).

sample(parameters,ย **kwargs)

Defines how the design parameters are sampled.

Inherited Common Usage

name#
abstract run(parameters, fn)[source]#

Defines the search algorithm (sequential).

abstract sample(parameters, **kwargs)[source]#

Defines how the design parameters are sampled.

static assert_hashable(fn_args)[source]#

Raise error if the function arguments arenโ€™t hashable (do before computation).

__hash__()#

Hash method.