dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #09290
Re: Patch for pyDolfin function.py
2008/8/21 Johan Hake <hake@xxxxxxxxx>:
> On Thursday 21 August 2008 23:05:57 Evan Lezar wrote:
>> Hi
>>
>> I added a simple warning message to the Function constructor in function.py
>> which is displayed if the constructor is called with 3 arguments and the
>> last one is not an instance of dolfin.Vector or Matrix.
>>
>> I know that a warning is not a necessarily a long-term solution, but it
>> would at least assist new users such as myself in tracking down the source
>> of errors in their code.
>
> Fine that you found out what your problem was!
>
> Your issue again illustrates the limitation Function in pydolfin. We should
> really update at least the docstrings, together with more exstensive
> testings. For example could these lines be expanded:
>
> # Otherwise give all to DOLFIN
> else:
> dolfin.cpp_Function.__init__(self, *((element,) + others))
>
> so that we only send valid arguments to the cpp_Function constructor.
Matching of python objects with C++ signatures the job of SWIG and typemaps,
doing this manually is a dangerous road to begin on...
--
Martin
References