Bug 472087
Summary: | Can't import scipy.stsci.image | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Sergio Pascual <sergio.pasra> | ||||||
Component: | scipy | Assignee: | Jef Spaleta <jspaleta> | ||||||
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 10 | CC: | jspaleta | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | 0.7.0-2.fc10 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2009-05-12 04:06:10 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Sergio Pascual
2008-11-18 17:08:40 UTC
that looks like an upstream relevant bug. If you can get the import calls sorted out and send a patch in to me I'm incorporate it and send it upstream if its still necessary in scipy trunk. -jef Created attachment 324072 [details]
Stsci import patch
Well, I have just started learning python and I don't quite understand the magic behind import.
Anyway, I have found two ways of fixing the problem, either use full paths in the imports:
import scipy.stsci.convolve as convolve
or use relative imports:
from .. import convolve
this last one only works in python 2.5 though
I have found another problem, a sentence with a.type(), where a is a numpy array. I have changed it by a.dtype
great I'll take a look at that patch and poke upstream about what they think of it. -jef This bug isn't completely fixed in scipy-0.7.0-0.1.b1.fc10 This code fails: import scipy.stsci.image as im import numpy a = numpy.zeros((4,4)) im.translate(a, 1, 1) With this traceback: /usr/lib64/python2.5/site-packages/scipy/stsci/image/_image.pyc in translate(a, sdx, sdy, output, mode, cval) 51 b = np.rot90(a, rotation) 52 c = _correlate.Shift2d(b, int(dx), int(dy), ---> 53 mode=convolve.pix_modes[mode]) 54 d = _translate(c, dx % 1, dy % 1, output, mode, cval) 55 if output is not None: NameError: global name 'convolve' is not defined And if you fix the previous error, you get the following: import scipy.stsci.image as im import numpy a = numpy.zeros((4,4)) im.translate(a, 1, 1) /usr/lib64/python2.5/site-packages/scipy/stsci/image/_image.py in translate(a, sdx, sdy, output, mode, cval) 54 d = _translate(c, dx % 1, dy % 1, output, mode, cval) 55 if output is not None: 56 output._copyFrom(np.rot90(output, -rotation%4)) 57 else: ---> 58 return np.rot90(d, -rotation % 4).astype(a.type()) AttributeError: 'numpy.ndarray' object has no attribute 'type' Created attachment 333340 [details]
Fixes problems with translate function in scipy.stsci.image
0.7 was released a couple of weeks ago. If I build packages of that release will you test them for me. I hate applying a patch if I can move from a beta release to the final release and get it fixed. -jef Yeah, I will test the packages Freshly built 0.7 release rpms can be found from the appropriate architecture links here: http://koji.fedoraproject.org/koji/taskinfo?taskID=1205853 Please download and test these packages. If the scipy.stsci.image implementation still needs to be patched, let me know and I can try to drive that patch upstream as well. -jef I've tested the package and it's still broken in the same place. The patch will be probably valid patched scipy binarys now available http://koji.fedoraproject.org/koji/taskinfo?taskID=1212116 Please test these and if they pass your initial testing I'll push these to updates-testing repository. -jef Seems to work, please push the update scipy-0.7.0-2.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/scipy-0.7.0-2.fc10 scipy-0.7.0-2.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update scipy'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-2251 scipy-0.7.0-2.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report. |