From ac36a6263807f22536e3847ffb1f0c5ced4f1cf5 Mon Sep 17 00:00:00 2001 From: mihran113 Date: Wed, 2 Oct 2024 20:31:22 +0400 Subject: [PATCH] [fix] Make some minor fixes in reports' docs (#3231) --- aim/web/ui/public/aim_ui_core.py | 5 ++++- docs/source/ui/pages/reports.md | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/aim/web/ui/public/aim_ui_core.py b/aim/web/ui/public/aim_ui_core.py index 802df21ded..ce0bc4f8c2 100644 --- a/aim/web/ui/public/aim_ui_core.py +++ b/aim/web/ui/public/aim_ui_core.py @@ -425,7 +425,10 @@ def render(self): render_to_layout(component_data) - def group(self, prop, value=[]): + def group(self, prop, value): + if isinstance(value, str): + value = [value] + # group the data with the main grouping function group_map, group_data = group(prop, self.data, value, self.key) diff --git a/docs/source/ui/pages/reports.md b/docs/source/ui/pages/reports.md index 88665104f3..c5e1a57e8c 100644 --- a/docs/source/ui/pages/reports.md +++ b/docs/source/ui/pages/reports.md @@ -161,12 +161,12 @@ TextsList(texts) All the aforementioned objects have `group` method available to them: ```python -def group(prop, values=[]): +def group(prop: str, value: Union[str, list]): ... ``` -`prop`- name of the property to be grouped by. Available options are: `color`, `stroke_style`, `row`, `column` +`prop`- name of the property to be grouped by. Available options are: `color`, `stroke_style`, `row`, `column` (the first 2 are available for `LineChart `only) -`value`- list of values of sequence fields to be grouped by. Available fields are all those fields that are also available in grouping options of the explorer pages. +`value`- single or multiple values of sequence fields to be grouped by. Available fields are all those fields that are also available in grouping options of the explorer pages. The `group` method can be applied multiple times sequentially. @@ -175,8 +175,8 @@ Example: ```aim metrics = repo.fetch_metrics() linechart = LineChart(metrics) -linechart.group('color', ['run.hash']) -linechart.group('row', ['metric_name']) +linechart.group('color', 'run.hash') +linechart.group('row', ['metric.name', 'metric.context.subset']) ``` ````