[SciPy-User] fit with 3 parameters ok, fit with 4 is going wrong!

Matt Newville newville at cars.uchicago.edu
Sun Feb 9 22:14:07 EST 2014


On Sat, Feb 8, 2014 at 5:01 AM, Robert Kern <robert.kern at gmail.com> wrote:
>
> On Fri, Feb 7, 2014 at 9:42 PM, Matt Newville
> <newville at cars.uchicago.edu> wrote:
> >
> > On Fri, Feb 7, 2014 at 7:22 AM, Robert Kern <robert.kern at gmail.com> wrote:
> >>
> >> On Fri, Feb 7, 2014 at 1:03 PM, Matt Newville
> >> <newville at cars.uchicago.edu> wrote:
> >> >
> >> > On Feb 6, 2014 5:14 PM, "Robert Kern" <robert.kern at gmail.com> wrote:
> >> >>
> >> >> On Thu, Feb 6, 2014 at 9:20 PM, Matt Newville
> >> >> <newville at cars.uchicago.edu> wrote:
> >> >> > Hi David,
> >> >> >
> >> >> >
> >> >> > On Thu, Feb 6, 2014 at 2:20 PM, Daπid <davidmenhur at gmail.com> wrote:
> >> >> >>
> >> >> >> On 6 February 2014 18:55, Matt Newville <newville at cars.uchicago.edu>
> >> >> >> wrote:
> >> >> >>>
> >> >> >>> I'm interested, but slightly confused.   Iminuit / probfit is
> >> >> >>> described
> >> >> >>> as BSD, but depends on (and includes?) Minuit - isn't that GPL?
> >> >> >>
> >> >> >>
> >> >> >> The license says iminuit is MIT, but Minuit is GPLv2. So, the Python
> >> >> >> part,
> >> >> >> that wraps the C code is MIT.
> >> >> >
> >> >> > The way I understand it, code that wraps GPLv2 code is required to
> >> >> > use
> >> >> > GPL,
> >> >> > and so propagate the license to all code using it. That would mean
> >> >> > that
> >> >> > code
> >> >> > that uses Minuit cannot be something other than GPL.   Perhaps I am
> >> >> > not
> >> >> > understanding something.
> >> >>
> >> >> GPLed code can be combined with code under a different license as long
> >> >> as that other license imposes no conditions more restrictive than
> >> >> those in the GPL. The MIT license is one such license. This is all
> >> >> perfectly above board.
> >> >
> >> > Unless I am mistaken (not without precedent), the resulting mixed code
> >> > must
> >> > use the GPL. If library "M" is GPL and package "Mwrapper" calls it,
> >> > "Mwrapper" must be GPL.   This license propagation is the distinguishing
> >> > characteristic of GPL, and what differentiates it from LGPL and BSD/MIT.
> >> > Do
> >> > you disagree?
> >>
> >> Yes. The combined work must be distributed under the GPL license. But
> >> each component can have a non-GPL-but-GPL-compatible license, like the
> >> MIT license. The parts of "Mwrapper" that are not "M" itself do not
> >> need to be GPLed. "Mwrapper+M" is GPLed. "Mwrapper" itself does not
> >> need to be (provided they are licensed compatibly).
> >>
> >
> > The parts of Mwrapper that use M must be GPL.
> >
> >>
> >> This is why I say that the *practical effect* of saying that
> >> "Mwrapper" is BSD-licensed is confusing. Users grab "Mwrapper+M" under
> >> the impression that "Mwrapper"'s license is the only one, when it is
> >> not.
> >>
> >> >> That said, as a practical matter, for a package that mostly just wraps
> >> >> the functionality of the internal GPLed component, licensing that
> >> >> wrapper under the MIT license leads to confusion, as we have seen.
> >> >
> >> > I think this does not lead to confusion, but to a license violation.
> >> > The
> >> > GPL is wordy, but not confusing.  If your code wraps (uses, links to,
> >> > imports, or calls) GPL code, your code must use the GPL.  Not MIT.
> >>
> >> You have misread the GPL. Please consult the FSF's information about
> >> mixing code with GPL-compatible licenses. The propagation applies to
> >> the combined work as a whole, not every single piece of code in the
> >> combined work.
> >
> > Perhaps this is a bit off-topic, but I believe that I have not misread the
> > GPL. I do agree that it does not apply to every single piece of code in the
> > combined work.  But I believe (and, sorry but I am not convinced by you
> > saying otherwise, without strong evidence) it does apply to every piece of
> > code that **uses** the GPL code, including making library calls.
>
> Section 7 of the GPLv3:
>
> """
> You may place additional permissions on material, added by you to a
> covered work, for which you have or can give appropriate copyright
> permission.
> """
>
> Applying the BSD license to the portions of the code that you wrote is
> providing just such additional permissions.

I'm pretty sure that would actually violate the GPL.  This is a bit
off-topic, and can be a politically-charged topic.  Truly, I mean no
ill-will, am not looking for an argument, and would be willing to end
the discussion.   My initial reaction on reading this is that I have
been dealing with this issue for well over a decade, and am really
very certain that I understand these licenses, and that your reading
is dangerously mistaken.  But, I've also been doing science and
software long enough to see my own certainty as a red flag -- being
dead certain is the first sign of being dead wrong.  So, as you
suggest, let's look only to texts from the gnu.org sites.  Evidence
and explanations at wikipedia, stackexchange, and the like are often
in plainer language, and uniformly come to a common conclusion: code
that links to a GPL library is derived work, and is required to use
the GPL.  But, let's call that as hearsay, and re-read the writings
from gnu.org with open minds, looking for clarification.

For example, https://www.gnu.org/licenses/gpl-faq.html#GPLStaticVsDynamic

    Q: Does the GPL have different requirements for statically vs
dynamically linked modules with a covered work?
    A: No. Linking a GPL covered work statically or dynamically with
other modules is making a combined work based
    on the GPL covered work. Thus, the terms and conditions of the GNU
General Public License cover the whole combination.

For myself, that is clear enough to effectively end the discussion:
linking to a GPL library makes the work GPL.  A python script that has
"import pygsl", "import pyfftw" or "import PyQ4t" is lining to one of
those GPL libraries, and so is required to use the GPL.

If that is not yet clear enough, consider why the LGPL exists at all.
>From the preamble of the LGPL
(http://www.gnu.org/licenses/lgpl-2.1.html), describing this very
subject:

    When a program is linked with a library, whether statically or
using a shared library, the combination of the two is legally speaking
    a combined work, a derivative of the original library. The
ordinary General Public License therefore permits such linking only if
the
    entire combination fits its criteria of freedom. The Lesser
General Public License permits more lax criteria for linking other
code
    with the library.

Here, of course, 'fits its criteria of freedom' means 'uses the GPL'.
The point being made here is to explain that the purpose of the LGPL
is to relax the strict requirement of license propagation that does
exist for the GPL.  You can also read the entirety of
http://www.gnu.org/philosophy/why-not-lgpl.html, which explains
clearly that code that links to a GPL library must use the GPL, and
that the purpose of the LGPL is to relax this requirement.

For completeness,  this point is succinctly if tortuously stated in
the GPL itself, GPLv3  section 5c (similar wording exists in GPLv2
section 2c) reads:

    You may convey a work based on the Program, or the modifications
to produce it from the Program, in the form of source
    code under the terms of section 4, provided that you also meet all
of these conditions:

    c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
    License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

The intent seems clear enough to me.  Do you read this differently?
Earlier, you correctly said "The propagation [of GPL] applies to the
combined work as a whole", as this section states rather clearly.  A
python module or script is a "combined work" or "program" here --
copyrightable source code that can be run and distributed.  By
importing a GPL covered module, one is dynamically linking to it, and
the GPL used by the imported library applies to the importing
program/script/module.   To be sure, any code that might also be used
in said script but which does not directly import/link to a GPL
library does not need to be GPLed.  But the calling script (the
equivalent of main() -- the "combined work") most certainly does.

You quoted from Section 7 of the GPL, but I believe you misunderstood
"for which you have or can give appropriate copyright permission".
You (generally speaking)  do not have copyright permission needed to
be able to change the license under which you use the library that you
are linking to.  And the license for linking to that library requires
that your work use the GPL.

This section  is new to GPLv3.    According to
https://www.gnu.org/licenses/quick-guide-gplv3.html, the license
compatibility language was clarified in GPLv3:

    Clarifying License Compatibility

    If you found some code and wanted to incorporate it into a GPLed
project, GPLv2 said that the license on the other
    code was not allowed to have any restrictions that were not
already in GPLv2. As long as that was the case, we said
    the license was GPL-compatible.

    However, some licenses had requirements that weren't really
restrictive, because they were so easy to comply with. For
    example, some licenses say that they don't give you permission to
use certain trademarks. That's not really an additional
    restriction: if that clause wasn't there, you still wouldn't have
permission to use the trademark. We always said those licenses
    were compatible with GPLv2, too.

    Now, GPLv3 explicitly gives everyone permission to use code that
has requirements like this. These new terms should help
    clear up misunderstandings about which licenses are
GPL-compatible, why that is, and what you can do with GPL-compatible
    code.

Again, the sense of "compatible" here is to say what code is allowed
to be used by GPL code, not what license one may choose for derived
work.  It is not granting one the right to use a BSD license for code
that links to a GPL library.

The propagation of the GPL to calling code is the essence of the GPL,
and the distinguishing characteristic between GPL, LGPL and the
BSD/MIT licenses.   Happily, the scipy pages on license compatibility
are clear about *not* including GPL (or even LGPL) code in scipy.

Trying to come back on topic, I still can't figure out what license
Minuit actually uses.  The iminuit package describes it one place as
LGPL, but I don't see that in Minuit itself.

Sorry this was so long and slightly off topic. Really, I am not
looking for an argument, but getting this right (as scipy does) is
important.

-- 
--Matt Newville



More information about the SciPy-User mailing list