Git Product home page Git Product logo

Comments (5)

 avatar commented on May 23, 2024

[ LP comment 1 by: eteq, on 2009-09-04 00:41:46.232025+00:00 ]

This is happening for me as well in 0.10 - it's pretty annoying in that it renders dreload (a very useful function) essentially useless. It doesn't even work to do dreload(somemodulethatusesnumpy,exclude=['numpy','numpy.numpy','numpy.show'])

from ipython.

tknbamn avatar tknbamn commented on May 23, 2024

Do you think it a good idea to modify the dreload() to accept a hook argument that determines whether a given module need reloading ?
I have wrote such a patch because I usually want to reload my own modules, but not builtin modules or numpy, scipy etc.
By passing a hook list, you can choose which modules to be reloaded.

I am not sure where to submit the patch, but if you have interested in,
please let me know.

from ipython.

emaror avatar emaror commented on May 23, 2024

The exclusion/inclusion of modules should be more flexible (and actually work).

For me, limiting the reloaded modules just to specific directories was useful (c.f. excluding modules by names).

from ipython.

fperez avatar fperez commented on May 23, 2024

Yes, such a patch would be very useful, until we figure out the real problem.

@tknbamn, here's a description of our dev workflow:

http://ipython.github.com/ipython-doc/dev/development/index.html

If you're familiar with git/github, it boils down to 'make the fix in a branch, push the "pull request" button'.

I'm flagging this 'dormant' for now because it's not on the critical path for the core team right now, but we're happy to review a pull request at any time. And a bug with a pull request automatically is treated as high priority.

from ipython.

bfroehle avatar bfroehle commented on May 23, 2024

At this point my working hypothesis is that the original knee.py (which dreload borrows) no longer mimics Python's import mechanism closely enough.

For example, if you grab knee.py from an old version of Python, you'll see the following::

$ python
Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import knee
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "knee.py", line 16, in import_hook
    q, tail = find_head_package(parent, name)
  File "knee.py", line 52, in find_head_package
    q = import_module(head, qname, parent)
  File "knee.py", line 101, in import_module
    m = imp.load_module(fqname, fp, pathname, stuff)
...
ImportError: numpy.core.multiarray failed to import

But, don't fear, I've rewritten knee.py for the new import syntax, and verified that it works in Python 2.6.7, 2.7.2, and 3.2.2.

from ipython.

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.