ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 13 Dec 2016 18:29:38 -0600Suppress error warnings from Cythonized codehttp://ask.sagemath.org/question/36004/suppress-error-warnings-from-cythonized-code/The following Python code
n = 6.58
c0 = 1.1275
l = c0 - c0^(n+1)/(n+1)
c1 = 0.832857588520877
def f(c):
return real( 1 / sqrt( c - c^(n+1)/(n+1) - l ) )
c = var('c')
integral = numerical_integral( f(c), ( c1, c0 ) )
print(integral)
gives an error message along with a numeric result
Exception KeyError: (3,) in 'sage.gsl.integration.c_ff' ignored
(1.7927361507678317, 1.5185983395728818e-06)
The numeric result matches an evaluation in Mathemtica, so I'd just like to suppress the error message. Since it arises in the Cythonized GSL C library, regular Python error handling with `try/except` or the `warnings` module doesn't appear able to do so.
The error message will go away if I add a small amount like 10<sup>-10</sup> to the lower integration limit, but I'd like to know in general how to handle errors arising in Cythonized code.paulmassonTue, 13 Dec 2016 18:29:38 -0600http://ask.sagemath.org/question/36004/Is is possible to call the GSL vegas monte carlo routine from sage?http://ask.sagemath.org/question/7846/is-is-possible-to-call-the-gsl-vegas-monte-carlo-routine-from-sage/I am trying to perform a monte-carlo integration of a function defined in sage. It is possible to call the vegas monte-carlo routine in GSL library from sage? Or is there a vegas routine in some other package like numpy accessible from sage?ShashankWed, 19 Jan 2011 09:45:40 -0600http://ask.sagemath.org/question/7846/