Skip to content

feat: Add hot reloading command to the CLI#200

Closed
johnchildren wants to merge 1 commit into
mainfrom
hot-reloading
Closed

feat: Add hot reloading command to the CLI#200
johnchildren wants to merge 1 commit into
mainfrom
hot-reloading

Conversation

@johnchildren
Copy link
Copy Markdown
Collaborator

@johnchildren johnchildren commented Sep 16, 2025

Adds a dev CLI command when tierkreis_visualization is installed in the python environment that can be invoked similarly to the run command. It will watch the user's file for changes and reload the graph based on those changes.

tkr dev -g examples/hello_world_graph.py:hello_graph

If there are issues importing stubs it can be a little problematic, but it does work in principle.


def _watch_graph(graph_location: str) -> None:
graph = load_graph(graph_location)
visualize_graph(graph.get_data())
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work correctly? From the type hints, load_graph returns GraphData, which does not have a get_data() method.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on whether the object you import is graphdata or graphbuilder, but I've been testing it with graphbuilder graphs and it works fine.

We should try to make sure that graphbuilder is always the public API though and clear up this confusion.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the type annotations for "load_graph"'s return type should probably be 'Any' really

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed as much, I tried with GraphData and it failed for me

@johnchildren johnchildren changed the title WIP: Add hot reloading command to the CLI feat: Add hot reloading command to the CLI Sep 19, 2025
@philipp-seitz
Copy link
Copy Markdown
Collaborator

closed in favor of #248

@johnchildren johnchildren deleted the hot-reloading branch March 4, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants