Author: mattip <[email protected]>
Branch: numpypy-disable-longdouble
Changeset: r61560:10579024f6bc
Date: 2013-02-14 11:28 +0200
http://bitbucket.org/pypy/pypy/changeset/10579024f6bc/
Log: remove longfloat from types, interp_boxes, adjust more tests
diff --git a/pypy/module/micronumpy/interp_boxes.py
b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -335,7 +335,7 @@
descr__new__, _get_dtype = new_dtype_getter("complex128")
_COMPONENTS_BOX = W_Float64Box
-if long_double_size == 12:
+if 0 and long_double_size == 12:
class W_Float96Box(W_FloatingBox, PrimitiveBox):
descr__new__, _get_dtype = new_dtype_getter("float96")
@@ -347,7 +347,7 @@
W_CLongDoubleBox = W_Complex192Box
-elif long_double_size == 16:
+elif 0 and long_double_size == 16:
class W_Float128Box(W_FloatingBox, PrimitiveBox):
descr__new__, _get_dtype = new_dtype_getter("float128")
W_LongDoubleBox = W_Float128Box
@@ -358,7 +358,7 @@
W_CLongDoubleBox = W_Complex256Box
-else:
+elif 0:
W_LongDoubleBox = W_Float64Box
W_CLongDoubleBox = W_Complex64Box
@@ -526,7 +526,7 @@
__new__ = interp2app(W_Float64Box.descr__new__.im_func),
)
-if long_double_size == 12:
+if 0 and long_double_size == 12:
W_Float96Box.typedef = TypeDef("float96", (W_FloatingBox.typedef),
__module__ = "numpypy",
@@ -540,7 +540,7 @@
imag = GetSetProperty(W_ComplexFloatingBox.descr_get_imag),
)
-elif long_double_size == 16:
+elif 0 and long_double_size == 16:
W_Float128Box.typedef = TypeDef("float128", (W_FloatingBox.typedef),
__module__ = "numpypy",
diff --git a/pypy/module/micronumpy/interp_ufuncs.py
b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -400,7 +400,7 @@
return interp_dtype.get_dtype_cache(space).w_complex64dtype
elif dt2.num == 15:
return interp_dtype.get_dtype_cache(space).w_complex128dtype
- elif dt2.num == 16:
+ elif 0 and dt2.num == 16:
return interp_dtype.get_dtype_cache(space).w_clongdouble
else:
raise OperationError(space.w_TypeError, space.wrap("Unsupported
types"))
diff --git a/pypy/module/micronumpy/test/test_complex.py
b/pypy/module/micronumpy/test/test_complex.py
--- a/pypy/module/micronumpy/test/test_complex.py
+++ b/pypy/module/micronumpy/test/test_complex.py
@@ -496,15 +496,21 @@
def test_basic(self):
from _numpypy import (complex128, complex64, add, array, dtype,
subtract as sub, multiply, divide, negative, abs, floor_divide,
- real, imag, sign, clongfloat)
+ real, imag, sign)
from _numpypy import (equal, not_equal, greater, greater_equal, less,
less_equal, isnan)
+ complex_dtypes = [complex64, complex128]
+ try:
+ from _numpypy import clongfloat
+ complex_dtypes.append(clongfloat)
+ except:
+ pass
assert real(4.0) == 4.0
assert imag(0.0) == 0.0
a = array([complex(3.0, 4.0)])
b = a.real
assert b.dtype == dtype(float)
- for complex_ in complex64, complex128, clongfloat:
+ for complex_ in complex_dtypes:
O = complex(0, 0)
c0 = complex_(complex(2.5, 0))
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -1515,7 +1515,7 @@
NonNativeComplex128 = Complex128
-if interp_boxes.long_double_size == 12:
+if 0 and interp_boxes.long_double_size == 12:
class Float96(BaseType, Float):
_attrs_ = ()
@@ -1545,7 +1545,7 @@
NonNativeComplex192 = Complex192
-elif interp_boxes.long_double_size == 16:
+elif 0 and interp_boxes.long_double_size == 16:
class Float128(BaseType, Float):
_attrs_ = ()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit