Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first implementation of scaling functions #1197

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add support for text hints in table row search
  • Loading branch information
lbianchi-lbl committed Apr 10, 2024
commit 859ac94eb8bf1f826b1e5d4105e70eca5dc1e1be
2 changes: 1 addition & 1 deletion foqus_lib/gui/tests/test_surrogate.py
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ def test_run_surrogate(
qtbot.click(button="Select All")
qtbot.select_tab("Method Settings")
with qtbot.focusing_on(table=any):
qtbot.select_row(12)
qtbot.select_row("scaling_function")
qtbot.using(column="Value").set_option("Linear")
qtbot.select_tab("Execution")
run_button, stop_button = qtbot.locate(button=any, index=[0, 1])
4 changes: 4 additions & 0 deletions pytest_qt_extras.py
Original file line number Diff line number Diff line change
@@ -589,6 +589,10 @@ def run(cls, table, hint: TableRowSpec):
raise InvalidMatchError(
f"row index {hint} out of range: (count: {count})"
)
elif isinstance(hint, str):
matching_items = table.findItems(hint, QtCore.Qt.MatchExactly)
InvalidMatchError.check(matching_items, expected=1)
idx = int(matching_items[0].row())
elif hint is None:
if count == 1:
idx = 0