Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Changes visualize driver functions to return graphviz object #286

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

skrawcz
Copy link
Collaborator

@skrawcz skrawcz commented Jan 25, 2023

This change is backwards compatible. It returns and wires through returning the graphviz object created. That way in a notebook, it can render the DAG for you.

It also makes saving to a file optional -- you just need to pass in None explicitly. Adds test for it.

The hello world example is also updated with a real notebook and shows Thierry Jean's approach of using the autoreload extensions.

Changes

  • returns graphviz object from display functions
  • changes hello world to include a proper notebook

How I tested this

  • via notebook
  • unit tests

Notes

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@skrawcz
Copy link
Collaborator Author

skrawcz commented Jan 25, 2023

Screen Shot 2023-01-24 at 9 54 16 PM

This change is backwards compatible. It returns and wires
through returning the graphviz object created. That way in a notebook,
it can render the DAG for you.

It also makes saving to a file optional -- you just need to
pass in None explicitly. Adds test for it.

The hello world example is also updated with a real notebook
and shows Thierry Jean's approach of using the autoreload
extensions.
Copy link
Collaborator

@elijahbenizzy elijahbenizzy left a comment

Choose a reason for hiding this comment

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

LGTM -- a few minor points

hamilton/driver.py Show resolved Hide resolved
hamilton/graph.py Show resolved Hide resolved
tests/test_graph.py Show resolved Hide resolved
@elijahbenizzy elijahbenizzy self-requested a review January 25, 2023 20:59
@skrawcz skrawcz merged commit 53f191d into main Jan 27, 2023
@skrawcz skrawcz deleted the augment_visualize_return branch January 27, 2023 22:41
@skrawcz skrawcz linked an issue Jan 31, 2023 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better notebook support for visualizing DAGs
2 participants