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

Include contrib folder and pytorch stringifier #476

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

georgepar
Copy link

This PR introduces a new contrib folder under pudb for community
customization. A stringifier for pytorch is included.
Related issue: #475

Detailed changelog:

  • A module was added under pudb/contrib/stringifiers as place to store
    custom stringifiers.
  • A stringifier for pytorch tensors and modules is included.
  • An option was added in the settings menu for the user to enable or
    disable the cotrib content for users that want to stick to the core
    pudb installation.
  • Changes were made in var_view.py and settings.py to allow for
    inclusion of the contrib/stringifiers in the configuration menu.

Signed-off-by: Giorgos Paraskevopoulos [email protected]

This PR introduces a new contrib folder under pudb for community
customization. A stringifier for pytorch is included.

Detailed changelog:

* A module was added under pudb/contrib/stringifiers as place to store
  custom stringifiers.
* A stringifier for pytorch tensors and modules is included.
* An option was added in the settings menu for the user to enable or
  disable the cotrib content for users that want to stick to the core
  pudb installation.
* Changes were made in var_view.py and settings.py to allow for
  inclusion of the contrib/stringifiers in the configuration menu.

Signed-off-by: Giorgos Paraskevopoulos <[email protected]>
Copy link
Owner

@inducer inducer left a comment

Choose a reason for hiding this comment

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

Thanks! There are some CI failures, and a few more concerns below.

@@ -0,0 +1,46 @@
try:
Copy link
Owner

Choose a reason for hiding this comment

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

Could you have the CI install pytorch to make sure this code is tested?

@@ -47,7 +47,7 @@
"Topic :: Terminals",
"Topic :: Utilities",
],
packages=["pudb"],
packages=["pudb", "pudb.contrib", "pudb.contrib.stringifiers"],
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
packages=["pudb", "pudb.contrib", "pudb.contrib.stringifiers"],
packages=find_packages(),

Import from setuptools.

from typing import Any

try:
import torch
Copy link
Owner

Choose a reason for hiding this comment

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

This is heavyweight, and it should only happen if the stringifier is actually used, not unconditionally on every import.

@@ -270,6 +277,14 @@ def _update_config(check_box, new_state, option_newvalue):
bool(conf_dict["hide_cmdline_win"]), on_state_change=_update_config,
user_data=("hide_cmdline_win", None))

enable_community_contributed_content = urwid.CheckBox(
"Enable community contributed content. This will give you access to more "
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
"Enable community contributed content. This will give you access to more "
"Enable community contributed content. This will give you access to more "

@@ -270,6 +277,14 @@ def _update_config(check_box, new_state, option_newvalue):
bool(conf_dict["hide_cmdline_win"]), on_state_change=_update_config,
user_data=("hide_cmdline_win", None))

enable_community_contributed_content = urwid.CheckBox(
Copy link
Owner

Choose a reason for hiding this comment

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

All other settings in pudb act instantaneously. This one should, too.

@inducer
Copy link
Owner

inducer commented Oct 22, 2021

Unsubscribing... @-mention or request review once it's ready for a look or needs attention.

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