Skip to content

Commit af98aa7

Browse files
Most compatibility again
1 parent b70cae3 commit af98aa7

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

tidy3d/plugins/smatrix/component_modelers/terminal.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def run(self, path_dir: str = DEFAULT_DATA_DIR):
299299
# _ = self._upload_terminal_modeler()
300300
batch_data = self._construct_smatrix()
301301
smatrix_data = MicrowaveSMatrixData(batch_data=batch_data)
302-
return TerminalComponentModelerData(simulation=self, data=(smatrix_data,))
302+
return TerminalComponentModelerData(simulation=self, data=smatrix_data)
303303

304304
##### Backwards compatibility methods #####
305305

@@ -325,9 +325,9 @@ def _monitor_data_at_port_amplitude(
325325
TerminalComponentModelerData,
326326
)
327327

328-
a = MicrowaveSMatrixData(a=self._construct_smatrix())
328+
smatrix_data = MicrowaveSMatrixData(data=self._construct_smatrix())
329329
data = TerminalComponentModelerData(
330-
simulation=self, data=(a,)
330+
simulation=self, data=smatrix_data
331331
)._monitor_data_at_port_amplitude(
332332
port=port, sim_data=sim_data, monitor_data=monitor_data, a_port=a_port
333333
)
@@ -343,10 +343,10 @@ def get_antenna_metrics_data(
343343
TerminalComponentModelerData,
344344
)
345345

346-
a = MicrowaveSMatrixData(a=self._construct_smatrix())
347-
data = TerminalComponentModelerData(simulation=self, data=(a,)).get_antenna_metrics_data(
348-
port_amplitudes=port_amplitudes, monitor_name=monitor_name
349-
)
346+
smatrix_data = MicrowaveSMatrixData(data=self._construct_smatrix())
347+
data = TerminalComponentModelerData(
348+
simulation=self, data=smatrix_data
349+
).get_antenna_metrics_data(port_amplitudes=port_amplitudes, monitor_name=monitor_name)
350350
return data
351351

352352
@staticmethod
@@ -370,8 +370,10 @@ def port_reference_impedances(self) -> PortDataArray:
370370
TerminalComponentModelerData,
371371
)
372372

373-
a = MicrowaveSMatrixData(a=self._construct_smatrix())
374-
data = TerminalComponentModelerData(simulation=self, data=(a,)).port_reference_impedances
373+
smatrix_data = MicrowaveSMatrixData(data=self._construct_smatrix())
374+
data = TerminalComponentModelerData(
375+
simulation=self, data=smatrix_data
376+
).port_reference_impedances
375377
return data
376378

377379
def _port_reference_impedances(self, batch_data) -> PortDataArray:
@@ -380,8 +382,10 @@ def _port_reference_impedances(self, batch_data) -> PortDataArray:
380382
TerminalComponentModelerData,
381383
)
382384

383-
a = MicrowaveSMatrixData(a=self._construct_smatrix())
384-
data = TerminalComponentModelerData(simulation=self, data=(a,)).port_reference_impedances
385+
smatrix_data = MicrowaveSMatrixData(data=self._construct_smatrix())
386+
data = TerminalComponentModelerData(
387+
simulation=self, data=smatrix_data
388+
).port_reference_impedances
385389
return data
386390

387391
@staticmethod

tidy3d/plugins/smatrix/data/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MicrowavePortSimulationData(Tidy3dBaseModel):
2525

2626

2727
class MicrowaveSMatrixData(Tidy3dBaseModel):
28-
port_reference_impedances: PortDataArray
28+
port_reference_impedances: Optional[PortDataArray]
2929
data: TerminalPortDataArray
3030

3131

0 commit comments

Comments
 (0)