[sage-devel] Re: European H2020 DreamKit proposal around the Sage ecosystem and beyond

2014-12-28 Thread Nicolas M. Thiery
On Tue, Dec 23, 2014 at 05:57:15AM -0800, Bill Hart wrote: I just noticed a spelling error in one of the diagrams (on page 8 of 0). Resources is misspelled ressources. Thanks! Still looking forward much feedback from the community! Note: the proposal file [1] went accidently missing

[sage-devel] python sum question

2014-12-28 Thread Ralf Stephan
Hello, while working on a ticket I encountered different behaviour of python sum in Sage regarding whether the sum (over a symbolic expression applied to a range) was given on the command line vs. in Sage-lib (python file) within a function definition. Specifically, applying this one-line patch

[sage-devel] Re: python sum question

2014-12-28 Thread Volker Braun
range() is a list of integers. In a Python file, (-1)**k and factorial(k) are Python ints, so the quotient is C division. On the Sage command line, -1 is preparsed to a Sage integer. So (-1)**k is a Sage integer and factorial(k) is a Python int, and coercion computes the quotient in QQ. On

Re: [sage-devel] Re: Place for internal documentation of a class

2014-12-28 Thread mmarco
Is it possible to make sphinx generate html code that is hidden with a toggle button when it encounter a Technical details:: section? That could be a good compromise solution. -- You received this message because you are subscribed to the Google Groups sage-devel group. To unsubscribe from

[sage-devel] Re: where is the code for __eq__ (of ring elements)

2014-12-28 Thread Jean-Pierre Flori
Nathann, if you're still tens of kilometers away from the nearest pub, you might want to turn all the info here into proper documentation? On Sunday, December 28, 2014 1:45:26 AM UTC+1, Nils Bruin wrote: On Saturday, December 27, 2014 3:13:37 PM UTC-8, Simon King wrote: That's exactly what I

[sage-devel] Re: python sum question

2014-12-28 Thread Ralf Stephan
On Sunday, December 28, 2014 11:42:57 AM UTC+1, Volker Braun wrote: In a Python file, (-1)**k and factorial(k) are Python ints, so the quotient is C division. That explains the wrong result and helps me with the ticket, many thanks! Presumably, not importing works because there is pyc

[sage-devel] Re: python sum question

2014-12-28 Thread Volker Braun
Sympy implements its own integer type with math division: sage: import sympy sage: type(sympy.factorial(int(12))) class 'sympy.core.numbers.Integer' sage: int(1) / sympy.factorial(int(12)) 1/479001600 On Sunday, December 28, 2014 2:58:55 PM UTC+1, Ralf Stephan wrote: On Sunday, December 28,

Re: [sage-devel] Re: Cython: passing a Python data structure as a void pointer

2014-12-28 Thread Jeroen Demeyer
On 2014-12-27 13:35, Volker Braun wrote: IMHO you should strive to never use direct CPython API in Cython programs. Almost all uses in Sage are just vestiges of older times where Cython wasn't able to do something. But Cython is much more capable nowadays, use it to write clear and expressive

Re: [sage-devel] Re: Place for internal documentation of a class

2014-12-28 Thread Nathann Cohen
Is it possible to make sphinx generate html code that is hidden with a toggle button when it encounter a Technical details:: section? That could be a good compromise solution. Funny that you ask. This is what I wrote to Sphinx-devel 10 days ago:

[sage-devel] Re: where is the code for __eq__ (of ring elements)

2014-12-28 Thread Nathann Cohen
Nathann, if you're still tens of kilometers away from the nearest pub, you might want to turn all the info here into proper documentation? Have you considered writing it yourself ? I am already a state employee from Monday to Friday, and with combinatorial designs and the developer's manual I

[sage-devel] Re: Cython: passing a Python data structure as a void pointer

2014-12-28 Thread Simon King
Hi! On 2014-12-28, Jeroen Demeyer jdeme...@cage.ugent.be wrote: The idea of Cython is really that you shouldn't need to know the C API to write good Cython code. If Cython knows the types of the objects, it will generate efficient code. Then I wonder what to do at #17435. Each term of an

[sage-devel] Re: Cython: passing a Python data structure as a void pointer

2014-12-28 Thread Nils Bruin
On Sunday, December 28, 2014 10:44:51 AM UTC-8, Simon King wrote: Hi! On 2014-12-28, Jeroen Demeyer jdem...@cage.ugent.be javascript: wrote: The idea of Cython is really that you shouldn't need to know the C API to write good Cython code. If Cython knows the types of the objects, it

[sage-devel] Re: Cython: passing a Python data structure as a void pointer

2014-12-28 Thread Simon King
Hi Nils, On 2014-12-28, Nils Bruin nbr...@sfu.ca wrote: That's not immediately clear. An array of pointers is a little more compact than a linked list, and allocating an array at once should be a little more efficient than allocating multiple nodes of a linked list. An array of fixed size

[sage-devel] Re: Cython: passing a Python data structure as a void pointer

2014-12-28 Thread Volker Braun
When starting from scratch I would go with the first option. Cleaner code, easier to write and debug, and if the coefficient is already a Python object then the overhead is already bounded by a factor of 2. If that is not fast enough then I would implement the polynomials as C++ templates and

Re: [sage-devel] Mathematica interface

2014-12-28 Thread Dr. David Kirkby (Kirkby Microwave Ltd)
On 23 December 2014 at 00:55, Robert Jacobson rljacob...@gmail.com wrote: On Sunday, 21 December 2014 23:56:24 UTC-5, Dr. David Kirkby (Kirkby Microwave Ltd) wrote: There is an open source command line interface to Mathematica. IIRC it uses curses so one can recall previous input, edit it

[sage-devel] Re: Cython: passing a Python data structure as a void pointer

2014-12-28 Thread Simon King
Hi Volker, On 2014-12-28, Volker Braun vbraun.n...@gmail.com wrote: When starting from scratch I would go with the first option. Cleaner code, easier to write and debug, and if the coefficient is already a Python object then the overhead is already bounded by a factor of 2. In fact, a year