Skip to content

Commit 0042aa8

Browse files
Backwards compatibility methods?
1 parent fcff3af commit 0042aa8

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

tidy3d/plugins/smatrix/component_modelers/terminal.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import os
56
from typing import Optional, Union
67

78
import numpy as np
@@ -430,27 +431,27 @@ def compute_port_VI(
430431

431432
return compute_port_VI(port_out=port_out, sim_data=sim_data)
432433

433-
# @cached_property
434-
# def _terminal_modeler_path(self) -> str:
435-
# """Where we store the for this :class:`TerminalComponentModeler` instance after the run."""
436-
# return os.path.join(self.path_dir, "tcp_" + str(hash(self)) + ".hdf5")
437-
#
438-
# def _upload_terminal_modeler(self):
439-
# # TODO properly refactor, plugins data types should not have web methods.
440-
# from tidy3d.web.api.container import Job
441-
#
442-
# # first try loading the terminal_component_modeler from file, if it exists
443-
# terminal_modeler_path = self._terminal_modeler_path
444-
#
445-
# if os.path.exists(terminal_modeler_path):
446-
# return Job.from_file(fname=terminal_modeler_path)
447-
#
448-
# return Job(
449-
# simulation=self,
450-
# task_name=self.name,
451-
# folder_name=self.folder_name,
452-
# callback_url=self.callback_url,
453-
# verbose=self.verbose,
454-
# solver_version=self.solver_version,
455-
# simulation_type="microwave",
456-
# )
434+
@cached_property
435+
def _terminal_modeler_path(self) -> str:
436+
"""Where we store the for this :class:`TerminalComponentModeler` instance after the run."""
437+
return os.path.join(self.path_dir, "tcp_" + str(hash(self)) + ".hdf5")
438+
439+
def _upload_terminal_modeler(self):
440+
# TODO properly refactor, plugins data types should not have web methods.
441+
from tidy3d.web.api.container import Job
442+
443+
# first try loading the terminal_component_modeler from file, if it exists
444+
terminal_modeler_path = self._terminal_modeler_path
445+
446+
if os.path.exists(terminal_modeler_path):
447+
return Job.from_file(fname=terminal_modeler_path)
448+
449+
return Job(
450+
simulation=self,
451+
task_name=self.name,
452+
folder_name=self.folder_name,
453+
callback_url=self.callback_url,
454+
verbose=self.verbose,
455+
solver_version=self.solver_version,
456+
simulation_type="microwave",
457+
)

0 commit comments

Comments
 (0)