Skip to content

Commit

Permalink
Rename functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmbland committed Jan 31, 2024
1 parent 27654d8 commit d8dbf49
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions validated/dash_apps/finished_apps/daily_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
maximum=maximum,
)

# Tables
table_daily = create_daily_table(data)
table_detail = create_detail_table(data_detail)

# Plot
plot = go.Figure()
Expand Down Expand Up @@ -73,10 +76,6 @@
)
)

# Tables
table_daily = create_daily_table(data)
table_detail = create_detail_table(data_detail)

# Layout
app.layout = html.Div(
children=[
Expand Down
18 changes: 9 additions & 9 deletions validated/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def create_daily_table(data: dict) -> AgGrid:
AgGrid: Daily report table
"""
table = AgGrid(
id="table",
id="table_daily",
rowData=data["data"],
columnDefs=get_columns_daily(value_columns=data["value_columns"]),
columnDefs=create_columns_daily(value_columns=data["value_columns"]),
columnSize="sizeToFit",
defaultColDef={
"resizable": True,
Expand Down Expand Up @@ -44,7 +44,7 @@ def create_detail_table(data: dict) -> AgGrid:
table = AgGrid(
id="table_detail",
rowData=data["series"],
columnDefs=get_columns_detail(value_columns=data["value_columns"]),
columnDefs=create_columns_detail(value_columns=data["value_columns"]),
columnSize="sizeToFit",
defaultColDef={
"resizable": True,
Expand All @@ -63,7 +63,7 @@ def create_detail_table(data: dict) -> AgGrid:
return table


def get_columns_daily(value_columns: list) -> list:
def create_columns_daily(value_columns: list) -> list:
"""Creates columns for Daily Report table
Args:
Expand All @@ -72,7 +72,7 @@ def get_columns_daily(value_columns: list) -> list:
Returns:
list: List of columns
"""
styles = get_daily_style_data_conditional()
styles = create_style_conditions_daily()

columns = [
{
Expand Down Expand Up @@ -135,7 +135,7 @@ def get_columns_daily(value_columns: list) -> list:
return columns


def get_columns_detail(value_columns: list) -> list:
def create_columns_detail(value_columns: list) -> list:
"""Creates columns for Detail table
Args:
Expand All @@ -144,7 +144,7 @@ def get_columns_detail(value_columns: list) -> list:
Returns:
list: List of columns
"""
styles = get_detail_style_data_conditional(value_columns)
styles = create_style_conditions_detail(value_columns)

columns = [
{
Expand Down Expand Up @@ -181,7 +181,7 @@ def get_columns_detail(value_columns: list) -> list:
return columns


def get_daily_style_data_conditional() -> dict:
def create_style_conditions_daily() -> dict:
"""Creates style conditions for Daily Report table
Returns:
Expand Down Expand Up @@ -248,7 +248,7 @@ def get_daily_style_data_conditional() -> dict:
return styles


def get_detail_style_data_conditional(value_columns: list) -> dict:
def create_style_conditions_detail(value_columns: list) -> dict:
"""Creates style conditions for Detail table
Args:
Expand Down

0 comments on commit d8dbf49

Please sign in to comment.