Giter Site home page Giter Site logo

Comments (7)

andrewhead avatar andrewhead commented on June 1, 2024 1

Hi @joyceerhl! Thanks for pointing out this bug and for the helpful reproduction :-)

I think I've figured out the issue here---the dataflow code needs to be extended to look for uses of names within classes. One fix for this exact case will be to fill in the empty case for ast.CLASS here to collect the names used from all def's (update: all defs and variable definitions) in the class (e.g., by calling getUses on all of the class's functions).

I can take a go at it, though it will take me a couple more days. I'm also happy to walk you through the process of updating it if you've got some time on your hands and are feeling adventurous ^_^

from gather.

andrewhead avatar andrewhead commented on June 1, 2024 1

By the way, wanted to thank you again for helping us improve the parser!

from gather.

joyceerhl avatar joyceerhl commented on June 1, 2024 1

@andrewhead I can take a crack at it! :-)

from gather.

andrewhead avatar andrewhead commented on June 1, 2024

Sweet! Do you want to set up a remote call to talk through any of this, or just take a go and follow up as any questions come up? Lmk as I'm happy to help!

from gather.

andrewhead avatar andrewhead commented on June 1, 2024

@joyceerhl Great pull request! Do we want to keep this issue open (i.e. is there any other refinement of that functionality we should keep in mind for the near future), or is this good to close?

from gather.

joyceerhl avatar joyceerhl commented on June 1, 2024

I just found a related bug while testing Gather on classes:

# Cell 1
def func():
    pass
class Foo():
    def bar(self):
        func()
# Cell 2
Foo().bar()

If you gather the output of Cell 2 to a notebook, the resultant output contains class Foo(): twice:

# Cell 1
def func():
    pass
class Foo():
class Foo():
    def bar(self):
        func()
# Cell 2
Foo().bar()

Edit: I should also mention that this is not a problem if you define func and Foo in two separate cells like so:

# Cell 1
def func():
    pass
# Cell 2
class Foo():
    def bar(self):
        func()
# Cell 3
Foo().bar()

I only noticed this after we merged #28 which is why I'm reporting it here, but this could also be a bug with how sliceLocations are computed. Would love to get your thoughts on this one!

from gather.

joyceerhl avatar joyceerhl commented on June 1, 2024

Closing this issue for now as #31 is a separate problem and the class gathering functionality seems complete for now!

from gather.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.