Giter Club home page Giter Club logo

Comments (21)

hobu avatar hobu commented on May 28, 2024

Can we wait til tkmorrow? I want to go through my local tree and I can't get to this until tonight.

On Jul 12, 2014, at 10:01 AM, Sean Gillies [email protected] wrote:

Now that #18 is closed, Rtree works on Python 3.4 and this warrants a new release. Will tag and upload to PyPI after a little more testing with GeoPandas.

cc @hobu


Reply to this email directly or view it on GitHub.

from rtree.

sgillies avatar sgillies commented on May 28, 2024

Waiting is good. I just found another 2/3 quirk, next is problematic, fixed in 8ead5fd. I might find a couple more issues like this today.

from rtree.

hobu avatar hobu commented on May 28, 2024

Getting some error messages with homebrew's libspatialindex at this time.

======================================================================
FAIL: /Users/hobu/dev/git/rtree/tests/index.txt
Doctest: index.txt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for index.txt
  File "/Users/hobu/dev/git/rtree/tests/index.txt", line 0

----------------------------------------------------------------------
File "/Users/hobu/dev/git/rtree/tests/index.txt", line 37, in index.txt
Failed example:
    idx.insert(4321, (34.3776829412, 26.7375853734, 49.3776829412, 41.7375853734), obj=42)
Exception raised:
    Traceback (most recent call last):
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py", line 1289, in __run
        compileflags, 1) in test.globs
      File "<doctest index.txt[11]>", line 1, in <module>
        idx.insert(4321, (34.3776829412, 26.7375853734, 49.3776829412, 41.7375853734), obj=42)
      File "/Users/hobu/dev/git/rtree/rtree/index.py", line 350, in insert
        size, data, pyserialized = self._serialize(obj)
      File "/Users/hobu/dev/git/rtree/rtree/index.py", line 309, in _serialize
        serialized = self.dumps(obj)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1374, in dumps
        Pickler(file, protocol).dump(obj)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 202, in __init__
        raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
    ValueError: pickle protocol must be <= 2


======================================================================
FAIL: /Users/hobu/dev/git/rtree/tests/test_customStorage.txt
Doctest: test_customStorage.txt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for test_customStorage.txt
  File "/Users/hobu/dev/git/rtree/tests/test_customStorage.txt", line 0

----------------------------------------------------------------------
File "/Users/hobu/dev/git/rtree/tests/test_customStorage.txt", line 155, in test_customStorage.txt
Failed example:
    r2.count( (0,0,10,10) )
Expected:
    1
Got:
    1L


----------------------------------------------------------------------

from rtree.

sgillies avatar sgillies commented on May 28, 2024

I'll fix these during the game :)

from rtree.

sgillies avatar sgillies commented on May 28, 2024

@hobu, I see something different on Travis: https://travis-ci.org/Toblerity/rtree/builds/29842558.

Is the custom storage stuff in use? I'm wondering if it's allowing people to succeed poorly territory...

I've got 1.8.1 on my laptop, homebrew, and no errors at all. Travis has Ubuntu precise, so only 1.7. Hrm.

from rtree.

sgillies avatar sgillies commented on May 28, 2024

I'm inclined to release 0.8 despite that custom storage tests are failing with libspatialindex 1.7. FWIW, the index.txt passes with 1.7 on Travis and 1.8.1 on my Mac.

from rtree.

hobu avatar hobu commented on May 28, 2024

We should maybe just disable custom storage for all libspatialindex less than 1.8

On Jul 13, 2014, at 3:55 PM, Sean Gillies [email protected] wrote:

From #12 it looks like I've got a version < 1.8 on Travis although Ubuntu GIS appears to offer 1.8.1.


Reply to this email directly or view it on GitHub.

from rtree.

perrygeo avatar perrygeo commented on May 28, 2024

I'm seeing the pickle protocol error on Ubuntu 14.04 with stock libspatialite-dev (1.8.1?) via the spatial_index branch in geopandas. Python 2.7.6 64 bit.

/home/mperry/src/geopandas/examples/_ctypes/callbacks.c in 'calling callback function'()

/home/mperry/env/geopandas/src/rtree/rtree/index.pyc in py_next_item(p_id, p_mins, p_maxs, p_dimension, p_data, p_length)
    686                 p_length[0] = 0
    687             else:
--> 688                 p_length[0], data, _ = self._serialize(obj)
    689                 p_data[0] = ctypes.cast(data, ctypes.POINTER(ctypes.c_ubyte))
    690 

/home/mperry/env/geopandas/src/rtree/rtree/index.pyc in _serialize(self, obj)
    307 
    308     def _serialize(self, obj):
--> 309         serialized = self.dumps(obj)
    310         size = len(serialized)
    311 

/usr/lib/python2.7/pickle.pyc in dumps(obj, protocol)
   1372 def dumps(obj, protocol=None):
   1373     file = StringIO()
-> 1374     Pickler(file, protocol).dump(obj)
   1375     return file.getvalue()
   1376 

/usr/lib/python2.7/pickle.pyc in __init__(self, file, protocol)
    200             protocol = HIGHEST_PROTOCOL
    201         elif not 0 <= protocol <= HIGHEST_PROTOCOL:
--> 202             raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
    203         self.write = file.write
    204         self.memo = {}

ValueError: pickle protocol must be <= 2

from rtree.

sgillies avatar sgillies commented on May 28, 2024

Think it could be the switch from cPickle to pickle? ba43b44

from rtree.

kjordahl avatar kjordahl commented on May 28, 2024

@sgillies Yes, this block doesn't make any sense:

try:
    import pickle as pickle
except ImportError:
    import pickle

the first import should still be cPickle as pickle. I'll bet it was an automatic 2to3 change. The try/except should still work on Python 3.

from rtree.

hobu avatar hobu commented on May 28, 2024

All tests passing for me with libspatialindex 1.8.1 via homebrew for master.

from rtree.

sgillies avatar sgillies commented on May 28, 2024

Yeah, that looks right, hobu. On Python 3, cPickle is _pickle and is imported transparently when available.

from rtree.

sgillies avatar sgillies commented on May 28, 2024

Confirmations of the fix are appearing in geopandas/geopandas#141 :)

from rtree.

hobu avatar hobu commented on May 28, 2024

Toblerity/Rtree tests still failing due to old libspatialindex, I think

https://travis-ci.org/Toblerity/rtree/jobs/30203316

from rtree.

sgillies avatar sgillies commented on May 28, 2024

Yep, got a fix for that in ce888d1.

from rtree.

hobu avatar hobu commented on May 28, 2024

Added detection to the library in case someone actually uses it in libspatialindex < 1.8 in @66393b1188a2be600dbadbf87e8e3e86a32fa43d

from rtree.

hobu avatar hobu commented on May 28, 2024

Still bombing. https://travis-ci.org/Toblerity/rtree/jobs/30206051 For some reason @ce888d1de1ea0e50427e53eedfc0a6e65426f2a1 isn't causing custom storage tests to be turned off, but the error message is returned to the user now at least.

from rtree.

hobu avatar hobu commented on May 28, 2024

Another swing, working locally, at @b453da6634b3d654889600982acb278c789718ba

from rtree.

sgillies avatar sgillies commented on May 28, 2024

I followed up in 1f969aa. This is gonna work :)

from rtree.

hobu avatar hobu commented on May 28, 2024

Confirmed that 1.8+ is still gonna work with customStorage after @1f969aa

from rtree.

sgillies avatar sgillies commented on May 28, 2024

Travis is happy. I'll tag and upload to PyPI.

from rtree.

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.