New Python solve interface badly broken

Bug #888282 reported by Garth Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Critical
Anders Logg

Bug Description

New solve interface for variational problem has a serious bug. The code

    solve(a == L, Uh, bcs=bcs)

does not work. Culprit looks like

    # Extract boundary conditions
    if len(args) == 2:
        bcs = []
    else:
        bcs = _extract_bcs(args[2])

in solving.py.

Changed in dolfin:
importance: Undecided → Critical
assignee: nobody → Anders Logg (logg)
milestone: none → 1.0-rc1
Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 888282] [NEW] New Python solve interface badly broken

Looks like confusion about whether bcs should be a keyword argument or
not. Should we support both this

  solve(a == L, Uh, bcs=bcs)

and this

  solve(a == L, Uh, bcs)

?

--
Anders

On Wed, Nov 09, 2011 at 08:52:56PM -0000, Launchpad Bug Tracker wrote:
> Garth Wells (garth-wells) has assigned this bug to you for DOLFIN:
>
> New solve interface for variational problem has a serious bug. The code
>
> solve(a == L, Uh, bcs=bcs)
>
> does not work. Culprit looks like
>
> # Extract boundary conditions
> if len(args) == 2:
> bcs = []
> else:
> bcs = _extract_bcs(args[2])
>
> in solving.py.
>
> ** Affects: dolfin
> Importance: Critical
> Assignee: Anders Logg (logg)
> Status: New

Revision history for this message
Johan Hake (johan-hake) wrote :

On Wednesday November 9 2011 13:10:27 Anders Logg wrote:
> Looks like confusion about whether bcs should be a keyword argument or
> not. Should we support both this
>
> solve(a == L, Uh, bcs=bcs)
>
> and this
>
> solve(a == L, Uh, bcs)

I think only one of them. If one tries the other one it should raise an error.
I would prefer to go with the last option.

Johan

> ?
>
> --
> Anders
>
> On Wed, Nov 09, 2011 at 08:52:56PM -0000, Launchpad Bug Tracker wrote:
> > Garth Wells (garth-wells) has assigned this bug to you for DOLFIN:
> >
> > New solve interface for variational problem has a serious bug. The code
> >
> > solve(a == L, Uh, bcs=bcs)
> >
> > does not work. Culprit looks like
> >
> > # Extract boundary conditions
> >
> > if len(args) == 2:
> > bcs = []
> >
> > else:
> > bcs = _extract_bcs(args[2])
> >
> > in solving.py.
> >
> > ** Affects: dolfin
> >
> > Importance: Critical
> > Assignee: Anders Logg (logg)
> >
> > Status: New

Revision history for this message
Garth Wells (garth-wells) wrote :

On 9 November 2011 21:10, Anders Logg <email address hidden> wrote:
> Looks like confusion about whether bcs should be a keyword argument or
> not. Should we support both this
>
>  solve(a == L, Uh, bcs=bcs)
>

The docstring says that the above works, but it doesn't

Garth

> and this
>
>  solve(a == L, Uh, bcs)
>
> ?
>
> --
> Anders
>
>
> On Wed, Nov 09, 2011 at 08:52:56PM -0000, Launchpad Bug Tracker wrote:
>> Garth Wells (garth-wells) has assigned this bug to you for DOLFIN:
>>
>> New solve interface for variational problem has a serious bug. The code
>>
>>     solve(a == L, Uh, bcs=bcs)
>>
>> does not work. Culprit looks like
>>
>>     # Extract boundary conditions
>>     if len(args) == 2:
>>         bcs = []
>>     else:
>>         bcs = _extract_bcs(args[2])
>>
>> in solving.py.
>>
>> ** Affects: dolfin
>>      Importance: Critical
>>      Assignee: Anders Logg (logg)
>>          Status: New
>
> --
> You received this bug notification because you are a member of DOLFIN
> Core Team, which is subscribed to DOLFIN.
> https://bugs.launchpad.net/bugs/888282
>
> Title:
>  New Python solve interface badly broken
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dolfin/+bug/888282/+subscriptions
>

Revision history for this message
Anders Logg (logg) wrote :

On Wed, Nov 09, 2011 at 09:25:15PM -0000, Garth Wells wrote:
> On 9 November 2011 21:10, Anders Logg <email address hidden> wrote:
> > Looks like confusion about whether bcs should be a keyword argument or
> > not. Should we support both this
> >
> >  solve(a == L, Uh, bcs=bcs)
> >
>
> The docstring says that the above works, but it doesn't

I know, but the question is which one should we use?

I looked now and the book claims that both work so then we need to
stick to that. I'll fix it as soon as I've merged my stuff into 1.0.

--
Anders

> Garth
>
> > and this
> >
> >  solve(a == L, Uh, bcs)
> >
> > ?
> >
> >
> >
> > On Wed, Nov 09, 2011 at 08:52:56PM -0000, Launchpad Bug Tracker wrote:
> >> Garth Wells (garth-wells) has assigned this bug to you for DOLFIN:
> >>
> >> New solve interface for variational problem has a serious bug. The code
> >>
> >>     solve(a == L, Uh, bcs=bcs)
> >>
> >> does not work. Culprit looks like
> >>
> >>     # Extract boundary conditions
> >>     if len(args) == 2:
> >>         bcs = []
> >>     else:
> >>         bcs = _extract_bcs(args[2])
> >>
> >> in solving.py.
> >>
> >> ** Affects: dolfin
> >>      Importance: Critical
> >>      Assignee: Anders Logg (logg)
> >>          Status: New
> >
> >
> > Title:
> >  New Python solve interface badly broken
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/dolfin/+bug/888282/+subscriptions
> >
>

Changed in dolfin:
status: New → Confirmed
Anders Logg (logg)
Changed in dolfin:
status: Confirmed → Fix Committed
Anders Logg (logg)
Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.