Unexpected deprecation warning

Issue #89 resolved
David Lucas repo owner created an issue

When running these statements :

        sage: F = GF(11)
        sage: n, k = 10 , 5
        sage: C = GeneralizedReedSolomonCode(F.list()[:n], k)
        sage: E = EncoderGRSEvaluationPolynomial(C)
        sage: p = x^2 + 3*x + 10
        sage: E.encode(p)

I receive that for the last line :

DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...) See http://trac.sagemath.org/5930 for details.

Must be checked.

Comments (8)

  1. Johan Rosenkilde

    I think it's because x is a symbolic expression in the above; you didn't introduce PolynomialRing(F,'x').

  2. Johan Rosenkilde

    Thus in the encoder when it calls p(alpha), this is application of alpha to a non-specified variable in a symbolic expression.

  3. Daniel Augot

    What do you mean in your second comment ? Did you mean an application of p instead of an application alpha ?

  4. Johan Rosenkilde

    When p(alpha) is executed then alpha should replace some variable in p. The intention of the code is that it replaces x. But since p is a SymbolicExpression, which could contain any number of variables with no canonical ordering, Sage doesn't really know which variable to replace. That's the reason for the deprecation warning (since early versions of Sage would consider x a "special" variable which was to be replaced whenever it was left unspecified).

  5. Johan Rosenkilde
    • changed status to open

    I don't like the way you resolved this. In my opinion, it is good that the user is warned that he didn't supply a polynomial but a SymbolicExpression. The "fix" should be in the example you provided at the top, where F[x] should be declared.

  6. David Lucas reporter

    Indeed, if we use :

        sage: F = GF(11)
        sage: n, k = 10 , 5
        sage: C = GeneralizedReedSolomonCode(F.list()[:n], k)
        sage: E = EncoderGRSEvaluationPolynomial(C)
        sage: K.<x> = F[]
        sage: p = x^2 + 3*x + 10
        sage: E.encode(p)
    

    instead, it works just fine. I remove the change.

  7. Log in to comment