Skip to content

Commit

Permalink
REFACT: Add deprecation waning in Q3D sink methods (#4562)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys authored Apr 22, 2024
1 parent 2615a70 commit bbacd60
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 102 deletions.
48 changes: 24 additions & 24 deletions _unittest/test_30_Q2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,79 +200,79 @@ def test_15_export_equivalent_circuit(self, add_app):
assert q2d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.cir"))
assert not q2d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.doc"))
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup_name="Setup1",
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup="Setup1",
sweep="LastAdaptive",
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup_name="Setup2"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup2"
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup_name="Setup1",
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup="Setup1",
sweep="LastAdaptive",
variations=["r1:0.3mm"],
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup_name="Setup1",
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup="Setup1",
sweep="LastAdaptive",
variations=[" r1 : 0.3 mm "],
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup_name="Setup1",
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup="Setup1",
sweep="LastAdaptive",
variations="r1:0.3mm",
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="Original"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="Original"
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="Test1"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="Test1"
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
coupling_limit_type=0,
res_limit="6Mohm",
ind_limit="12nH",
res_limit="6Mohm",
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34mm"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34mm"
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34nounits"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34nounits"
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
rise_time_value="1e-6",
rise_time_unit="s",
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
rise_time_value="23",
rise_time_unit="m",
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="WELement"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="WELement"
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="test"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="test"
)
assert q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name=q2d_q3d
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model=q2d_q3d
)
assert not q2d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test"
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model="test"
)
self.aedtapp.close_project(q2d.project_name, save_project=False)

Expand Down
54 changes: 17 additions & 37 deletions _unittest_solvers/test_31_Q3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,58 +373,38 @@ def test_16_export_equivalent_circuit(self, add_app):
q3d["d"] = "10mm"
q3d.modeler.duplicate_along_line(objid="Box1", vector=[0, "d", 0])
q3d.analyze_setup(q3d.active_setup, cores=6)
assert q3d.export_equivalent_circuit(
os.path.join(self.local_scratch.path, "test_export_circuit.cir"), variations=["d: 10mm"]
)
assert q3d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
variations=["d: 10mm"])
assert not q3d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.doc"))

assert not q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup_name="Setup1",
sweep="LastAdaptive",
variations=["c: 10mm", "d: 20mm"],
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup1",
sweep="LastAdaptive", variations=["c: 10mm", "d: 20mm"])

assert not q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup_name="Setup2"
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup2")
assert not q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
setup_name="Setup1",
sweep="Sweep1",
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup1",
sweep="Sweep1")
assert q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="Original"
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="Original")
assert q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="JointTest"
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="JointTest")
assert not q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="JointTest1"
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="JointTest1")
assert not q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2)
assert q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0)
assert q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1)
assert q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"),
coupling_limit_type=0,
cond_limit="3Sie",
cap_limit="4uF",
ind_limit="9uH",
res_limit="2ohm",
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0,
cap_limit="4uF", ind_limit="9uH", res_limit="2ohm", cond_limit="3Sie")
assert q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test_14"
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model="test_14")
assert not q3d.export_equivalent_circuit(
file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test"
)
output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model="test")
self.aedtapp.close_project(q3d.project_name, save_project=False)

def test_17_export_results_q3d(self, add_app):
Expand Down
Loading

0 comments on commit bbacd60

Please sign in to comment.