Feature/report panel#708
Conversation
This reverts commit 3e5fb8b.
| "numba>=0.60.0", | ||
| "numpy>=2.0.0,<2.6.0", | ||
| "pandas>=2.2.2,<4.0.0", | ||
| "panel>=1.8.10", |
There was a problem hiding this comment.
quick remark: you should move this dependency in the "report" optional section below (and remove the now unnecessary deps it contains)
| ReportBlockMixin.__init__( | ||
| report_runtime, | ||
| explainer=self, | ||
| x_train=x_train, | ||
| y_train=y_train, | ||
| y_test=y_test, | ||
| config=config, |
There was a problem hiding this comment.
you should not do that.
the user is expected to provide an instance of its own BlockMixin class fully initialized.
There was a problem hiding this comment.
you can check at the begining of the generate_report method if x_train/y_train/y_test are inconsistent with something like:
if block_instance is not None and type(block_instance) is ReportBlockMixin:
if (
(block_instance.x_train_init.equals(x_train))
or (block_instance.y_train != y_train)
or (block_instance.y_test != y_test)
):
print("blabla")|
|
||
| _assign_section_ids(cfg["sections"]) | ||
|
|
||
| runtime.render_block = lambda block_cfg: render_block(runtime, block_cfg) |
There was a problem hiding this comment.
why did not you simply make render_block a method of the ReportBlockMixin class?
| def report_css_text() -> str: | ||
| """Load report CSS once for Panel report export.""" | ||
| css_path = Path(__file__).resolve().parent / "report_styles.css" | ||
| return css_path.read_text(encoding="utf-8") |
There was a problem hiding this comment.
it would be nice to allow the user to use its own css sheet.
maybe through the conf yaml file?
| @lru_cache(maxsize=1) | ||
| def report_js_text() -> str: | ||
| """Load report JavaScript once for Panel report export.""" | ||
| js_path = Path(__file__).resolve().parent / "report_script.js" | ||
| return js_path.read_text(encoding="utf-8") |
There was a problem hiding this comment.
It seems that the js is used to make the menu buttons work.
Try to use the panel builtin instead
There was a problem hiding this comment.
I 've checked, and the js is used to track scroll position to highlight on the side menu where the user currently is.
| def apply_report_css() -> None: | ||
| """Register smart-report CSS in Panel global configuration.""" | ||
| _enable_panel_plotly() | ||
| css = report_css_text() | ||
| if css not in pn.config.raw_css: | ||
| pn.config.raw_css.append(css) |
There was a problem hiding this comment.
this could be integrated in the generate_report function
| def make_plotly_pane(fig) -> pn.pane.Plotly: | ||
| """Build a responsive Plotly pane for report blocks.""" | ||
| _enable_panel_plotly() | ||
| return pn.pane.Plotly(fig, config={"responsive": True}, sizing_mode="stretch_width") |
There was a problem hiding this comment.
you can move this into the block decorator



Description
Refactors the report generation system by replacing the legacy implementation with a new modular smart_report architecture, and updates related documentation, assets, tutorials, and tests.
Main changes
Modular report engine introduced
Legacy report implementation removed
Report UI and generated output improvements
Documentation, tutorials, and examples updated
Test suite and integration updates