Skip to content

Commit

Permalink
added trogon to CLI => not it's becoming a TUI (terminal user interfa…
Browse files Browse the repository at this point in the history
…ce) :)
  • Loading branch information
richrobe committed Jun 12, 2023
1 parent fa8895f commit 584142a
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 1 deletion.
6 changes: 6 additions & 0 deletions carwatch/scripts/prepare_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Optional, Sequence, Union

import click
from trogon import tui

from carwatch.labels import LabelGenerator
from carwatch.labels.print_layout import CustomLayout
Expand All @@ -25,6 +26,7 @@
DEFAULT_QR_FILE_SUFFIX = "_qr_code"


@tui()
@click.command()
@click.option(
"--study-name", required=True, prompt="Study name", type=str, help="A descriptive abbreviation for your study name."
Expand All @@ -36,6 +38,7 @@
"--subject-data",
required=True,
prompt="Read subject IDs from file?",
help="Whether the subject IDs should be read from a file.",
is_flag=True,
)
@click.option(
Expand Down Expand Up @@ -72,6 +75,7 @@
@click.option(
"--has-subject-prefix",
prompt="Add prefix to participant number (e.g., 'VP_')?",
help="Whether a prefix should be added to the participant number.",
is_flag=True,
cls=Condition,
neg_condition="subject_path",
Expand Down Expand Up @@ -107,13 +111,15 @@
required=True,
default=0,
prompt="Should biomarker IDs start at 0 or at 1 (i.e., S0 vs. S1)?",
help="Whether the biomarker IDs should start at 0 or at 1.",
type=click.IntRange(0, 1),
)
@click.option(
"--study_type",
required=True,
default=CAR_STUDY,
prompt="Type of study? (1 for CAR study, 2 for Lab-based study, 3 for Other)?",
help="The type of study. 1 for CAR study, 2 for Lab-based study, 3 for Other.",
type=click.IntRange(1, len(STUDY_TYPES)),
)
@click.option(
Expand Down
154 changes: 153 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ seaborn = { version = "^0.11.2", optional = true }
ipywidgets = {version = "^8", optional = true}
ipympl = {version = "^0.9", optional = true}
fau_colors = {version = "^1.6.0", optional=true}
trogon = "^0.4.0"

[tool.poetry.extras]
plotting = ["matplotlib", "seaborn", "ipywidgets", "ipympl", "fau_colors"]
Expand Down

0 comments on commit 584142a

Please sign in to comment.