Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ result.json
textual.log
.VSCodeCounter/
textual.log
textual.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
Some modules are full scripts and can be run from command line. These are written here:

`zodiac` - Experimental generative system<br>
`astra` - Experimental generative system<br>
`astra` - Live diagnostic console<br>
`nnll-hash` - Hash the layer metadata from models within a directory and write out to console.<br>
`nnll-parse` - Process metadata headers from a model file or directory of models and write out to individual JSON files.<br>
`nnll-find` - Search a local directory of model layer files (HuggingFace🤗 index.json, JSON from `nnll-parse`)<br>
Expand Down
6 changes: 6 additions & 0 deletions nnll_10/package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ def main():
assembled_path = os.path.join("log", f".nnll{datetime.now().strftime('%Y%m%d')}_trace.json")
tracer.stop()
tracer.save(output_file=assembled_path) # also takes output_file as an optional argument


if __name__ == "__main__":
# import asyncio
main()
# asyncio.run(main())
54 changes: 34 additions & 20 deletions nnll_10/package/carousel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,72 @@
from textual.screen import Screen
from textual.reactive import reactive

from nnll_01 import debug_monitor
from nnll_01 import debug_monitor, info_message as nfo # debug_message as dbug,


class Carousel(DataTable):
"""Revolving text-line component based on default DataTable widget class"""

nx_graph: dict
content_cell: reactive[int] = reactive(0.0)
content_cell: reactive[int] = reactive(0)

up = "[@click='scroll_button(1)']▲[/]"
dwn = "[@click='scroll_button']▼[/]"
current_cell = "text"
current_row = 0
y_coord = 1
scroll_counter = 5

def on_mount(self) -> None:
self.show_header = False
self.cursor_type = "cell"

@debug_monitor
def emulate_scroll_down(self, interval: float = 0.05) -> str:
def emulate_scroll_down(self, interval: int = 1) -> str:
"""Trigger datatable cursor movement using fractional sensitivity
:param ceiling: Total entry count of the table *column*
:return: The datata in the table *row*
"""
if self.content_cell < len(self.columns) - 1:
self.content_cell += interval
coordinate = abs(int(round(self.content_cell)))
self.move_cursor(row=coordinate, column=1)
current_content = self.get_cell_at((coordinate, 1))
return current_content

if (self.row_count - 1) >= (self.current_row + interval):
if self.y_coord < self.scroll_counter:
self.y_coord += interval
else:
self.y_coord = interval
self.current_row += interval
self.move_cursor(row=self.current_row, column=1)
self.current_cell = self.get_cell_at((self.current_row, 1))
return self.current_cell

@debug_monitor
def emulate_scroll_up(self, interval: float = 0.05) -> str:
def emulate_scroll_up(self, interval: int = 1) -> str:
"""Trigger datatable cursor movement using fractional sensitivity
:param ceiling: Total entry count of the table *column*
:return: The datata in the table *row*
"""
if self.content_cell > 0:
self.content_cell -= interval
coordinate = abs(int(round(self.content_cell)))
self.move_cursor(row=coordinate, column=1)
current_content = self.get_cell_at((coordinate, 1))
return current_content

if 0 <= self.current_row - interval:
if self.y_coord >= 1:
self.y_coord -= interval
else:
self.y_coord = self.scroll_counter
self.current_row -= interval
self.move_cursor(row=self.current_row, column=1)
self.current_cell = self.get_cell_at((self.current_row, 1))
return self.current_cell

@debug_monitor
def action_scroll_button(self, up: bool = False) -> None:
"""Manually trigger scrolling and panel switching
:param up: Scroll direction, defaults to False
"""
if up:
content = self.emulate_scroll_up(interval=0.6)
self.current_cell = self.emulate_scroll_up(interval=self.y_coord + 1)
if self.id == "input_tag":
self.query_ancestor(Screen).foldr["ps"].current = self.query_ancestor(Screen).input_map[content]
self.query_ancestor(Screen).foldr["ps"].current = self.query_ancestor(Screen).input_map[self.current_cell]
self.query_ancestor(Screen).ready_tx(io_only=True)
else:
content = self.emulate_scroll_down(interval=0.6)
self.current_cell = self.emulate_scroll_down(interval=self.scroll_counter - self.y_coord - 1)
if self.id == "input_tag":
self.query_ancestor(Screen).foldr["ps"].current = self.query_ancestor(Screen).input_map[content]
self.query_ancestor(Screen).foldr["ps"].current = self.query_ancestor(Screen).input_map[self.current_cell]
self.query_ancestor(Screen).ready_tx(io_only=True)
128 changes: 111 additions & 17 deletions nnll_10/package/combo.tcss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# # # # <!-- // /* SPDX-License-Identifier: blessing) */ -->
# # # # <!-- // /* d a r k s h a p e s */ -->




$min-height: 3;
# #dedede;
# #000000;
Expand All @@ -12,40 +15,43 @@ $min-height: 3;
# rgb(28, 26, 26)
# rgb(31, 0, 65)
# surfaces
$negative-space: $background-darken-3;
$main-background: $background;
$top-surface: $surface;
$focus-surface: $foreground;
$negative-space: $background-darken-3;
$main-background: $background;
$top-surface: $surface;
$focus-surface: $foreground;

# text
$sunken-text: $background-lighten-3;
$raised-text: $foreground-darken-3; # $secondary;
$hover-focus: $foreground;
$sunken-text: $background-lighten-3;
$raised-text: $foreground-darken-3; # $secondary;
$hover-focus: $foreground;


# layout
$layout-type: grid;
$layout-type: grid;
$centre-frame-margin: 0 1 0 1;
$vertical-grid: 1 3;
$horizontal-grid: 3 1;
$proportions: 0.7fr 4.5fr 0.7fr;
$vertical-grid: 1 3;
$horizontal-grid: 3 1;
$proportions: 0.7fr 4.5fr 0.7fr;
$vertical-proportions: 0.6fr 5fr 0.55fr;
$grid-fraction: 1fr;
$grid-fraction: 1fr;
$invisible-scrollbar: 0 0;
$margin-size: 0;
$margin-size: 0;

# alignment
$title-align: left;
$border-shape: round;
$hatch-border: horizontal;
$title-align: left;
$border-shape: round;
$hatch-border: horizontal;
$hatch-align: left;

# color
$message-panel-subtitle: $raised-text;
$selection-background: $focus-surface;



#seam {
align: left top;
content-align-horizontal: left;
}
#footer {
background: $main-background;
}
Expand Down Expand Up @@ -74,7 +80,86 @@ $selection-background: $focus-surface;

}

#selectah {
color: $sunken-text;
border: vkey $focus-surface;
margin-top: -1;
margin-left: 60;
width: 100%;
height: 3;
align: right top;
content-align: right top;
color: $background-lighten-3;
scrollbar-size: $invisible-scrollbar;
Static#label {
width: 1fr;
height: auto;
color: $sunken-text;
background: transparent;
&:focus {
color: $foreground-darken-1;
}
&:hover {
color: $foreground-darken-1;
}
}
&.-has-value Static#label {
color: $background-lighten-3;
}
&:blur {
color: $sunken-text;
border: vkey $negative-space 7%;
}
&:focus {
border: vkey $focus-surface;
}
&:hover {
color: $sunken-text;
border: vkey $focus-surface;
}
SelectCurrent {
color: $sunken-text;
scrollbar-size: 0 0;
background:$negative-space 7%;
border: round $focus-surface;
&:blur {
color: $sunken-text;
border:none;
}
&:hover {
color: $sunken-text;
border:none;
}
&:focus {
color: $sunken-text;
border:none;
}
}
SelectOverlay {
color: $sunken-text;
overlay: screen;
scrollbar-size: 0 0;
background:$negative-space 7%;
border: round $focus-surface;

&:hover {
color: $sunken-text;
overflow: hidden;
border: round $focus-surface;
scrollbar-size: $invisible-scrollbar;
}
&.active {
color: $sunken-text;
scrollbar-size: 0 0;
background: $negative-space 7%;
border: round $focus-surface;
overflow: hidden;
}
&.blur {
border: round $focus-surface;
}
}
}
#top-frame, #bottom-frame, #left-frame, #right-frame {
background: $negative-space;
}
Expand Down Expand Up @@ -117,6 +202,9 @@ SidebarLeft, SidebarRight {
}

#response_panel {
width: 100%;
margin: 0 0;
height: 100%;
border: round $main-background;
hatch: $hatch-align $main-background;
&:focus-within {
Expand All @@ -130,6 +218,12 @@ SidebarLeft, SidebarRight {

#display_bar {
color: $panel-lighten-1;
margin: 0 0;
padding: 0 0;
height: 1;
width: 50%;
layer: above;
content-align: left top;
scrollbar-size: $invisible-scrollbar;
background: $negative-space 7%;
&:blur {
Expand Down
Loading