[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a current state of python bindings
Hi Mads,
yes, I know about the bindings from elefant, but they seem to be just
a direct translation of C commands to Python, but petsc4py seem to be
more pythonic. I know that there is no documentation to them, but
reading the sources (there are a lot of docstrings) was enough for me.
If you want to look at an example:
http://grainmodel.googlecode.com/svn/trunk/femlib/
look into the "__init__.py", where I set up paths for petsc4py, and
then into "fem.py", where I import petsc4py and construct matrices and
solve them.
But I just wanted to check what people at this mailinglist use.
Experimenting with petsc in python is just fun.
And as to the installation - there are many options to the petsc
package, so it's difficult (almost impossible) to create one (binary)
package for all, on the other hand, when developing my program, I want
petsc to just work (I can play with the options later). I use Debian,
thus I just want to "apt-get install petsc-dev" to have a functioning
petsc installation and then "apt-get install python-petsc" to have
functioning python bindings. So my contribution to this is to create
the python-petsc Debian package and get it into Debian.
Ondrej
On 4/26/07, Mads Fredrik Skoge Hoel <mfhoel@xxxxxxxxxx> wrote:
Hi Ondrej,
I tried out petsc4py, i could not find any documentation. I used alot of
time just trying to get it to work. And without documentation, i tried to
guess, and finally managed to construct a Mat object. It seems that
petsc4py is currently in an experimental version.
You might also want to have a look at PyPetsc:
https://elefant.developer.nicta.com.au/documentation/userguide/PyPetscManual.pdf
and
https://elefant.developer.nicta.com.au/developer/designdocs/PyPetscDesignRef.pdf
I have not tried the PyPetsc, but at least there is documentation.
Regards,
Mads
>
>
> On Thu, 26 Apr 2007, Ondrej Certik wrote:
>
>> Hi,
>>
>> I am using PETSc from Python. I read the post:
>>
>> http://www-unix.mcs.anl.gov/web-mail-archive/lists/petsc-users/2006/08/msg00090.html
>>
>> I am currently using the petsc4py, but unfortunately, they don't seem
>> to have uptodate webpage. The most recent version, that works with
>> petsc 2.3.2 can be found here:
>>
>> http://cheeseshop.python.org/pypi/petsc4py/0.7.2
>>
>> However, there are some bindings inside the petsc tarball, but I
>> didn't find any documentation for them - are they deprecated?
>
> Yes.
>>
>> Also, I would like to create a debian package "python-petsc" with
>> python bindings to petsc (and get it to debian main distribution), so
>> I wanted to check with you, what the most advanced python bindigs
>> actually are (and which I should package).
>
> At this time we are recommending petsc4py.
>
> Barry
>
>>
>> Thanks,
>> Ondrej
>>
>>
>
>