Skip to content

Commit afd9d62

Browse files
committed
Fixed Problem in visualization due to wrong call and linbter not raising an error but just returning false.
1 parent 989f1d3 commit afd9d62

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

src/petab_gui/controllers/table_controllers.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Classes for the controllers of the tables in the GUI."""
22

3+
import logging
34
import re
45
from collections.abc import Sequence
56
from pathlib import Path
@@ -22,7 +23,12 @@
2223
PandasTableModel,
2324
)
2425
from ..settings_manager import settings_manager
25-
from ..utils import ConditionInputDialog, get_selected, process_file
26+
from ..utils import (
27+
CaptureLogHandler,
28+
ConditionInputDialog,
29+
get_selected,
30+
process_file,
31+
)
2632
from ..views.other_views import DoseTimeDialog
2733
from ..views.table_view import (
2834
ColumnSuggestionDelegate,
@@ -1325,4 +1331,13 @@ def check_petab_lint(
13251331
):
13261332
"""Check a number of rows of the model with petablint."""
13271333
problem = self.mother_controller.get_current_problem()
1328-
return petab.visualize.validate_visualization_df(problem)
1334+
capture_handler = CaptureLogHandler()
1335+
logger_vis = logging.getLogger("petab.v1.visualize.lint")
1336+
logger_vis.addHandler(capture_handler)
1337+
errors = petab.visualize.lint.validate_visualization_df(problem)
1338+
if not errors:
1339+
return not errors
1340+
captured_output = "<br>&nbsp;&nbsp;&nbsp;&nbsp;".join(
1341+
capture_handler.get_formatted_messages()
1342+
)
1343+
raise ValueError(captured_output)

0 commit comments

Comments
 (0)