Grasshopper

algorithmic modeling for Rhino

Hi guys

I got a problem here and i can't seem to find my way around it:

I have installed numpy and scipy ( following the instructions on the site http://www.enthought.com/repo/.iron/) and everything works well, except...i am not able to access some modules in scipy (for example the sparse or qhull).

Are they indeed not accessible or something did go wrong in my installation?
Any suggestion on how i could make it work is so very welcomed...

thanks

dana

Views: 1002

Replies to This Discussion

Hi Dana

I'm no expert with Scipy but very willing to see if I can help. Could you explain a little more your setup? And maybe provide a sample that you would like to use?

Thanks,

- Giulio
________________
giulio@mcneel.com

Hi Giulio

On a more general level, i am working on a topology optimisation component. I have managed to make a basic optimisation code work but it proved to be extremely slow.

I would like to try and improve the speed by vectorizing the loops and the scipy.sparse comes in handy here. But when i try to import it:

pcks = "C:\\Program Files (x86)\\IronPython 2.7\\Lib\\site-packages\\"
dlls = "C:\\Program Files (x86)\\IronPython 2.7\\DLLs\\"

import sys
if not pcks in sys.path:
sys.path.append(pcks)
if not dlls in sys.path:
sys.path.append(dlls)

import clr
clr.AddReference("mtrand")

import numpy.linalg
import math
import scipy.sparse
import rhinoscriptsyntax as rs

 

i get: 

Runtime error (ImportException): cannot import sparse from scipy

 

if i try to import scipy and not directly scipy.sparse i get no error, but also access only to what seems to me, the same functions as numpy;

and when i try to use scipy.sparse :

Runtime error (MissingMemberException): 'module' object has no attribute 'sparse'

i deleted the packages and reinstalled - it did not do any changes  

hope this give a more clear image-

thank you very much

dana

Hi again Dana

I think this is specified in the lower part of the documentation PDF on Enthought SciPy IronPython page:

It seems sparse is not in the list. There are also some other paragraphs maybe worth a look. I hope this is of some help, even though it might not be what you hoped to see in that documentation,

- Giulio
_________________
giulio@mcneel.com

Hi Giulio,

thank you very much - I didn't see this disclaimer. I'll see if I can work my way around it with another solution, but thanks for the help!

best,

Dana

Hi Giulio

I am writing you again because i am still keen on getting scipy.sparse to work in grasshopper.

I have come across ironclad (http://code.google.com/p/ironclad/) that should allow ironpython to use python libraries. Do you have any experiences that might hint whether that could work? and without extraordinary tricks?  Or does it seem rather unreliable ..and I'd be better off switching my coding to C#?

The reason I'm asking is that I tried to install it, but already this offers many headaches, and since it doesn't seem it was updated since 2009 - as well as reporting several incompatibilities - I'd be happy with an indication before I throw my self at it ;)

thanks alot 

Dana

 

The package is not available. If the people at Enthought did not make it available, it will be even more difficult for you as an end user to write that code. You might actually need to change the scipy Fortran or C code so that it compiles or has a workable interface. The backend, from IronPython and Rhino, is not the issue here.

Thanks,

- Giulio
________________
giulio@mcneel.com

EDIT: you could try asking Enthought if they have plans to add that feature.

Thank you very much 

dana

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service