Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scipy.weave does not work well with big-endian numpy arrays (Trac #1153) #1680

Closed
Tracked by #7
scipy-gitbot opened this issue Apr 25, 2013 · 5 comments
Closed
Tracked by #7
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac

Comments

@scipy-gitbot
Copy link

Original ticket http://projects.scipy.org/scipy/ticket/1153 on 2010-04-13 by trac user trobitaille, assigned to unknown.

The following code:

import numpy as np
from scipy.weave import converters
import scipy.weave as weave

nx = 10
x = np.logspace(-5, 4, nx).astype('>f4')
y = np.logspace(-5, 4, nx).astype('<f4')

code = """
       for (int i=0; i<nx-1; ++i) {
          printf("%11.3e %11.3e \\n",x(i), y(i));
       }
       return_val = 0;
       """

weave.inline(code, ['x', 'y', 'nx'], type_converters=converters.blitz)

produces the following output:

 -5.603e-12   1.000e-05 
  1.188e-24   1.000e-04 
  4.534e+28   1.000e-03 
  2.072e-32   1.000e-02 
 -4.295e+08   1.000e-01 
  4.601e-41   1.000e+00 
  1.157e-41   1.000e+01 
  7.184e-41   1.000e+02 
  4.386e-41   1.000e+03 

This suggests that big-endian numpy arrays are not correctly converted when passed to the C code in weave.

@scipy-gitbot
Copy link
Author

Milestone changed to Unscheduled by @rgommers on 2011-06-13

@scipy-gitbot
Copy link
Author

@sturlamolden wrote on 2012-07-30

Endianness is not converted at all, which is correct or incorrect depending on your point of view. I think the ticket is invalid.

@andreas-h
Copy link
Contributor

if valid, this ticket should be transferred to the weave project. is this possible, or do we have to open a new ticket in weave project and reference this one from there?

@rgommers
Copy link
Member

rgommers commented Jun 1, 2014

We should transfer all of the weave tickets via the Github API. This can probably re-use code that was written for the Trac --> Github move. It's not very high on my todo list, so if you want to give it a shot please do.

@person142
Copy link
Member

Closing since weave is no longer a part of SciPy. This issue is now tracked at scipy/weave#7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac
Projects
None yet
Development

No branches or pull requests

4 participants