class ml_research_tools.emanager.tui.InputModal(title, placeholder='')[source]#

Bases: ModalScreen[str]

Initialize the screen.

Parameters:
  • name – The name of the screen.

  • id – The ID of the screen in the DOM.

  • classes – The CSS classes for the screen.

  • title (str)

  • placeholder (str)

CSS: ClassVar[str] = '\n    InputModal {\n        align: center middle;\n    }\n    #dialog {\n        padding: 1 2;\n        width: 60;\n        height: 11;\n        border: thick $background 80%;\n        background: $surface;\n    }\n    #help-text {\n        color: $text-muted;\n        margin-top: 1;\n    }\n    '#

Inline CSS, useful for quick scripts. Rules here take priority over CSS_PATH.

Note

This CSS applies to the whole app.

compose()[source]#

Called by Textual to create child widgets.

This method is called when a widget is mounted or by setting recompose=True when calling [refresh()][textual.widget.Widget.refresh].

Note that you don’t typically need to explicitly call this method.

Example

```python def compose(self) -> ComposeResult:

yield Header() yield Label(“Press the button below:”) yield Button() yield Footer()

```

Return type:

Iterable[Widget]

on_mount()[source]#
Return type:

None

on_input_submitted(event)[source]#
Return type:

None

Parameters:

event (Submitted)

on_key(event)[source]#
Return type:

None

can_focus: bool = False#

Widget may receive focus.

can_focus_children: bool = True#

Widget’s children may receive focus.

class ml_research_tools.emanager.tui.EmanagerApp(tool_instance)[source]#

Bases: App

A Textual app to manage experiments.

Create an instance of an app.

Parameters:
  • driver_class – Driver class or None to auto-detect. This will be used by some Textual tools.

  • css_path – Path to CSS or None to use the CSS_PATH class variable. To load multiple CSS files, pass a list of strings or paths which will be loaded in order.

  • watch_css – Reload CSS if the files changed. This is set automatically if you are using textual run with the dev switch.

  • ansi_color – Allow ANSI colors if True, or convert ANSI colors to to RGB if False.

Raises:

CssPathError – When the supplied CSS path(s) are an unexpected type.

TITLE: str | None = 'ML Research Tools - Experiment Manager'#

A class variable to set the default title for the application.

To update the title while the app is running, you can set the [title][textual.app.App.title] attribute. See also [the Screen.TITLE attribute][textual.screen.Screen.TITLE].

CSS: ClassVar[str] = '\n    #sidebar {\n        width: 30%;\n        dock: left;\n        border-right: solid green;\n    }\n    #tree-view {\n        height: 1fr;\n    }\n    #search-input {\n        margin: 1;\n    }\n    #detail-view {\n        width: 70%;\n        height: 1fr;\n    }\n    .scrollable {\n        height: 1fr;\n        overflow: auto;\n    }\n    '#

Inline CSS, useful for quick scripts. This is loaded after CSS_PATH, and therefore takes priority in the event of a specificity clash.

BINDINGS: ClassVar[list[BindingType]] = [Binding(key='d', action='toggle_dark', description='Toggle dark mode', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='c', action='checkout', description='Checkout branch', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='n', action='new_branch', description='New branch', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='a', action='toggle_archive', description='Toggle archive', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='m', action='add_note', description='Add note', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None), Binding(key='q', action='quit', description='Quit', show=True, key_display=None, priority=False, tooltip='', id=None, system=False, group=None)]#

The default key bindings.

compose()[source]#

Yield child widgets for a container.

This method should be implemented in a subclass.

Return type:

Iterable[Widget]

on_mount()[source]#
Return type:

None

rebuild_tree()[source]#
on_input_changed(event)[source]#
Return type:

None

Parameters:

event (Changed)

on_tree_node_highlighted(event)[source]#
Return type:

None

Parameters:

event (NodeHighlighted)

update_detail_view(tag)[source]#
action_checkout()[source]#
Return type:

None

action_new_branch()[source]#
Return type:

None

action_toggle_archive()[source]#
Return type:

None

action_add_note()[source]#
Return type:

None