File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
tidy3d/components/spice/sources Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 19
19
20
20
"""
21
21
22
- from typing import Optional
22
+ from typing import Literal , Optional
23
23
24
24
import pydantic .v1 as pd
25
25
@@ -54,6 +54,10 @@ class DCVoltageSource(Tidy3dBaseModel):
54
54
units = VOLT ,
55
55
)
56
56
57
+ # TODO: This should have always been in the field above but was introduced wrongly as a
58
+ # standalone field. Keeping for compatibility, remove in 3.0.
59
+ units : Literal [VOLT ] = VOLT
60
+
57
61
@pd .validator ("voltage" )
58
62
def check_voltage (cls , val ):
59
63
for v in val :
@@ -76,5 +80,9 @@ class DCCurrentSource(Tidy3dBaseModel):
76
80
current : pd .FiniteFloat = pd .Field (
77
81
title = "Current" ,
78
82
description = "DC current usually used as source in 'CurrentBC' boundary conditions." ,
83
+ units = AMP ,
79
84
)
80
- units : str = AMP
85
+
86
+ # TODO: This should have always been in the field above but was introduced wrongly as a
87
+ # standalone field. Keeping for compatibility, remove in 3.0.
88
+ units : Literal [AMP ] = AMP
You can’t perform that action at this time.
0 commit comments