Skip to content

Commit

Permalink
added "DecadeCount" "OctaveCount" "ExponentialCount" in parametric sw… (
Browse files Browse the repository at this point in the history
#3910)

* added "DecadeCount" "OctaveCount" "ExponentialCount" in parametric sweep, removed unit from "step"

* add UT and fix docstring

---------

Co-authored-by: Giulia Malinverno <[email protected]>
Co-authored-by: gmalinve <[email protected]>
  • Loading branch information
3 people authored Dec 7, 2023
1 parent f106c65 commit 2811961
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions _unittest/test_11_Setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ def test_25a_create_parametrics(self):
assert setup1.add_variation("w2", "0.1mm", 10, 11)
assert setup1.add_variation("w2", start_point="0.2mm", variation_type="SingleValue")
assert setup1.add_variation("w1", start_point="0.3mm", end_point=5, step=0.2, variation_type="LinearStep")
assert setup1.add_variation("w1", start_point="0.3mm", end_point=5, step=1, variation_type="DecadeCount")
assert setup1.add_variation("w1", start_point="0.3mm", end_point=5, step=1, variation_type="OctaveCount")
assert setup1.add_variation("w1", start_point="0.3mm", end_point=5, step=1, variation_type="ExponentialCount")
assert setup1.add_calculation(
calculation="dB(S(1,1))", ranges={"Freq": "3.5GHz"}, solution="My_HFSS_Setup : LastAdaptive"
)
Expand Down
11 changes: 8 additions & 3 deletions pyaedt/modules/DesignXPloration.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,8 @@ def add_variation(self, sweep_var, start_point, end_point=None, step=100, unit=N
unit : str, optional
Variation units. Default is `None`.
variation_type : float or int
Variation Type. Admitted values are `"LinearCount"`, `"LinearStep"`, `"LogScale"`, `"SingleValue"`.
Variation Type. Admitted values are `"SingleValue", `"LinearCount"`, `"LinearStep"`,
`"DecadeCount"`, `"OctaveCount"`, `"ExponentialCount"`.
Returns
-------
Expand All @@ -918,8 +919,12 @@ def add_variation(self, sweep_var, start_point, end_point=None, step=100, unit=N
sweep_range = "LINC {} {} {}".format(start_point, end_point, step)
elif variation_type == "LinearStep":
sweep_range = "LIN {} {} {}".format(start_point, end_point, self._app.value_with_units(step, unit))
elif variation_type == "LogScale":
sweep_range = "DEC {} {} {}".format(start_point, end_point, self._app.value_with_units(step, unit))
elif variation_type == "DecadeCount":
sweep_range = "DEC {} {} {}".format(start_point, end_point, step)
elif variation_type == "OctaveCount":
sweep_range = "OCT {} {} {}".format(start_point, end_point, step)
elif variation_type == "ExponentialCount":
sweep_range = "ESTP {} {} {}".format(start_point, end_point, step)
elif variation_type == "SingleValue":
sweep_range = "{}".format(start_point)
if not sweep_range:
Expand Down

0 comments on commit 2811961

Please sign in to comment.