data-oriented-pyglet
data-oriented-pyglet copied to clipboard
Py3compatible2
Make the code compatible with python 3 and 2
- all scripts and modules have been converted apart of add-delete.py, animated_test.py and color_change_test.py since they were not mentionned in the README.
- compatibility issues have been solved according to these sources and there are many choices about solving some issues (i.e:zip() and map()): http://python-future.org/compatible_idioms.html http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html
- add a classifier in setup.py to indicate that the code is compatible with python 3.
About map and zip as iterators: I was already careful about that and I did according to my source and commit 38bc923. For the one with list, I'll try to replace them with list comprehension. However, notice that some are in an already complex line of codes and there is a case which there are 2 map() in a list comprehension.
About the classifier: I'll try to find the source, but the classifier I put means that it is compatible with python 3 and 2. One would have to add only at the end of this classifier to tell that it is compatible with only python 3.
All examples: I'll do it as soon as possible for the conversion, but it will take a while before I get familiar with the package enough to update the README.
About the import: As I told you, I had some issues with import. I added this code before I properly installed numpy_ecs as you told me on the issue thread. However, I'll rewrite that and retest it in case that it works.
Sounds good! I see now that you are correct about map and zip. Sorry.
I couldn't make the add-delete.py script work correctly. I get one of the two errors randomly. In both cases, allocator.guids = (101, 102)
-
There is an error at lines 138-139:
pts[:,0] = xhelpers*cos_ts[indices]
IndexError: array used as indices= must be integer type
Indices is in that case an empty array. So that's why the script stop at line 255:update_render_verts(*(sections[name] for name in render_verts),indices=indices)
-
At line 213
guids = random.sample(allocator.guids,n)
Value Error: sample larger than population
population:4, sample (102,101) it make the script stop at line 267 (I think. It's confusing in which order the blocks of codes is run, even with debugging)pyglet.clock.schedule_interval(lambda x,*y: delete_some(*y),2,4)
Thanks, I'll take a look at it probably on Thursday.
On Mon, Oct 24, 2016 at 1:32 AM, chemsed [email protected] wrote:
I couldn't make the add-delete.py script work correctly. I get one of the two errors randomly. In both cases, allocator.guids = (101, 102)
There is an error at lines 138-139: pts[:,0] = xhelpers_cos_ts[indices] IndexError: array used as indices= must be integer type Indices is in that case an empty array. So that's why the script stop at line 255: update_render_verts(_(sections[name] for name in render_verts),indices=indices)
At line 213 guids = random.sample(allocator.guids,n) Value Error: sample larger than population population:4, sample (102,101) it make the script stop at line 267 (I think. It's confusing in which order the blocks of codes is run, even with debugging) pyglet.clock.schedule_interval(lambda x,_y: delete_some(_y),2,4)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Permafacture/data-oriented-pyglet/pull/12#issuecomment-255658568, or mute the thread https://github.com/notifications/unsubscribe-auth/AFy27ZmUiE8LJ0nAsT1hUXqGnh9diF7hks5q3FD6gaJpZM4KYPJA .