Planar 0.2 is out

5 views
Skip to first unread message

Casey Duncan

unread,
Aug 21, 2010, 1:17:51 PM8/21/10
to grease...@googlegroups.com
At long last I have another planar release out:

http://pypi.python.org/pypi/planar/0.2

The big features are:

- Affine transforms
- Vector arrays

If anyone feels like testing it on their platform of choice, that'd be awesome.

-Casey

Tartley

unread,
Aug 22, 2010, 11:56:31 AM8/22/10
to Grease Users
Hey,

Many congrats on the new release! It's really exciting to see what
you've been up to.

I have a failure running the tests though, on WindowsXP, 32 bit,
Python 2.7, using mingw gcc compiler.

It compiles and installs OK (with harmless-looking warnings), and
seems to work fine from the few experiments I did at the command line,
but on running tests:

I'm gonna paste my entire install output, just in case, but the
interesting part is at the bottom of all this:

> python setup.py install
running install
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\planar
copying lib\planar\transform.py -> build\lib.win32-2.7\planar
copying lib\planar\util.py -> build\lib.win32-2.7\planar
copying lib\planar\vector.py -> build\lib.win32-2.7\planar
copying lib\planar\__init__.py -> build\lib.win32-2.7\planar
creating build\lib.win32-2.7\planar\test
copying test\test_planar.py -> build\lib.win32-2.7\planar\test
copying test\test_transform.py -> build\lib.win32-2.7\planar\test
copying test\test_util.py -> build\lib.win32-2.7\planar\test
copying test\test_vector.py -> build\lib.win32-2.7\planar\test
copying test\__init__.py -> build\lib.win32-2.7\planar\test
running build_ext
building 'planar.c' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\lib
creating build\temp.win32-2.7\Release\lib\planar
F:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Iinclude -IF:
\Python27\include
-IF:\Python27\PC -c lib/planar/cmodule.c -o build
\temp.win32-2.7\Release\lib\planar\cmodule.o
lib/planar/planar.h:55: warning: 'cos_sin_deg' defined but not used
lib/planar/planar.h:163: warning: 'hash_double' defined but not used
lib/planar/planar.h:194: warning: 'PlanarVec2_FromDoubles' defined but
not used
lib/planar/planar.h:208: warning: 'PlanarVec2_FromStruct' defined but
not used
lib/planar/planar.h:222: warning: 'PlanarVec2_Parse' defined but not
used
F:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Iinclude -IF:
\Python27\include
-IF:\Python27\PC -c lib/planar/cvector.c -o build
\temp.win32-2.7\Release\lib\planar\cvector.o
F:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Iinclude -IF:
\Python27\include
-IF:\Python27\PC -c lib/planar/ctransform.c -o build
\temp.win32-2.7\Release\lib\planar\ctransform.o
lib/planar/ctransform.c: In function `Affine_itransform':
lib/planar/ctransform.c:492: warning: long unsigned int format,
Py_ssize_t arg (arg 3)
lib/planar/ctransform.c: At top level:
lib/planar/planar.h:208: warning: 'PlanarVec2_FromStruct' defined but
not used
writing build\temp.win32-2.7\Release\lib\planar\c.def
F:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build
\temp.win32-2.7\Release\lib\planar\cmodule.o build
\temp.win32-2.7\Release\lib\planar\cvector.o build
\temp.win32-2.7\Release\lib\planar\ctransform.o build
\temp.win32-2.7\Release\lib\planar\c.def -LF:\Python27\libs -LF:
\Python27\PCbuild -lpython27 -lmsvcr90 -o build\lib.win32-2.7\planar
\c.pyd
running install_lib
creating F:\Python27\Lib\site-packages\planar
copying build\lib.win32-2.7\planar\c.pyd -> F:\Python27\Lib\site-
packages\planar
creating F:\Python27\Lib\site-packages\planar\test
copying build\lib.win32-2.7\planar\test\test_planar.py -> F:
\Python27\Lib\site-packages\planar\test
copying build\lib.win32-2.7\planar\test\test_transform.py -> F:
\Python27\Lib\site-packages\planar\test
copying build\lib.win32-2.7\planar\test\test_util.py -> F:\Python27\Lib
\site-packages\planar\test
copying build\lib.win32-2.7\planar\test\test_vector.py -> F:
\Python27\Lib\site-packages\planar\test
copying build\lib.win32-2.7\planar\test\__init__.py -> F:\Python27\Lib
\site-packages\planar\test
copying build\lib.win32-2.7\planar\transform.py -> F:\Python27\Lib
\site-packages\planar
copying build\lib.win32-2.7\planar\util.py -> F:\Python27\Lib\site-
packages\planar
copying build\lib.win32-2.7\planar\vector.py -> F:\Python27\Lib\site-
packages\planar
copying build\lib.win32-2.7\planar\__init__.py -> F:\Python27\Lib\site-
packages\planar
byte-compiling F:\Python27\Lib\site-packages\planar\test
\test_planar.py to test_planar.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\test
\test_transform.py to test_transform.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\test\test_util.py
to test_util.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\test
\test_vector.py to test_vector.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\test\__init__.py
to __init__.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\transform.py to
transform.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\util.py to
util.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\vector.py to
vector.pyc
byte-compiling F:\Python27\Lib\site-packages\planar\__init__.py to
__init__.pyc
running install_egg_info
Writing F:\Python27\Lib\site-packages\planar-0.2-py2.7.egg-info


> yolk -l | grep plan
planar - 0.2 - active


> nosetests -d -w build\lib.win32-2.7\planar
.............................................................................................................................Assertion
failed: PlanarVec2_Check(self), file lib/planar/cvector.c, line 1915

This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.


------------------------------
The final (failing) test is: test_clamp
(planar.test.test_vector.CVec2ArrayTestCase)

This actually crashed the process, throwing up a JIT-debug dialog. I
don't have Visual Studio installed, but would be willing to install it
and/or help diagnose this if that's helpful.

I worry that it's just my config using mingw gcc which might
contribute to the issue. Can anyone else on WinXP 32 verify this?

Casey Duncan

unread,
Aug 22, 2010, 1:59:42 PM8/22/10
to grease...@googlegroups.com
Hey,

Thanks for trying it, I'm happy to hear that it builds successfully,
That failure is interesting. The assertion is intended to crash the
process if it fails, because it basically means that something screwy
is going on and all bets are off. In this case, it means that the
"self" argument to the C method function is not the type of object it
expects. It's one of those things that "shouldn't happen" but
obviously is for some reason.

To help debug, can you add this line before line 1915 in cvector.c and
rebuild and run the tests?

printf("%s\n", Py_TYPE(self)->tp_name);

That will tell us what the thing is, assuming it's a valid python
object, but even if it isn't that tells us something.

Also running the tests with the "-v" option will help show all the
tests that have run, and in what order.

Thanks much!

-Casey

Jonathan Hartley

unread,
Aug 23, 2010, 5:51:29 AM8/23/10
to grease...@googlegroups.com
Hey there, thanks for the guidance.

I'm on a different WinXP machine today (at work), again with Python2.7,
mingw gcc. Same behaviour.

I added the printf to cvector.c and it prints 'planar.Vec2Array'. Full
output below.


> python setup.py build


lib/planar/planar.h:55: warning: 'cos_sin_deg' defined but not used
lib/planar/planar.h:163: warning: 'hash_double' defined but not used
lib/planar/planar.h:194: warning: 'PlanarVec2_FromDoubles' defined but
not used
lib/planar/planar.h:208: warning: 'PlanarVec2_FromStruct' defined but
not used
lib/planar/planar.h:222: warning: 'PlanarVec2_Parse' defined but not used

lib/planar/ctransform.c: In function `Affine_itransform':
lib/planar/ctransform.c:492: warning: long unsigned int format,
Py_ssize_t arg (arg 3)
lib/planar/ctransform.c: At top level:
lib/planar/planar.h:208: warning: 'PlanarVec2_FromStruct' defined but
not used


> nosetests -v -d -w build\lib.win32-2.7\planar
planar.test.test_planar.test_version_info ... ok
planar.test.test_planar.test_default_implementation ... ok
planar.test.test_planar.test_default_epsilon ... ok
planar.test.test_planar.test_set_epsilon ... ok
test_add (planar.test.test_transform.CAffineTestCase) ... ok
test_almost_equals (planar.test.test_transform.CAffineTestCase) ... ok
test_args_members_wrong_type
(planar.test.test_transform.CAffineTestCase) ... ok
test_args_too_few (planar.test.test_transform.CAffineTestCase) ... ok
test_args_too_many (planar.test.test_transform.CAffineTestCase) ... ok
test_cant_invert_degenerate (planar.test.test_transform.CAffineTestCase)
... ok
test_column_vectors (planar.test.test_transform.CAffineTestCase) ... ok
test_determinant (planar.test.test_transform.CAffineTestCase) ... ok
test_equality (planar.test.test_transform.CAffineTestCase) ... ok
test_getitem (planar.test.test_transform.CAffineTestCase) ... ok
test_getitem_wrong_type (planar.test.test_transform.CAffineTestCase) ... ok
test_gt (planar.test.test_transform.CAffineTestCase) ... ok
test_identity_constructor (planar.test.test_transform.CAffineTestCase)
... ok
test_imul_transform (planar.test.test_transform.CAffineTestCase) ... ok
test_imul_vector (planar.test.test_transform.CAffineTestCase) ... ok
test_inverse (planar.test.test_transform.CAffineTestCase) ... ok
test_is_conformal (planar.test.test_transform.CAffineTestCase) ... ok
test_is_degenerate (planar.test.test_transform.CAffineTestCase) ... ok
test_is_orthonormal (planar.test.test_transform.CAffineTestCase) ... ok
test_is_rectilinear (planar.test.test_transform.CAffineTestCase) ... ok
test_itransform (planar.test.test_transform.CAffineTestCase) ... ok
test_len (planar.test.test_transform.CAffineTestCase) ... ok
test_lt (planar.test.test_transform.CAffineTestCase) ... ok
test_members_are_floats (planar.test.test_transform.CAffineTestCase) ... ok
test_mul_by_identity (planar.test.test_transform.CAffineTestCase) ... ok
test_mul_transform (planar.test.test_transform.CAffineTestCase) ... ok
test_mul_vector (planar.test.test_transform.CAffineTestCase) ... ok
test_mul_wrong_type (planar.test.test_transform.CAffineTestCase) ... ok
test_repr (planar.test.test_transform.CAffineTestCase) ... ok
test_rmul_vector (planar.test.test_transform.CAffineTestCase) ... ok
test_rotation_constructor (planar.test.test_transform.CAffineTestCase)
... ok
test_rotation_constructor_quadrants
(planar.test.test_transform.CAffineTestCase) ... ok
test_rotation_constructor_with_pivot
(planar.test.test_transform.CAffineTestCase) ... ok
test_rotation_contructor_wrong_arg_types
(planar.test.test_transform.CAffineTestCase) ... ok
test_scale_constructor (planar.test.test_transform.CAffineTestCase) ... ok
test_shear_constructor (planar.test.test_transform.CAffineTestCase) ... ok
test_slice_last_row (planar.test.test_transform.CAffineTestCase) ... ok
test_str (planar.test.test_transform.CAffineTestCase) ... ok
test_sub (planar.test.test_transform.CAffineTestCase) ... ok
test_translation_constructor
(planar.test.test_transform.CAffineTestCase) ... ok
test_wrong_arg_type (planar.test.test_transform.CAffineTestCase) ... ok
test_zero_args (planar.test.test_transform.CAffineTestCase) ... ok
test_add (planar.test.test_transform.PyAffineTestCase) ... ok
test_almost_equals (planar.test.test_transform.PyAffineTestCase) ... ok
test_args_members_wrong_type
(planar.test.test_transform.PyAffineTestCase) ... ok
test_args_too_few (planar.test.test_transform.PyAffineTestCase) ... ok
test_args_too_many (planar.test.test_transform.PyAffineTestCase) ... ok
test_cant_invert_degenerate
(planar.test.test_transform.PyAffineTestCase) ... ok
test_column_vectors (planar.test.test_transform.PyAffineTestCase) ... ok
test_determinant (planar.test.test_transform.PyAffineTestCase) ... ok
test_equality (planar.test.test_transform.PyAffineTestCase) ... ok
test_getitem (planar.test.test_transform.PyAffineTestCase) ... ok
test_getitem_wrong_type (planar.test.test_transform.PyAffineTestCase) ... ok
test_gt (planar.test.test_transform.PyAffineTestCase) ... ok
test_identity_constructor (planar.test.test_transform.PyAffineTestCase)
... ok
test_imul_transform (planar.test.test_transform.PyAffineTestCase) ... ok
test_imul_vector (planar.test.test_transform.PyAffineTestCase) ... ok
test_inverse (planar.test.test_transform.PyAffineTestCase) ... ok
test_is_conformal (planar.test.test_transform.PyAffineTestCase) ... ok
test_is_degenerate (planar.test.test_transform.PyAffineTestCase) ... ok
test_is_orthonormal (planar.test.test_transform.PyAffineTestCase) ... ok
test_is_rectilinear (planar.test.test_transform.PyAffineTestCase) ... ok
test_itransform (planar.test.test_transform.PyAffineTestCase) ... ok
test_len (planar.test.test_transform.PyAffineTestCase) ... ok
test_lt (planar.test.test_transform.PyAffineTestCase) ... ok
test_members_are_floats (planar.test.test_transform.PyAffineTestCase) ... ok
test_mul_by_identity (planar.test.test_transform.PyAffineTestCase) ... ok
test_mul_transform (planar.test.test_transform.PyAffineTestCase) ... ok
test_mul_vector (planar.test.test_transform.PyAffineTestCase) ... ok
test_mul_vector_seq (planar.test.test_transform.PyAffineTestCase) ... ok
test_mul_wrong_type (planar.test.test_transform.PyAffineTestCase) ... ok
test_repr (planar.test.test_transform.PyAffineTestCase) ... ok
test_rmul_vector (planar.test.test_transform.PyAffineTestCase) ... ok
test_rotation_constructor (planar.test.test_transform.PyAffineTestCase)
... ok
test_rotation_constructor_quadrants
(planar.test.test_transform.PyAffineTestCase) ... ok
test_rotation_constructor_with_pivot
(planar.test.test_transform.PyAffineTestCase) ... ok
test_rotation_contructor_wrong_arg_types
(planar.test.test_transform.PyAffineTestCase) ... ok
test_scale_constructor (planar.test.test_transform.PyAffineTestCase) ... ok
test_shear_constructor (planar.test.test_transform.PyAffineTestCase) ... ok
test_slice_last_row (planar.test.test_transform.PyAffineTestCase) ... ok
test_str (planar.test.test_transform.PyAffineTestCase) ... ok
test_sub (planar.test.test_transform.PyAffineTestCase) ... ok
test_translation_constructor
(planar.test.test_transform.PyAffineTestCase) ... ok
test_wrong_arg_type (planar.test.test_transform.PyAffineTestCase) ... ok
test_zero_args (planar.test.test_transform.PyAffineTestCase) ... ok
planar.test.test_util.test_cached_property ... ok
test_almost_equals (planar.test.test_vector.CSeq2TestCase) ... ok
test_bool (planar.test.test_vector.CSeq2TestCase) ... ok
test_copy (planar.test.test_vector.CSeq2TestCase) ... ok
test_copy_subclass (planar.test.test_vector.CSeq2TestCase) ... ok
test_eq (planar.test.test_vector.CSeq2TestCase) ... ok
test_from_points (planar.test.test_vector.CSeq2TestCase) ... ok
test_get_bad_index (planar.test.test_vector.CSeq2TestCase) ... ok
test_get_bad_index_type (planar.test.test_vector.CSeq2TestCase) ... ok
test_get_bad_neg_index (planar.test.test_vector.CSeq2TestCase) ... ok
test_get_set_item (planar.test.test_vector.CSeq2TestCase) ... ok
test_imul_by_transform (planar.test.test_vector.CSeq2TestCase) ... ok
test_imul_incompatible (planar.test.test_vector.CSeq2TestCase) ... ok
test_init (planar.test.test_vector.CSeq2TestCase) ... ok
test_iter (planar.test.test_vector.CSeq2TestCase) ... ok
test_len (planar.test.test_vector.CSeq2TestCase) ... ok
test_mul_by_transform (planar.test.test_vector.CSeq2TestCase) ... ok
test_mul_incompatible (planar.test.test_vector.CSeq2TestCase) ... ok
test_ne (planar.test.test_vector.CSeq2TestCase) ... ok
test_set_bad_index (planar.test.test_vector.CSeq2TestCase) ... ok
test_set_bad_index_type (planar.test.test_vector.CSeq2TestCase) ... ok
test_unhashable (planar.test.test_vector.CSeq2TestCase) ... ok
test_add_array_to_other (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_add_arrays (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_add_arrays_of_different_length
(planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_add_incompatible (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_add_vector_to_array (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_almost_equals (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_append (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_append_insert_delete_many
(planar.test.test_vector.CVec2ArrayTestCase) ...
ok
test_append_many (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_ass_ext_slice (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_ass_ext_slice_wrong_size
(planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_ass_slice (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_ass_slice_wrong_type (planar.test.test_vector.CVec2ArrayTestCase)
... ok
test_bool (planar.test.test_vector.CVec2ArrayTestCase) ... ok
test_clamp (planar.test.test_vector.CVec2ArrayTestCase) ... planar.Vec2Array
Assertion failed: PlanarVec2_Check(self), file lib/planar/cvector.c,
line 1916

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

--
Jonathan Hartley Made of meat. http://tartley.com
tar...@tartley.com +44 7737 062 225 twitter/skype: tartley


Casey Duncan

unread,
Aug 23, 2010, 4:52:35 PM8/23/10
to grease...@googlegroups.com
Interesting, what's weird is that the same assertion succeeds in an
earlier test (test_append_insert_delete_many). Can you try a couple of
things?

1. See if you can reproduce the failure in isolation from the python
prompt, cd to build\lib.win32-2.7\ first if you don't have planar
installed. Something like this:

>>> from planar import Vec2Array
>>> a = Vec2Array([(1,2), (3,4)])
>>> a.clamp(1, 2)
>>> Vec2Array().clamp(1, 2)

2. If you comment out the assert statement in cvector.c and rebuild,
do the tests pass or crash somewhere else?

Thanks a lot for your help.

-Casey

Casey Duncan

unread,
Aug 23, 2010, 5:27:58 PM8/23/10
to grease...@googlegroups.com
It looks like I can reproduce this on my machine by compiling with
'-UNDEBUG' to counter the '-NDEBUG' it throws in there by default in
my environment. I'll see what I can make of it.

-Casey

On Mon, Aug 23, 2010 at 3:51 AM, Jonathan Hartley <tar...@tartley.com> wrote:

Casey Duncan

unread,
Aug 23, 2010, 7:17:17 PM8/23/10
to grease...@googlegroups.com
Ok, duh. The problem is that it should be

PlanarVec2Array_Check(self), not PlanarVec2_Check(self)

And also the fact that assertions are turned off when I run my tests
doesn't help either. Hopefully I can enable it via an environment
variable or something, distutils is too dumb to let me pass in a
command-line argument.

Anyhow, I'll get a new release out with this fixed soon. Thanks very
much for the help!

-Casey

On Mon, Aug 23, 2010 at 3:51 AM, Jonathan Hartley <tar...@tartley.com> wrote:

Jonathan Hartley

unread,
Aug 24, 2010, 5:32:05 AM8/24/10
to grease...@googlegroups.com
Hooray! Glad you got it figured! It's such a worthwhile project that
I'm happy to be even a tiny bit helpful. :-)

Jonathan

Reply all
Reply to author
Forward
0 new messages