refactor: Common SocketDef owner in `sockets.base`

main
Sofus Albert Høgsbro Rose 2024-04-15 17:48:29 +02:00
parent 4f6bd8e990
commit b5a4b6b0a1
Signed by: so-rose
GPG Key ID: AD901CB0F3701434
47 changed files with 47 additions and 47 deletions

View File

@ -23,7 +23,7 @@ class AnyBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class AnySocketDef(pyd.BaseModel):
class AnySocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Any
def init(self, bl_socket: AnyBLSocket) -> None:

View File

@ -44,7 +44,7 @@ class BoolBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class BoolSocketDef(pyd.BaseModel):
class BoolSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Bool
default_value: bool = False

View File

@ -46,7 +46,7 @@ class FilePathBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class FilePathSocketDef(pyd.BaseModel):
class FilePathSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.FilePath
default_path: Path = Path()

View File

@ -43,7 +43,7 @@ class StringBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class StringSocketDef(pyd.BaseModel):
class StringSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.String
default_text: str = ''

View File

@ -43,7 +43,7 @@ class BlenderCollectionBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class BlenderCollectionSocketDef(pyd.BaseModel):
class BlenderCollectionSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.BlenderCollection
def init(self, bl_socket: BlenderCollectionBLSocket) -> None:

View File

@ -82,7 +82,7 @@ class BlenderGeoNodesBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class BlenderGeoNodesSocketDef(pyd.BaseModel):
class BlenderGeoNodesSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.BlenderGeoNodes
def init(self, bl_socket: BlenderGeoNodesBLSocket) -> None:

View File

@ -43,7 +43,7 @@ class BlenderImageBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class BlenderImageSocketDef(pyd.BaseModel):
class BlenderImageSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.BlenderImage
def init(self, bl_socket: BlenderImageBLSocket) -> None:

View File

@ -40,7 +40,7 @@ class BlenderMaterialBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class BlenderMaterialSocketDef(pyd.BaseModel):
class BlenderMaterialSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.BlenderMaterial
def init(self, bl_socket: BlenderMaterialBLSocket) -> None:

View File

@ -88,7 +88,7 @@ class BlenderObjectBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class BlenderObjectSocketDef(pyd.BaseModel):
class BlenderObjectSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.BlenderObject
def init(self, bl_socket: BlenderObjectBLSocket) -> None:

View File

@ -43,7 +43,7 @@ class BlenderTextBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class BlenderTextSocketDef(pyd.BaseModel):
class BlenderTextSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.BlenderText
def init(self, bl_socket: BlenderTextBLSocket) -> None:

View File

@ -53,7 +53,7 @@ class MaxwellBoundCondBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellBoundCondSocketDef(pyd.BaseModel):
class MaxwellBoundCondSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellBoundCond
default_choice: typx.Literal['PML', 'PEC', 'PMC', 'PERIODIC'] = 'PML'

View File

@ -124,7 +124,7 @@ class MaxwellBoundCondsBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellBoundCondsSocketDef(pyd.BaseModel):
class MaxwellBoundCondsSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellBoundConds
def init(self, bl_socket: MaxwellBoundCondsBLSocket) -> None:

View File

@ -16,7 +16,7 @@ class MaxwellFDTDSimBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellFDTDSimSocketDef(pyd.BaseModel):
class MaxwellFDTDSimSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellFDTDSim
def init(self, bl_socket: MaxwellFDTDSimBLSocket) -> None:

View File

@ -16,7 +16,7 @@ class MaxwellFDTDSimDataBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellFDTDSimDataSocketDef(pyd.BaseModel):
class MaxwellFDTDSimDataSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellFDTDSimData
def init(self, bl_socket: MaxwellFDTDSimDataBLSocket) -> None:

View File

@ -98,7 +98,7 @@ class MaxwellMediumBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellMediumSocketDef(pyd.BaseModel):
class MaxwellMediumSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellMedium
default_permittivity_real: float = 1.0

View File

@ -12,7 +12,7 @@ class MaxwellMediumNonLinearityBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellMediumNonLinearitySocketDef(pyd.BaseModel):
class MaxwellMediumNonLinearitySocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellMediumNonLinearity
def init(self, bl_socket: MaxwellMediumNonLinearityBLSocket) -> None:

View File

@ -12,7 +12,7 @@ class MaxwellMonitorBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellMonitorSocketDef(pyd.BaseModel):
class MaxwellMonitorSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellMonitor
is_list: bool = False

View File

@ -12,7 +12,7 @@ class MaxwellSimDomainBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellSimDomainSocketDef(pyd.BaseModel):
class MaxwellSimDomainSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellSimDomain
def init(self, bl_socket: MaxwellSimDomainBLSocket) -> None:

View File

@ -48,7 +48,7 @@ class MaxwellSimGridBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellSimGridSocketDef(pyd.BaseModel):
class MaxwellSimGridSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellSimGrid
min_steps_per_wl: float = 10.0

View File

@ -12,7 +12,7 @@ class MaxwellSimGridAxisBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellSimGridAxisSocketDef(pyd.BaseModel):
class MaxwellSimGridAxisSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellSimGridAxis
def init(self, bl_socket: MaxwellSimGridAxisBLSocket) -> None:

View File

@ -12,7 +12,7 @@ class MaxwellSourceBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellSourceSocketDef(pyd.BaseModel):
class MaxwellSourceSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellSource
is_list: bool = False

View File

@ -12,7 +12,7 @@ class MaxwellStructureBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellStructureSocketDef(pyd.BaseModel):
class MaxwellStructureSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellStructure
is_list: bool = False

View File

@ -12,7 +12,7 @@ class MaxwellTemporalShapeBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class MaxwellTemporalShapeSocketDef(pyd.BaseModel):
class MaxwellTemporalShapeSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.MaxwellTemporalShape
def init(self, bl_socket: MaxwellTemporalShapeBLSocket) -> None:

View File

@ -119,7 +119,7 @@ class ComplexNumberBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class ComplexNumberSocketDef(pyd.BaseModel):
class ComplexNumberSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.ComplexNumber
default_value: SympyExpr = sp.S(0 + 0j)

View File

@ -44,7 +44,7 @@ class IntegerNumberBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class IntegerNumberSocketDef(pyd.BaseModel):
class IntegerNumberSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.IntegerNumber
default_value: int = 0

View File

@ -55,7 +55,7 @@ class RationalNumberBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class RationalNumberSocketDef(pyd.BaseModel):
class RationalNumberSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.RationalNumber
default_value: SympyExpr = sp.Rational(0, 1)

View File

@ -49,7 +49,7 @@ class RealNumberBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class RealNumberSocketDef(pyd.BaseModel):
class RealNumberSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.RealNumber
default_value: float = 0.0

View File

@ -47,7 +47,7 @@ class PhysicalAccelScalarBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalAccelScalarSocketDef(pyd.BaseModel):
class PhysicalAccelScalarSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalAccelScalar
default_unit: SympyExpr | None = None

View File

@ -47,7 +47,7 @@ class PhysicalAngleBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalAngleSocketDef(pyd.BaseModel):
class PhysicalAngleSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalAngle
default_unit: SympyExpr | None = None

View File

@ -55,7 +55,7 @@ class PhysicalAreaBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalAreaSocketDef(pyd.BaseModel):
class PhysicalAreaSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalArea
default_unit: typ.Any | None = None

View File

@ -47,7 +47,7 @@ class PhysicalForceScalarBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalForceScalarSocketDef(pyd.BaseModel):
class PhysicalForceScalarSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalForceScalar
default_unit: SympyExpr | None = None

View File

@ -97,7 +97,7 @@ class PhysicalFreqBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalFreqSocketDef(pyd.BaseModel):
class PhysicalFreqSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalFreq
is_array: bool = False

View File

@ -96,7 +96,7 @@ class PhysicalLengthBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalLengthSocketDef(pyd.BaseModel):
class PhysicalLengthSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalLength
is_array: bool = False

View File

@ -47,7 +47,7 @@ class PhysicalMassBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalMassSocketDef(pyd.BaseModel):
class PhysicalMassSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalMass
default_unit: SympyExpr | None = None

View File

@ -48,7 +48,7 @@ class PhysicalPoint3DBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalPoint3DSocketDef(pyd.BaseModel):
class PhysicalPoint3DSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalPoint3D
default_unit: typ.Any | None = None

View File

@ -237,7 +237,7 @@ class PhysicalPolBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalPolSocketDef(pyd.BaseModel):
class PhysicalPolSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalPol
def init(self, bl_socket: PhysicalPolBLSocket) -> None:

View File

@ -46,7 +46,7 @@ class PhysicalSize3DBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalSize3DSocketDef(pyd.BaseModel):
class PhysicalSize3DSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalSize3D
default_value: SympyExpr = sp.Matrix([1, 1, 1]) * spu.um

View File

@ -47,7 +47,7 @@ class PhysicalSpeedBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalSpeedSocketDef(pyd.BaseModel):
class PhysicalSpeedSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalSpeed
default_unit: SympyExpr | None = None

View File

@ -49,7 +49,7 @@ class PhysicalTimeBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalTimeSocketDef(pyd.BaseModel):
class PhysicalTimeSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalTime
default_value: SympyExpr | None = None

View File

@ -273,7 +273,7 @@ class PhysicalUnitSystemBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalUnitSystemSocketDef(pyd.BaseModel):
class PhysicalUnitSystemSocketDef(base.SocketDef):
socket_type: ST = ST.PhysicalUnitSystem
show_by_default: bool = False

View File

@ -44,7 +44,7 @@ class PhysicalVolumeBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class PhysicalVolumeSocketDef(pyd.BaseModel):
class PhysicalVolumeSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.PhysicalVolume
default_unit: SympyExpr | None = None

View File

@ -319,7 +319,7 @@ class Tidy3DCloudTaskBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class Tidy3DCloudTaskSocketDef(pyd.BaseModel):
class Tidy3DCloudTaskSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Tidy3DCloudTask
should_exist: bool

View File

@ -15,7 +15,7 @@ class Complex2DVectorBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class Complex2DVectorSocketDef(pyd.BaseModel):
class Complex2DVectorSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Complex2DVector
def init(self, bl_socket: Complex2DVectorBLSocket) -> None:

View File

@ -15,7 +15,7 @@ class Complex3DVectorBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class Complex3DVectorSocketDef(pyd.BaseModel):
class Complex3DVectorSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Complex3DVector
def init(self, bl_socket: Complex3DVectorBLSocket) -> None:

View File

@ -54,7 +54,7 @@ class Integer3DVectorBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class Integer3DVectorSocketDef(pyd.BaseModel):
class Integer3DVectorSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Integer3DVector
default_value: Integer3DVector = sp.Matrix([0, 0, 0])

View File

@ -55,7 +55,7 @@ class Real2DVectorBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class Real2DVectorSocketDef(pyd.BaseModel):
class Real2DVectorSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Real2DVector
default_value: Real2DVector = sp.Matrix([0.0, 0.0])

View File

@ -55,7 +55,7 @@ class Real3DVectorBLSocket(base.MaxwellSimSocket):
####################
# - Socket Configuration
####################
class Real3DVectorSocketDef(pyd.BaseModel):
class Real3DVectorSocketDef(base.SocketDef):
socket_type: ct.SocketType = ct.SocketType.Real3DVector
default_value: Real3DVector = sp.Matrix([0.0, 0.0, 0.0])