Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e93b45a
Add basic skeleton with welcome screen
jfy133 May 25, 2024
266a163
Update changelgo
jfy133 May 25, 2024
71a1475
Fix linting failure
jfy133 May 25, 2024
a583018
Linting
jfy133 May 25, 2024
5e1dc52
Move common util functions/classes to common location
jfy133 May 26, 2024
03eaa52
Move textual CSS to common place
jfy133 May 26, 2024
b82b6fb
Add config type question
jfy133 May 26, 2024
5f6b2a4
Start adding basic details screen. Missing: validation. Not working: …
jfy133 May 26, 2024
e8233f5
Merge branch 'dev' into configbuilder2
jfy133 Jun 1, 2024
17971e6
Fix function calling due to move to generic location
jfy133 Jun 1, 2024
15f5be8
Copy over @mirpedrol 's writing functions
jfy133 Jun 1, 2024
4af6e99
Start making config writing function actually write nextflow configs
jfy133 Jun 2, 2024
2d7863a
Add URL saving, start adding validation: problem unless everything fi…
jfy133 Jun 8, 2024
edc2d8f
Merge branch 'dev' into configbuilder2
jfy133 Jun 30, 2024
e01c486
Merge branch 'dev' into configbuilder2
jfy133 Jun 30, 2024
f0cb5e9
Small debugging, now know the issue
jfy133 Jun 30, 2024
66227b7
Fixing writing of parameters to the input file when no input from user
jfy133 Jun 30, 2024
f8ad151
Merge branch 'dev' of https://github.com/nf-core/tools into configbui…
mirpedrol Mar 31, 2025
46c4c0a
Add back configs create command
mirpedrol Apr 2, 2025
dc22d8f
update to new version of textual and rename CreateConfig classes
mirpedrol Apr 2, 2025
544fd89
add screen asking if the config is nf-core
mirpedrol Apr 2, 2025
33e88dd
add validation of basicdetails
mirpedrol Apr 2, 2025
227abc2
conditional validation for nf-core configs
mirpedrol Apr 2, 2025
954b263
Merge branch 'dev' into configbuilder2
mirpedrol May 5, 2025
48ce7a5
remove config author and url from pipeline configs
mirpedrol May 5, 2025
078520a
fix custom fields using hide class and add pipeline name or path
mirpedrol May 5, 2025
a55d26b
add screen to select if config is for an HPC or not
mirpedrol May 5, 2025
b143b30
Merge branch 'dev' of https://github.com/mirpedrol/tools into configb…
mirpedrol Sep 5, 2025
b0ad759
use 'local' for no HPC
mirpedrol Sep 5, 2025
d557970
add HPC configuration screen
mirpedrol Sep 5, 2025
580598b
add screen for final infrastructure config details - containers cache…
mirpedrol Sep 5, 2025
45aa6fb
Merge branch 'dev' into configbuilder2
mirpedrol Dec 1, 2025
908d9fb
Merge pull request #3001 from jfy133/configbuilder2
mirpedrol Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Start adding basic details screen. Missing: validation. Not working: …
…Hide URL Question of pipeline configs
  • Loading branch information
jfy133 committed May 26, 2024
commit 5f6b2a4195b29e667b560208c06b865e22b7de26
22 changes: 17 additions & 5 deletions nf_core/configs/create/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from textual.app import App
from textual.widgets import Button

## nf-core question page imports
## nf-core question page (screen) imports
from nf_core.configs.create.basicdetails import BasicDetails
from nf_core.configs.create.configtype import ChooseConfigType
from nf_core.configs.create.utils import CreateConfig
from nf_core.configs.create.welcome import WelcomeScreen
Expand Down Expand Up @@ -46,10 +47,10 @@ class ConfigsCreateApp(App[CreateConfig]):
]

## New question screens (sections) loaded here
SCREENS = {
"welcome": WelcomeScreen(),
"choose_type": ChooseConfigType(),
}
SCREENS = {"welcome": WelcomeScreen(), "choose_type": ChooseConfigType(), "basic_details": BasicDetails()}

# Tracking variables
CONFIG_TYPE = None

# Log handler
LOG_HANDLER = log_handler
Expand All @@ -64,6 +65,17 @@ def on_button_pressed(self, event: Button.Pressed) -> None:
"""Handle all button pressed events."""
if event.button.id == "lets_go":
self.push_screen("choose_type")
elif event.button.id == "type_infrastructure":
self.CONFIG_TYPE = "infrastructure"
self.push_screen("basic_details")
elif event.button.id == "type_pipeline":
self.CONFIG_TYPE = "pipeline"
self.push_screen("basic_details")
## General options
if event.button.id == "close_app":
self.exit(return_code=0)
if event.button.id == "back":
self.pop_screen()

## User theme options
def action_toggle_dark(self) -> None:
Expand Down
119 changes: 119 additions & 0 deletions nf_core/configs/create/basicdetails.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
"""Get basic contact information to set in params to help with debugging. By
displaying such info in the pipeline run header on run execution"""

from textwrap import dedent

from textual.app import ComposeResult
from textual.containers import Center, Horizontal
from textual.screen import Screen
from textual.widgets import Button, Footer, Header, Markdown

from nf_core.pipelines.create.utils import TextInput

config_exists_warn = """
> ⚠️ **The config file you are trying to create already exists.**
>
> If you continue, you will **overwrite** the existing config.
> Please change the config name to create a different config!.
"""


class BasicDetails(Screen):
"""Name, description, author, etc."""

def compose(self) -> ComposeResult:
yield Header()
yield Footer()
yield Markdown(
dedent(
"""
# Basic details
"""
)
)
## TODO Add validation, <config_name>.conf already exists?
yield TextInput(
"config_name",
"custom",
"Config Name. Used for naming resulting file.",
"",
classes="column",
)
with Horizontal():
yield TextInput(
"authorname",
"Boaty McBoatFace",
"Author full name.",
classes="column",
)

yield TextInput(
"authorhandle",
"@BoatyMcBoatFace",
"Author Git(Hub) handle.",
classes="column",
)

yield TextInput(
"description",
"Description",
"A short description of your config.",
)
yield TextInput(
"institutional_url",
"https://nf-co.re",
"URL of infrastructure website or owning institutional.",
disabled=self.parent.CONFIG_TYPE == "pipeline", ## TODO not working, why?
)
## TODO: reactivate once validation ready
# yield Markdown(dedent(config_exists_warn), id="exist_warn", classes="hide")
yield Center(
Button("Back", id="back", variant="default"),
Button("Next", id="next", variant="success"),
classes="cta",
)

## TODO: update functions
# @on(Input.Changed)
# @on(Input.Submitted)
# def show_exists_warn(self):
# """Check if the pipeline exists on every input change or submitted.
# If the pipeline exists, show warning message saying that it will be overriden."""
# config = {}
# for text_input in self.query("TextInput"):
# this_input = text_input.query_one(Input)
# config[text_input.field_id] = this_input.value
# if Path(config["org"] + "-" + config["name"]).is_dir():
# remove_hide_class(self.parent, "exist_warn")
# else:
# add_hide_class(self.parent, "exist_warn")

# def on_screen_resume(self):
# """Hide warn message on screen resume.
# Update displayed value on screen resume."""
# add_hide_class(self.parent, "exist_warn")
# for text_input in self.query("TextInput"):
# if text_input.field_id == "org":
# text_input.disabled = self.parent.CONFIG_TYPE == "infrastructure"

# @on(Button.Pressed)
# def on_button_pressed(self, event: Button.Pressed) -> None:
# """Save fields to the config."""
# config = {}
# for text_input in self.query("TextInput"):
# this_input = text_input.query_one(Input)
# validation_result = this_input.validate(this_input.value)
# config[text_input.field_id] = this_input.value
# if not validation_result.is_valid:
# text_input.query_one(".validation_msg").update("\n".join(validation_result.failure_descriptions))
# else:
# text_input.query_one(".validation_msg").update("")
# try:
# self.parent.TEMPLATE_CONFIG = CreateConfig(**config)
# if event.button.id == "next":
# if self.parent.CONFIG_TYPE == "infrastructure":
# self.parent.push_screen("type_infrastructure")
# elif self.parent.CONFIG_TYPE == "pipeline":
# self.parent.push_screen("type_pipeline")
# except ValueError:
# pass
2 changes: 2 additions & 0 deletions nf_core/configs/create/configtype.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Select which type of config to create to guide questions and order"""

from textual.app import ComposeResult
from textual.containers import Center, Grid
from textual.screen import Screen
Expand Down
135 changes: 0 additions & 135 deletions nf_core/configs/create/create.tcss

This file was deleted.

2 changes: 2 additions & 0 deletions nf_core/configs/create/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Config creation specific functions and classes"""

from typing import Optional

from pydantic import BaseModel
Expand Down
2 changes: 2 additions & 0 deletions nf_core/configs/create/welcome.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Intro information to help inform user what we are about to do"""

from textual.app import ComposeResult
from textual.containers import Center
from textual.screen import Screen
Expand Down