"""Sets the configuration of the script, can be changed with `td.config.config_name = new_val`."""importpydantic.v1aspdfrom.logimportDEFAULT_LEVEL,LogLevel,set_logging_level,set_log_suppression
[docs]classTidy3dConfig(pd.BaseModel):"""configuration of tidy3d"""
[docs]classConfig:"""Config of the config."""arbitrary_types_allowed=Falsevalidate_all=Trueextra="forbid"validate_assignment=Trueallow_population_by_field_name=Truefrozen=False
logging_level:LogLevel=pd.Field(DEFAULT_LEVEL,title="Logging Level",description="The lowest level of logging output that will be displayed. "'Can be "DEBUG", "SUPPORT", "USER", INFO", "WARNING", "ERROR", or "CRITICAL". ''Note: "SUPPORT" and "USER" levels are only used in backend solver logging.',)log_suppression:bool=pd.Field(True,title="Log suppression",description="Enable or disable suppression of certain log messages when they are repeated ""for several elements.",)@pd.validator("logging_level",pre=True,always=True)def_set_logging_level(cls,val):"""Set the logging level if logging_level is changed."""set_logging_level(val)returnval@pd.validator("log_suppression",pre=True,always=True)def_set_log_suppression(cls,val):"""Control log suppression when log_suppression is changed."""set_log_suppression(val)returnval
# instance of the config that can be modified.config=Tidy3dConfig()