bvp

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

bvp

Nils Wagner-2
Hi all,

I installed bvp using the mercurial repository

hg clone static-http://www.iki.fi/pav/hg/bvp.hg bvp.hg

The second example doesn't work for me. Here is the output

/usr/bin/python -i ex2.py
1.0
unexpected array size: new_size=1, got array with
arr_size=0
Traceback (most recent call last):
   File "ex2.py", line 61, in ?
     coarsen_initial_guess_mesh=True)
   File "/usr/lib/python2.4/site-packages/bvp/colnew.py",
line 522, in solve
     vectorized_guess)
_colnew.error: failed in converting 8th argument `fixpnt'
of _colnew.colnew to C/Fortran array

Cheers,
           Nils

I am using

>>> numpy.__version__
'1.0.5.dev5024'
>>> scipy.__version__
'0.7.0.dev4125'
_______________________________________________
SciPy-user mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: bvp

Pauli Virtanen-3
Hi Nils,

Fri, 11 Apr 2008 20:03:24 +0200, Nils Wagner wrote:

> I installed bvp using the mercurial repository
>
> hg clone static-http://www.iki.fi/pav/hg/bvp.hg bvp.hg
>
> The second example doesn't work for me. Here is the output
>
> /usr/bin/python -i ex2.py
> 1.0
> unexpected array size: new_size=1, got array with arr_size=0
> Traceback (most recent call last):
>    File "ex2.py", line 61, in ?
>      coarsen_initial_guess_mesh=True)
>    File "/usr/lib/python2.4/site-packages/bvp/colnew.py",
> line 522, in solve
>      vectorized_guess)
> _colnew.error: failed in converting 8th argument `fixpnt' of
> _colnew.colnew to C/Fortran array

Should also be fixed in 0.2.2 and current bvp.hg. (And yep, it was also
caught by automated tests.)

The cause is that apperently something changed in f2py between numpy
1.0.4 and 1.0.5: in colnew.pyf I have

        integer, dimension(11), intent(in) :: ipar
        double precision, dimension(ipar[10]), intent(in) :: fixpnt

However, f2py bugs out with the "failed in converting" if ipar[10] == 0
and fixpnt.size == 0, which I don't think it did in 1.0.3 or 1.0.4. If
fixed this by making fixpnt a shape = (1,) array even for ipar[10] == 0,
and it appears to work on numpy 1.0.2, 1.0.4, 1.0.5, even though I don't
know whether it should.

--
Pauli Virtanen

_______________________________________________
SciPy-user mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: bvp

Agile Aspect
Hi - I tried version 0.2.2 using Python 2.4.2 from the command
line and it works great!

I have a related question which may be off topic.

When I run this test script from inside Eclipse using Python/Qt4
(the same C based Python I used to test bvp from the command
line) it generates the following error

                Traceback (most recent call last):
                 File
"/home/ken/projects/workspace/cpp/bvp/src/test/ex1.py", line 24, in ?
                 solution = bvp.colnew.solve(
                AttributeError: 'module' object has no attribute 'colnew'

Any ideas as to what might be causing this problem?

Is this permission problem? Would it be possible to use reflection
to get around it?

I've been using Eclipse/Python/Q4t for a couple of years and this
is the first time I've had this problem.

Any help would be greatly appreciated.

-- Ken

Pauli Virtanen wrote:

> Hi Nils,
>
> Fri, 11 Apr 2008 20:03:24 +0200, Nils Wagner wrote:
>
>  
>> I installed bvp using the mercurial repository
>>
>> hg clone static-http://www.iki.fi/pav/hg/bvp.hg bvp.hg
>>
>> The second example doesn't work for me. Here is the output
>>
>> /usr/bin/python -i ex2.py
>> 1.0
>> unexpected array size: new_size=1, got array with arr_size=0
>> Traceback (most recent call last):
>>    File "ex2.py", line 61, in ?
>>      coarsen_initial_guess_mesh=True)
>>    File "/usr/lib/python2.4/site-packages/bvp/colnew.py",
>> line 522, in solve
>>      vectorized_guess)
>> _colnew.error: failed in converting 8th argument `fixpnt' of
>> _colnew.colnew to C/Fortran array
>>    
>
> Should also be fixed in 0.2.2 and current bvp.hg. (And yep, it was also
> caught by automated tests.)
>
> The cause is that apperently something changed in f2py between numpy
> 1.0.4 and 1.0.5: in colnew.pyf I have
>
> integer, dimension(11), intent(in) :: ipar
> double precision, dimension(ipar[10]), intent(in) :: fixpnt
>
> However, f2py bugs out with the "failed in converting" if ipar[10] == 0
> and fixpnt.size == 0, which I don't think it did in 1.0.3 or 1.0.4. If
> fixed this by making fixpnt a shape = (1,) array even for ipar[10] == 0,
> and it appears to work on numpy 1.0.2, 1.0.4, 1.0.5, even though I don't
> know whether it should.
>
>  
--
Article. VI. Clause 3 of the constitution of the United States states:

"The Senators and Representatives before mentioned, and the Members of
the several State Legislatures, and all executive and judicial Officers,
both of the United States and of the several States, shall be bound by
Oath or Affirmation, to support this Constitution; but no religious Test
shall ever be required as a Qualification to any Office or public Trust
under the United States."


_______________________________________________
SciPy-user mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: bvp

Pauli Virtanen-3
Hi,
Mon, 14 Apr 2008 22:15:01 -0700, Agile Aspect wrote:

> Hi - I tried version 0.2.2 using Python 2.4.2 from the command line and
> it works great!
>
> I have a related question which may be off topic.
>
> When I run this test script from inside Eclipse using Python/Qt4 (the
> same C based Python I used to test bvp from the command line) it
> generates the following error
>
>                 Traceback (most recent call last):
>                  File
> "/home/ken/projects/workspace/cpp/bvp/src/test/ex1.py", line 24, in ?
>                  solution = bvp.colnew.solve(
>                 AttributeError: 'module' object has no attribute
>                 'colnew'
>
> Any ideas as to what might be causing this problem?
>
> Is this permission problem? Would it be possible to use reflection to
> get around it?

This is strange. Does

        import bvp.colnew

work inside eclipse? Are you running Eclipse in the bvp source directory
(will not work, because the bvp directory in the source package doesn't
contain the compiled extensions). Is your Python path correctly set in
Eclipse?

--
Pauli Virtanen

_______________________________________________
SciPy-user mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|

Re: bvp

lorenzo bolla
In reply to this post by Agile Aspect
Could this simply be because you are running the example file from bvp install directory?

By the way, I translated a couple of examples from the MATLAB's bvp4c tutorial to python: you can find them here: http://lbolla.wordpress.com/2008/04/14/bvp/

L.


On Tue, Apr 15, 2008 at 7:15 AM, Agile Aspect <[hidden email]> wrote:
Hi - I tried version 0.2.2 using Python 2.4.2 from the command
line and it works great!

I have a related question which may be off topic.

When I run this test script from inside Eclipse using Python/Qt4
(the same C based Python I used to test bvp from the command
line) it generates the following error

               Traceback (most recent call last):
                File
"/home/ken/projects/workspace/cpp/bvp/src/test/ex1.py", line 24, in ?
                solution = bvp.colnew.solve(
               AttributeError: 'module' object has no attribute 'colnew'

Any ideas as to what might be causing this problem?

Is this permission problem? Would it be possible to use reflection
to get around it?

I've been using Eclipse/Python/Q4t for a couple of years and this
is the first time I've had this problem.

Any help would be greatly appreciated.

-- Ken

Pauli Virtanen wrote:
> Hi Nils,
>
> Fri, 11 Apr 2008 20:03:24 +0200, Nils Wagner wrote:
>
>
>> I installed bvp using the mercurial repository
>>
>> hg clone static-http://www.iki.fi/pav/hg/bvp.hg bvp.hg
>>
>> The second example doesn't work for me. Here is the output
>>
>> /usr/bin/python -i ex2.py
>> 1.0
>> unexpected array size: new_size=1, got array with arr_size=0
>> Traceback (most recent call last):
>>    File "ex2.py", line 61, in ?
>>      coarsen_initial_guess_mesh=True)
>>    File "/usr/lib/python2.4/site-packages/bvp/colnew.py",
>> line 522, in solve
>>      vectorized_guess)
>> _colnew.error: failed in converting 8th argument `fixpnt' of
>> _colnew.colnew to C/Fortran array
>>
>
> Should also be fixed in 0.2.2 and current bvp.hg. (And yep, it was also
> caught by automated tests.)
>
> The cause is that apperently something changed in f2py between numpy
> 1.0.4 and 1.0.5: in colnew.pyf I have
>
>       integer, dimension(11), intent(in) :: ipar
>       double precision, dimension(ipar[10]), intent(in) :: fixpnt
>
> However, f2py bugs out with the "failed in converting" if ipar[10] == 0
> and fixpnt.size == 0, which I don't think it did in 1.0.3 or 1.0.4. If
> fixed this by making fixpnt a shape = (1,) array even for ipar[10] == 0,
> and it appears to work on numpy 1.0.2, 1.0.4, 1.0.5, even though I don't
> know whether it should.
>
>
--
Article. VI. Clause 3 of the constitution of the United States states:

"The Senators and Representatives before mentioned, and the Members of
the several State Legislatures, and all executive and judicial Officers,
both of the United States and of the several States, shall be bound by
Oath or Affirmation, to support this Constitution; but no religious Test
shall ever be required as a Qualification to any Office or public Trust
under the United States."


_______________________________________________
SciPy-user mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/scipy-user



--
Lorenzo Bolla
[hidden email]
http://lorenzobolla.emurse.com/
_______________________________________________
SciPy-user mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/scipy-user