Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jupyter V2.1 with backwards compatible changes #917

Merged
merged 8 commits into from
May 28, 2024
Merged

Conversation

zilto
Copy link
Collaborator

@zilto zilto commented May 23, 2024

Reimplementation of #846 with backwards compatible changes with V1.

Compared to V2:

  • support module_name as positional or named arg (-m/--module_name)
  • support -c/--config
  • support -h/--help
  • ignores -r/--rebuild-drivers
  • ignores -v/--verbose
  • richer support for -c/--config
  • alias %%insert_module to %%module_to_cell
  • creates a temporary file for the temporary modules to play nicely with Hamilton UI

Currently ignores the %%incr_cell_to_module. We have to consider what it means to deduplicate these 100+ lines of logic. If this feature truly adds value, it should be an argument instead of a separate magic. I propose -a/--append INDEX. This means the magic would now require to be stateful though opening opportunities for more bugs.

How I tested this

The notebook tutorial.ipynb covers all implemented functionalities, so it's a good test for intended behavior.

TODO

  • Manually test all notebooks using %%cell_to_module
  • Reimplement the 2 notebooks currently using %%incr_cell_to_module
  • Update documentation

@zilto zilto added enhancement New feature or request examples Related to code under `examples/` plugin Relates to a Hamilton plugin (adapters, materializers, etc.) labels May 23, 2024
@zilto zilto requested a review from skrawcz May 23, 2024 19:29
@zilto zilto mentioned this pull request May 23, 2024
7 tasks

This comment was marked as off-topic.

Copy link
Collaborator

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

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

looks good, but undelete %incr_cell_to_module

hamilton/plugins/jupyter_magic.py Show resolved Hide resolved
hamilton/plugins/jupyter_magic.py Show resolved Hide resolved
hamilton/plugins/jupyter_magic.py Show resolved Hide resolved
Co-authored-by: Stefan Krawczyk <stefan@dagworks.io>
@zilto zilto requested a review from skrawcz May 25, 2024 14:33
Copy link
Collaborator

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

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

Looks good. I assume you've tested it, e.g. %incr_cell_to_module still works? :)

@skrawcz
Copy link
Collaborator

skrawcz commented May 28, 2024

Cool - I'd squash merge this PR when it's ready.

@zilto zilto merged commit 831a093 into main May 28, 2024
23 checks passed
@zilto zilto deleted the plugins/jupyter-v2.1 branch May 28, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request examples Related to code under `examples/` plugin Relates to a Hamilton plugin (adapters, materializers, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants