flake8 compliant

This commit is contained in:
Brian Bjarke Jensen
2024-02-24 23:42:55 +01:00
parent 993c9a122b
commit fa2230d5cf
23 changed files with 157 additions and 106 deletions
+1 -1
View File
@@ -1 +1 @@
from .layout import app_layout
from .layout import app_layout
+1 -1
View File
@@ -1,4 +1,4 @@
from dash import html, dcc
from dash import html
import dash_bootstrap_components as dbc
+1 -3
View File
@@ -1,6 +1,4 @@
import dash_mantine_components as dmc
from dash import dcc, html
from typing import List
from .image import image_element
from .inputs import inputs_element
@@ -17,4 +15,4 @@ body_element = dmc.Container(
],
)
],
)
)
+1 -1
View File
@@ -20,4 +20,4 @@ inputs_element = dmc.SimpleGrid(
labels_element,
next_button
]
)
)
+24 -7
View File
@@ -20,6 +20,7 @@ from src.model_textual import (
SalienceModelOutput
)
def generate_option_labels(model) -> List[str]:
"""Generate presentable list of attributes from an OutputModel."""
labels = [
@@ -28,35 +29,51 @@ def generate_option_labels(model) -> List[str]:
]
return labels
def generate_visual_syntax_options_map():
"""Generate map of titles and options for visual syntax labels."""
options_map = {}
# add experiential labels
options_map["visual syntax"] = generate_option_labels(VisualSyntaxModelOutput)
options_map["visual syntax"] = generate_option_labels(
VisualSyntaxModelOutput
)
return options_map
def generate_interpersonal_options_map():
"""Generate map of titles and options for interpersonal labels."""
options_map = {}
# add interpersonal labels
options_map["contact"] = generate_option_labels(ContactModelOutput)
options_map["angle"] = generate_option_labels(AngleModelOutput)
options_map["point of view"] = generate_option_labels(PointOfViewModelOutput)
options_map["point of view"] = generate_option_labels(
PointOfViewModelOutput
)
options_map["distance"] = generate_option_labels(DistanceModelOutput)
options_map["modality lighting"] = generate_option_labels(ModalityLightingModelOutput)
options_map["modality color"] = generate_option_labels(ModalityColorModelOutput)
options_map["modality depth"] = generate_option_labels(ModalityDepthModelOutput)
options_map["modality lighting"] = generate_option_labels(
ModalityLightingModelOutput
)
options_map["modality color"] = generate_option_labels(
ModalityColorModelOutput
)
options_map["modality depth"] = generate_option_labels(
ModalityDepthModelOutput
)
return options_map
def generate_textual_options_map():
"""Generate map of titles and options for textual labels."""
options_map = {}
# add textual labels
options_map["information value"] = generate_option_labels(InformationValueModelOutput)
options_map["information value"] = generate_option_labels(
InformationValueModelOutput
)
options_map["framing"] = generate_option_labels(FramingModelOutput)
options_map["salience"] = generate_option_labels(SalienceModelOutput)
return options_map
# prepare experiential container
experiential_map = generate_visual_syntax_options_map()
experiential_container = dmc.Col(
@@ -118,4 +135,4 @@ labels_element = dmc.Grid(
interpersonal_container,
textual_container,
]
)
)
-1
View File
@@ -1,4 +1,3 @@
from dash import dcc
import dash_mantine_components as dmc
from .stores import stores_element
+5 -3
View File
@@ -5,12 +5,14 @@ import os
storage_type = "session"
if "ENV" in os.environ and os.getenv("ENV") == "DEV":
storage_type = "memory"
logging.info(f"ENV=DEV -> dcc.Stores changed to storage_type={storage_type}")
logging.info(
"ENV=DEV -> dcc.Stores changed to storage_type=%s",
storage_type
)
stores_element = html.Div(
children=[
dcc.Store(id="alert-message", storage_type=storage_type, data=""),
dcc.Store(id="vis-com-name", storage_type=storage_type, data=""),
]
)
)