Skip to content

Commit 9dac12f

Browse files
committed
fix: tests
1 parent 291740b commit 9dac12f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

optiland/tolerancing/core.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,19 @@ def __init__(self, optic, method='generic', tol=1e-5):
5959

6060
def add_operand(self, operand_type: str, input_data: dict = {},
6161
target: float = None, weight: float = 1.0,
62-
bounds: list = None, more_than: float = None,
63-
less_than: float = None):
62+
min_val: float = None, max_val: float = None):
6463
"""
6564
Add an operand to the tolerancing problem.
6665
6766
Args:
6867
operand_type (str): The type of the operand.
69-
target (float): The target value of the operand.
70-
bounds (list): The operand should stay between the bounds (bounded operand).
71-
more_than (float): The operand should stay above this value (inequality operand).
72-
less_than (float): The operand should stay below this value (inequality operand).
68+
target (float): The target value of the operand (equality operand).
69+
min_val (float): The operand should stay above this value (inequality operand).
70+
max_val (float): The operand should stay below this value (inequality operand).
7371
weight (float): The weight of the operand.
7472
input_data (dict): Additional input data for the operand.
7573
"""
76-
new_operand = Operand(operand_type, target, bounds, more_than, less_than, weight, input_data)
74+
new_operand = Operand(operand_type, target, min_val, max_val, weight, input_data)
7775
if target is None:
7876
new_operand.target = new_operand.value
7977
self.operands.append(new_operand)

tests/test_optimization.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ def test_operand_info(self, capsys):
9090
captured = capsys.readouterr()
9191
assert 'Operand Type' in captured.out
9292
assert 'Target' in captured.out
93-
assert 'Bounds' in captured.out
94-
assert 'More than' in captured.out
95-
assert 'Less than' in captured.out
93+
assert 'Min Bound' in captured.out
94+
assert 'Max Bound' in captured.out
9695
assert 'Weight' in captured.out
9796
assert 'Value' in captured.out
9897
assert 'Delta' in captured.out

0 commit comments

Comments
 (0)