Skip to content

Commit bd37c20

Browse files
committed
fix: some minor misc fixes and comments modifications
1 parent 99afc18 commit bd37c20

File tree

6 files changed

+8
-13
lines changed

6 files changed

+8
-13
lines changed

src/tbp/interactive/colors.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class Palette:
5050
charcoal: str = "#3f3f3f"
5151
link_water: str = "#dfe6f5"
5252

53-
# ---------- Internal helper ----------
5453
@classmethod
5554
def _validate(cls, name: str) -> str:
5655
if not hasattr(cls, name):
@@ -62,7 +61,6 @@ def _validate(cls, name: str) -> str:
6261
raise KeyError(msg)
6362
return getattr(cls, name)
6463

65-
# ---------- Public API ----------
6664
@classmethod
6765
def as_hex(cls, name: str) -> Color:
6866
"""Return the raw hex string for a color name."""

src/tbp/interactive/events.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212

1313
@dataclass
1414
class EventSpec:
15-
"""Specification for an Event to be defined inside WidgetOps.
15+
"""Specification for an Event to be defined as a WidgetUpdater callback trigger.
1616
1717
Attributes:
1818
trigger: Event trigger name (e.g., KeyPressed)
1919
name: Event name field in Vedo `event.name` (e.g., keypress).
20-
would be send in the topic message value.
2120
required: Whether this event is required for the callback trigger. If
2221
True, the updater will not call the callback until a message for this
2322
topic arrives.

src/tbp/interactive/scopes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ class ScopeViewer:
2222
2323
Behavior summary:
2424
- Scope 0:
25-
* If at least one widget is hidden -> show ALL widgets.
25+
* If at least one widget is hidden -> show all widgets.
2626
* Else (all visible) -> hide ALL widgets.
2727
- Scope k (1..9):
2828
* Toggle that scope on/off.
29-
* A widget is visible if ANY active scope includes it.
30-
* If no active scopes -> all widgets off.
29+
* During a toggle off, a widget may remain visible if any other active scope
30+
includes it.
3131
3232
The widgets themselves decide how to hide/show internally using
3333
their .on() / .off() visibility handlers.

src/tbp/interactive/widget_updaters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def accepts(self, msg: TopicMessage) -> bool:
9090
def expire_topic(self, topic_name: str) -> None:
9191
"""Expire (remove) the stored message for a given topic.
9292
93-
After expiration, the updater will require a new message for that topic
93+
After expiration, the updater may require a new message for that topic
9494
before becoming ready again.
9595
9696
Args:

src/tbp/interactive/widgets.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,6 @@ def updater_events(self) -> set[str]:
211211
if isinstance(e, EventSpec)
212212
}
213213

214-
return {t.name for u in self.widget_ops.updaters for t in u.topics}
215-
216214
def add(self) -> None:
217215
"""Create the widget and register the debounce callback.
218216

src/tbp/plot/plots/interactive_hypothesis_space_correlation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ def extract_state(self, widget: Slider2D) -> int:
966966
def set_state(self, widget: Slider2D, value: int) -> None:
967967
set_slider_state(widget, value)
968968

969-
def state_to_messages(self, state: float) -> Iterable[TopicMessage]:
969+
def state_to_messages(self, state: int) -> Iterable[TopicMessage]:
970970
return [TopicMessage(name="top_k", value=state)]
971971

972972

@@ -1396,15 +1396,15 @@ def decrement_step(self, episode: int, step: int) -> tuple[int, int]:
13961396
Returns:
13971397
A tuple `(prev_episode, prev_step)`.
13981398
"""
1399-
# Base case: already at earliest step
1399+
# Already at earliest step
14001400
if episode == 0 and step == 0:
14011401
return 0, 0
14021402

14031403
# If we're not at the start of the episode, just decrement the step
14041404
if step > 0:
14051405
return episode, step - 1
14061406

1407-
# step == 0 → need to go to previous episode
1407+
# If step is 0, we need to go to previous episode
14081408
prev_episode = episode - 1
14091409

14101410
# Find last step index in previous episode

0 commit comments

Comments
 (0)