Commit 9c950a56 authored by Pierre Dittgen's avatar Pierre Dittgen

Don't use camel cases in Python names

parent 1dceb447
......@@ -25,7 +25,7 @@ def noneIfEmpty(val):
return None if val == "" else val
def computeDepDropdownOptions(reg_code=None):
def compute_dept_dropdown_options(reg_code=None):
"""Compute department dropdown option list."""
dep_list = [
{"label": dep[1], "value": dep[0]}
......@@ -34,7 +34,7 @@ def computeDepDropdownOptions(reg_code=None):
return [{"label": "-- département --", "value": ""}] + dep_list
def computeBarFigure(reg_code=None, dep_code=None):
def compute_bar_figure(reg_code=None, dep_code=None):
"""Build a bar figure from given region and department code."""
df = app_data.df
......@@ -62,8 +62,8 @@ app.layout = html.Div(
],
value="",
),
dcc.Dropdown(id="dep_dd", options=computeDepDropdownOptions(), value="",),
dcc.Graph(id="type_bar", figure=computeBarFigure()),
dcc.Dropdown(id="dep_dd", options=compute_dept_dropdown_options(), value="",),
dcc.Graph(id="type_bar", figure=compute_bar_figure()),
]
)
......@@ -72,9 +72,9 @@ app.layout = html.Div(
Output(component_id="dep_dd", component_property="options"),
[Input(component_id="reg_dd", component_property="value")],
)
def update_dep_dropdown_options(reg_code):
def update_dept_dropdown_options(reg_code):
"""Update department list when a region has been chosen."""
return computeDepDropdownOptions(reg_code=noneIfEmpty(reg_code))
return compute_dept_dropdown_options(reg_code=noneIfEmpty(reg_code))
@app.callback(
......@@ -95,7 +95,7 @@ def update_dep_dropdown_value(reg_code):
)
def update_type_bar(reg_code, dep_code):
"""Update bar chart when one dropdown value changes."""
return computeBarFigure(
return compute_bar_figure(
reg_code=noneIfEmpty(reg_code), dep_code=noneIfEmpty(dep_code)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment