From 7f11c879590f5ac4f3dda673881f94205857fa22 Mon Sep 17 00:00:00 2001 From: FBruzzesi Date: Thu, 13 Jun 2024 10:34:33 +0200 Subject: [PATCH] patch: destination file edit on name change --- Makefile | 2 +- sksmithy/tui/_components.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c5de7c8..4c9e6f5 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ coverage: types: mypy $(sources) -check: lint test types clean-folders +check: lint test-cov types clean-folders docs-serve: mkdocs serve diff --git a/sksmithy/tui/_components.py b/sksmithy/tui/_components.py index 93f497a..519526e 100644 --- a/sksmithy/tui/_components.py +++ b/sksmithy/tui/_components.py @@ -56,8 +56,7 @@ def on_input_change(self: Self, event: Input.Changed) -> None: ) else: output_file = self.app.query_one("#output-file", Input) - if not output_file.value: - output_file.value = f"{event.value.lower()}.py" + output_file.value = f"{event.value.lower()}.py" class Estimator(Container): @@ -162,8 +161,8 @@ class SampleWeight(Container): def compose(self: Self) -> ComposeResult: yield Horizontal( - Prompt(PROMPT_SAMPLE_WEIGHT, classes="label"), Switch(id="sample_weight"), + Prompt(PROMPT_SAMPLE_WEIGHT, classes="label"), classes="container", ) @@ -173,8 +172,8 @@ class Linear(Container): def compose(self: Self) -> ComposeResult: yield Horizontal( - Prompt(PROMPT_LINEAR, classes="label"), Switch(id="linear"), + Prompt(PROMPT_LINEAR, classes="label"), classes="container", ) @@ -190,8 +189,8 @@ class PredictProba(Container): def compose(self: Self) -> ComposeResult: yield Horizontal( - Prompt(PROMPT_PREDICT_PROBA, classes="label"), Switch(id="predict_proba"), + Prompt(PROMPT_PREDICT_PROBA, classes="label"), classes="container", ) @@ -201,8 +200,8 @@ class DecisionFunction(Container): def compose(self: Self) -> ComposeResult: yield Horizontal( - Prompt(PROMPT_DECISION_FUNCTION, classes="label"), Switch(id="decision_function"), + Prompt(PROMPT_DECISION_FUNCTION, classes="label"), classes="container", )