Skip to content

Commit

Permalink
feat(sdk): ruff fixies
Browse files Browse the repository at this point in the history
  • Loading branch information
dvalleri committed Dec 12, 2024
1 parent 8fa246f commit 2e9d97f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,16 @@ def distribution_chart(
def linear_chart(
self, data: MultiClassificationLinearChartData
) -> EChartsRawWidget:
series = []

for element in data.current_data:
series.append(
{
series_current_data = [{
'name': element.name,
'type': 'line',
'lineStyle': {'width': 2.2},
'symbol': 'none',
'data': element.values,
}
)
} for element in data.current_data ]

for element in data.reference_data:
series.append(
{
series_reference_data = [ {
'name': element.name,
'type': 'line',
'lineStyle': {'width': 2, 'type': 'dotted'},
Expand All @@ -109,8 +103,10 @@ def linear_chart(
'show': False,
'color': '#9B99A1',
},
}
)
} for element in data.reference_data]


series = series_current_data + series_reference_data

options = {
'yAxis': {
Expand Down Expand Up @@ -163,5 +159,10 @@ def linear_chart(
},
'series': series,
}
print('\033[1m' + data.title)

# TODO: the next print are required to show the title passed by params.
# we disable the ruff check for this line, for now
# Maybe exsist a better way to do this
print('\033[1m' + data.title) # noqa: T201

return EChartsRawWidget(option=options)
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ def predicted_actual_chart(
'legend': {'show': True, 'textStyle': {'color': '#9B99A1'}, 'right': 0},
}

print('\033[1m' + 'prediction vs ground_truth')
# TODO: the next print are required to show the title passed by params.
# we disable the ruff check for this line, for now
# Maybe exsist a better way to do this
print('\033[1m' + 'prediction vs ground_truth') # noqa: T201

return EChartsRawWidget(option=options)

Expand Down
12 changes: 6 additions & 6 deletions sdk/tests/chart/multi_class.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f4bead6a05e448b4b5c7066ed7a7170c",
"model_id": "1d557204aba642ccab27db231ce77a75",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -83,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"id": "4064888b-7b71-4581-92db-cb3d142e3213",
"metadata": {},
"outputs": [
Expand All @@ -97,15 +97,15 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9a134d6f8ed64140967ec49c84fab6da",
"model_id": "016d88c0ae4849279a4fa36d45b96eb2",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"EChartsRawWidget(option={'yAxis': {'type': 'value', 'axisLabel': {'fontSize': 9, 'color': '#9b99a1'}, 'splitLi…"
]
},
"execution_count": 1,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -118,8 +118,8 @@
" reference_data=[\n",
" MultiClassificationLinearData(name='0',values=[ \n",
" [ \"2024-04-09 00:00:00\",\"1\" ],\n",
" [ \"2024-04-10 00:00:00\",\"0.974\" ],\n",
" [ \"2024-04-11 00:00:00\",\"0.95\" ],\n",
" [ \"2024-04-10 00:00:00\",\"1\" ],\n",
" [ \"2024-04-11 00:00:00\",\"1\" ],\n",
" [ \"2024-04-12 00:00:00\",\"1\" ]\n",
" ])\n",
" ],\n",
Expand Down

0 comments on commit 2e9d97f

Please sign in to comment.