Giter Site home page Giter Site logo

Circular imports? about blaze HOT 6 CLOSED

blaze avatar blaze commented on July 4, 2024
Circular imports?

from blaze.

Comments (6)

sdiehl avatar sdiehl commented on July 4, 2024

I believe the "test_sqlite" test was vestigal. I removed it and merged the lasted code into master.

$ git pull origin
$ git checkout master

Are you running this from the source directory or did you setup.py install it? I can't seem reproduce the circular dep. Could you run the following and paste the output?

$ python
>>> from blaze import open

from blaze.

seibert avatar seibert commented on July 4, 2024

I'm currently hacking around with the directory structure trying to find a way to run the tests. In order to make sure the compiled modules are available, I'm running python setup.py install in a virtualenv and then copying the blaze/tests directory to a different location before running them to prevent the blaze directory in the source from being used on accident. I figure I'm doing it wrong, but I'm not sure what the right way is yet. :)

Here is my output after updating to the latest on origin/master:

(env)Rover:blaze stan$ python
Python 2.7.3 (default, Nov 17 2012, 19:54:34) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import blaze.open
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/__init__.py", line 5, in <module>
    from lib import *
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/lib.py", line 41, in <module>
    from blaze.rts.funcs import PythonFn, install, lift
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/rts/funcs.py", line 30, in <module>
    from blaze.metadata import all_prop
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/metadata.py", line 2, in <module>
    from blaze.expr.utils import Symbol as S
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/expr/__init__.py", line 1, in <module>
    import ops
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/expr/ops.py", line 1, in <module>
    from graph import Op
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/expr/graph.py", line 26, in <module>
    from blaze.sources.canonical import PythonSource
  File "/work/projects/blaze/env/lib/python2.7/site-packages/blaze/sources/canonical.py", line 6, in <module>
    from blaze.sources.descriptors.byteprovider import ByteProvider
ImportError: No module named descriptors.byteprovider

So now I think I have a different problem. I don't see a blaze.sources.descriptors.byteprovider getting built anywhere. I'm currently taking the hard road and trying to build blaze just with virtualenv and without Anaconda at the moment. Is blaze.sources.descriptors.byteprovider part of another package?

from blaze.

sdiehl avatar sdiehl commented on July 4, 2024

In the lasest branch on master line 6 of canonical.py is the following.

from blaze.desc.byteprovider import ByteProvider

Perhaps your local repo is out of date?

I recommend that if you're going to try and play around with the unstable dev version of Blaze not install it the virtualenv and just run it from a local folder. This is what I do for development. If you want to run the tests you then have option of either running python setup.py test or using a test suite runner like nose nosetests blaze.

from blaze.

seibert avatar seibert commented on July 4, 2024

OK, I nuked my repo and started over. Now there is just a minor problem with a missing blaze/algo/std.pyx file in the repository which I can ignore by commenting out the from std import std in blaze/algo/init.py. Did someone forget to add std.pyx in a previous commit?

With that minor change, I can run python setup.py build, copy blaze/tests/test_quickstart.py to a new location, and then run nose with the build/lib.macosx-10.8-x86_64-2.7 directory in my PYTHONPATH. All the tests in the file pass, and I am happy.

I would love to know how you compile blaze and run the tests normally, because I still think I'm doing it a strange way. :)

from blaze.

sdiehl avatar sdiehl commented on July 4, 2024

My workflow is usually self contained in the local folder.

  1. python setup.py build_ext --inplace to refresh the C extensions.
  2. Write code
  3. nosetests blaze to run the tests

With this command to flush old files.

  1. python setup.py clean.

We aren't quite at a stable version of Blaze yet so I'm very grateful to the people who are testing it out and finding all these little bugs. Many thanks!

Also, I did forget to add the std.pyx file. I'll add that later tonight. :-)

from blaze.

seibert avatar seibert commented on July 4, 2024

Ahh, wonderful! Step 1 was the trick I didn't know about. Once you fix the missing std.pyx, I think this bug is closed.

from blaze.

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.