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

Display Breadcrumbs of classes/methods/functions in IC #174

Open
kailukowiak opened this issue Feb 4, 2024 · 0 comments
Open

Display Breadcrumbs of classes/methods/functions in IC #174

kailukowiak opened this issue Feb 4, 2024 · 0 comments

Comments

@kailukowiak
Copy link

I love using icecream -thanks so much for making and maintaining it- but I'm having some troubles using it. Currently I'm writing a neural net in Flax and every time I call ic() I just get the same method name __call__. This makes it a bit harder to debug. Would you consider adding the ability to include the class or even parent function? For example:

class Class1:
    def __init__(self):
        self.x = 1

    def display(self):
        ic(self.x)
        print(self.x)

class Class2:
    def __init__(self):
        self.x = 2

    def display(self):
        ic(self.x)
        print(self.x)

one = Class1()
one.display()

two = Class2()
two.display()

# ic| 4014262339.py:6 in display()- self.x: 1
# ic| 4014262339.py:14 in display()- self.x: 2
# 1
# 2

Ideally, I'd like to see Class1.display() and Class2.display() in the IC output.

Thanks again.

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

No branches or pull requests

1 participant