File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
tidy3d/plugins/smatrix/component_modelers Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,14 @@ class AbstractComponentModeler(ABC, Tidy3dBaseModel):
109
109
"fields that were not used to create the task will cause errors." ,
110
110
)
111
111
112
+ local_gradient : bool = pd .Field (
113
+ False ,
114
+ title = "Local Gradient" ,
115
+ description = "Whether to run the gradient calculation locally. By default it is run through "
116
+ "the server to save data transfer. In some cases, such as debugging, it is useful to run "
117
+ "locally instead." ,
118
+ )
119
+
112
120
@pd .root_validator (pre = False )
113
121
def _warn_deprecation_2_10 (cls , values ):
114
122
log .warning (
@@ -219,7 +227,12 @@ def batch_data(self) -> BatchData:
219
227
"simulations" ,
220
228
}
221
229
)
222
- return run_async (batch .simulations , ** run_async_kwargs , path_dir = self .path_dir )
230
+ return run_async (
231
+ batch .simulations ,
232
+ ** run_async_kwargs ,
233
+ local_gradient = self .local_gradient ,
234
+ path_dir = self .path_dir ,
235
+ )
223
236
224
237
def get_path_dir (self , path_dir : str ) -> None :
225
238
"""Check whether the supplied 'path_dir' matches the internal field value."""
You can’t perform that action at this time.
0 commit comments