[sage-devel] sage foundation ???

2018-09-21 Thread Frédéric Chapoton
Hello,

Apparently, people can "donate to the SAGE foundation" using this link : 
https://www.washington.edu/giving/make-a-gift/?page=make&Code=MATSAG

which is advertised here : http://www.sagemath.org/development-ack.html

Who is in charge ? How much money is collected (I would guess almost 
nothing) ? How does this benefit to sage ?

See also our wiki page https://wiki.sagemath.org/Foundation

Could please people in charge of that foundation update the wiki page ?

Frederic

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Deprecate and remove/relocate explain_pickle module?

2018-09-21 Thread Erik Bray
There is a cool module in sage called sage.misc.explain_pickle, which
is useful for helping to understand and debug how non-trivial objects
in Sage are pickled and unpickled.

However, it's a big, fairly complicated module which carries quite a
bit of technical debt with it, and relatively little of it is specific
to Sage (the few bits that are could be added on as a wrapper).  It
could in theory be useful outside of Sage as well.  Furthermore, it's
not actually *used* by anything in Sage; it's a debugging tool.  And
probably one that's not used as much anymore since (I believe) a lot
of the deepest pickle-related issues in Sage have been worked out?  I
could be wrong about that though--maybe it's used more than I know.

I ask about it because in the Python 3 of Sage it's even of less
value.  Although it could be made to work on Python 3, it only
supports the "version 2" pickle protocol from Python 2.  Since Python
3.4 we're now up to protocol version 4, and there's a protocol version
5 in the works [1].

For this reason I think it should be deprecated from Sage (or at least
importing it from sage.misc).  If someone wants to update it to
support new pickle protocol versions (I don't), it would be worth
putting in a new repository where people can still contribute to it.
If not, I think it should just be sunsetted and sent off with the
praise it deserves.

E


[1] https://www.python.org/dev/peps/pep-0574/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] sage foundation ???

2018-09-21 Thread William Stein
On Fri, Sep 21, 2018, 1:07 AM Frédéric Chapoton 
wrote:

> Hello,
>
> Apparently, people can "donate to the SAGE foundation" using this link :
> https://www.washington.edu/giving/make-a-gift/?page=make&Code=MATSAG
>
> which is advertised here : http://www.sagemath.org/development-ack.html
>
> Who is in charge ? How much money is collected (I would guess almost
> nothing) ? How does this benefit to sage ?
>
> See also our wiki page https://wiki.sagemath.org/Foundation
>
> Could please people in charge of that foundation update the wiki page ?
>


Sure but before I do that, are there any other questions people can think
of?


> Frederic
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] sage foundation ???

2018-09-21 Thread Dima Pasechnik
On Fri, Sep 21, 2018 at 11:42 AM William Stein  wrote:
>
>
>
> On Fri, Sep 21, 2018, 1:07 AM Frédéric Chapoton  wrote:
>>
>> Hello,
>>
>> Apparently, people can "donate to the SAGE foundation" using this link : 
>> https://www.washington.edu/giving/make-a-gift/?page=make&Code=MATSAG
>>
>> which is advertised here : http://www.sagemath.org/development-ack.html
>>
>> Who is in charge ? How much money is collected (I would guess almost 
>> nothing) ? How does this benefit to sage ?
>>
>> See also our wiki page https://wiki.sagemath.org/Foundation
>>
>> Could please people in charge of that foundation update the wiki page ?
>
>
>
> Sure but before I do that, are there any other questions people can think of?

In case it is easy/convenient, having information about amounts
received and spent would be
great (not sure whether it should be public, I've no idea how the
corresponding laws
in US function).

Similar  foundations, e.g. the one  of Oberwolfach Institute, publish
their annual finance reports.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] check dependencies

2018-09-21 Thread Thierry
Hi,

on the way to upgrading networkx, i noticed that the source code contains
tests, but we do not ship any spkg-check script for that (yet).

However, the check process requires nose, which is an optional package
(note that networkx is standard). Is there a way to declare "check
dependencies" (e.g. after a second | or whatever symbol), or should i
hardcode some message within the spkg-check if it is not installed ?

Would it make sense to make nose standard so that exporting SPKG_CHECK=yes
does not breaks everything ?

Ciao,
Thierry


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] check dependencies

2018-09-21 Thread dimpase
On Fri, Sep 21, 2018 at 02:27:13PM +0200, Thierry wrote:
> Hi,
> 
> on the way to upgrading networkx, i noticed that the source code contains
> tests, but we do not ship any spkg-check script for that (yet).
> 
> However, the check process requires nose, which is an optional package
> (note that networkx is standard). Is there a way to declare "check
> dependencies" (e.g. after a second | or whatever symbol), or should i
> hardcode some message within the spkg-check if it is not installed ?
> 
> Would it make sense to make nose standard so that exporting SPKG_CHECK=yes
> does not breaks everything ?
On https://nose.readthedocs.io/en/latest/ one reads:

Note to Users
Nose has been in maintenance mode for the past several years and will likely 
cease without a new person/team to take over maintainership. New projects 
should consider using Nose2, py.test, or just plain unittest/unittest2.

IMHO we don't want such legacy things as standard...

Dima

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] check dependencies

2018-09-21 Thread Thierry
On Fri, Sep 21, 2018 at 01:40:38PM +0100, dimp...@gmail.com wrote:
[...]
> IMHO we don't want such legacy things as standard...

Agreed. But how should we deal with testing networkx ?

Ciao,
Thierry


> 
> Dima
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Deprecate and remove/relocate explain_pickle module?

2018-09-21 Thread Jeroen Demeyer
It must be said that I found this tool quite valuable. When unpickling 
goes wrong, it is typically not easy to find out why and explain_pickle 
does help with that.


That being said, if nobody wants to maintain it, it has to go (with 
praise, as you said)...


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Deprecate and remove/relocate explain_pickle module?

2018-09-21 Thread Erik Bray
On Fri, Sep 21, 2018 at 3:00 PM Jeroen Demeyer  wrote:
>
> It must be said that I found this tool quite valuable. When unpickling
> goes wrong, it is typically not easy to find out why and explain_pickle
> does help with that.
>
> That being said, if nobody wants to maintain it, it has to go (with
> praise, as you said)...

For sure; I wanted to be clear that I don't think it isn't valuable.
But I don't necessarily think it belongs in sagelib itself, and can
mostly be extracted out as a separate package with its own repository.
That way, at least it won't be entirely lost to the sands of time, and
someone who has a need for it and is sufficiently motivated to update
it for newer Python versions can pick it up again.   We could even
still keep sage.misc.explain_pickle to provide the Sage-specific bits
as a wrapper around a more general library.  That is work that I am
willing to do (I'm just not motivated enough to update it beyond that,
at least at the moment).

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Deprecate and remove/relocate explain_pickle module?

2018-09-21 Thread Nils Bruin
On Friday, September 21, 2018 at 1:46:47 AM UTC-7, Erik Bray wrote:
>
> There is a cool module in sage called sage.misc.explain_pickle, which 
> is useful for helping to understand and debug how non-trivial objects 
> in Sage are pickled and unpickled. 
>
> I am adding another testimonial  on the usefulness of the routine. On 
several occasions I was in a pickle (sorry for the pun), which could be 
solved immediately by explain_pickle. it was a big time-saver that it was 
available *right there*, because I wasn't looking forward to having to hunt 
down a third party package that may or may not help me. I also think that 
with multiprocessing, serialization remains very important to support for 
(hopefully) all data structures in sage. That means that whenever a new 
structure pops up, errors and debugging will be inevitable. The problems in 
serialization are often triggered by non-local interactions, so I would not 
expect that problems with serialization in sage will become rarer (in fact, 
I expect them to become more complex due to more intricate interactions).

I would be a little sad to see explain_pickle go. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Deprecate and remove/relocate explain_pickle module?

2018-09-21 Thread Erik Bray
On Fri, Sep 21, 2018 at 4:29 PM Nils Bruin  wrote:
>
> On Friday, September 21, 2018 at 1:46:47 AM UTC-7, Erik Bray wrote:
>>
>> There is a cool module in sage called sage.misc.explain_pickle, which
>> is useful for helping to understand and debug how non-trivial objects
>> in Sage are pickled and unpickled.
>>
> I am adding another testimonial  on the usefulness of the routine. On several 
> occasions I was in a pickle (sorry for the pun), which could be solved 
> immediately by explain_pickle. it was a big time-saver that it was available 
> *right there*, because I wasn't looking forward to having to hunt down a 
> third party package that may or may not help me. I also think that with 
> multiprocessing, serialization remains very important to support for 
> (hopefully) all data structures in sage. That means that whenever a new 
> structure pops up, errors and debugging will be inevitable. The problems in 
> serialization are often triggered by non-local interactions, so I would not 
> expect that problems with serialization in sage will become rarer (in fact, I 
> expect them to become more complex due to more intricate interactions).
>
> I would be a little sad to see explain_pickle go.

Per my reply to Jeroen, what if it were still "there" in
sage.misc.explain_pickle, but the meat of it were moved out to a
separate module (which could still be included in
sage-the-distribution, as at least an optional package if not a
standard package)?

My reasoning here is not so much that it isn't useful (which I think
it clearly is), but rather that it's a pretty general tool that
deserves to live outside Sage.  And it's also in need of maintenance,
which eventually will make it a blocker for Sage, which is not so good
given that it can clearly exist outside of Sage itself.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Developer guide for casual user

2018-09-21 Thread Andy Howell
I'm a casual user of sage and python. I know a little of both, but far
far from expert. There have been a number of very minor bugs that I
could fix, but was stymied because I don't know, or have forgotten, how
to debug sage code, how to find the code be called etc. To the regular
sage developer these are quite minor issues, but they are enough to stop
me from pursuing issues further.

I'm a C++ developer, so general concepts are not the issue, it is
sage/python specific things that I need help with.

I propose adding a section to the sage developer guide that address
things like:

How to setup a testing environment that won't interfere with my
installed sage.
How to debug code on the command line.
How to debug in code in Jupyter.
What are the differences between Sage's use of python and vanilla python?
Are there tricks to sage development that make it simpler?
How to I find the code being called?
Which python debugger are best for sage?

I can write those sections, but I will need help and direction from the
community. My goal is to make it dead easy for people like myself to fix
minor problems. Some of the above are probably generic python questions.
However, having them addressed here makes it more likely the casual user
will contribute. Even if all the doc does is to provide links to python
sites, that is helpful.

A couple weeks ago I was looking at a latex formatting issue that Samuel
Lelievre helped me with (Thanks Samuel), but I wasn't able to trace the
code in the debugger. I still want to address that.

Regards,

Andy

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Deprecate and remove/relocate explain_pickle module?

2018-09-21 Thread Matthias Koeppe
+1 on splitting it out as a standalone Python package. With a bit of luck, 
a new set of contributors for it can be found that way. 

On Friday, September 21, 2018 at 11:06:47 AM UTC-4, Erik Bray wrote:
>
> On Fri, Sep 21, 2018 at 4:29 PM Nils Bruin > 
> wrote: 
> > 
> > On Friday, September 21, 2018 at 1:46:47 AM UTC-7, Erik Bray wrote: 
> >> 
> >> There is a cool module in sage called sage.misc.explain_pickle, which 
> >> is useful for helping to understand and debug how non-trivial objects 
> >> in Sage are pickled and unpickled. 
> >> 
> > I am adding another testimonial  on the usefulness of the routine. On 
> several occasions I was in a pickle (sorry for the pun), which could be 
> solved immediately by explain_pickle. it was a big time-saver that it was 
> available *right there*, because I wasn't looking forward to having to hunt 
> down a third party package that may or may not help me. I also think that 
> with multiprocessing, serialization remains very important to support for 
> (hopefully) all data structures in sage. That means that whenever a new 
> structure pops up, errors and debugging will be inevitable. The problems in 
> serialization are often triggered by non-local interactions, so I would not 
> expect that problems with serialization in sage will become rarer (in fact, 
> I expect them to become more complex due to more intricate interactions). 
> > 
> > I would be a little sad to see explain_pickle go. 
>
> Per my reply to Jeroen, what if it were still "there" in 
> sage.misc.explain_pickle, but the meat of it were moved out to a 
> separate module (which could still be included in 
> sage-the-distribution, as at least an optional package if not a 
> standard package)? 
>
> My reasoning here is not so much that it isn't useful (which I think 
> it clearly is), but rather that it's a pretty general tool that 
> deserves to live outside Sage.  And it's also in need of maintenance, 
> which eventually will make it a blocker for Sage, which is not so good 
> given that it can clearly exist outside of Sage itself. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Deprecate and remove/relocate explain_pickle module?

2018-09-21 Thread Dima Pasechnik
+1 from me too.
On Fri, Sep 21, 2018 at 6:08 PM Matthias Koeppe
 wrote:
>
> +1 on splitting it out as a standalone Python package. With a bit of luck, a 
> new set of contributors for it can be found that way.
>
> On Friday, September 21, 2018 at 11:06:47 AM UTC-4, Erik Bray wrote:
>>
>> On Fri, Sep 21, 2018 at 4:29 PM Nils Bruin  wrote:
>> >
>> > On Friday, September 21, 2018 at 1:46:47 AM UTC-7, Erik Bray wrote:
>> >>
>> >> There is a cool module in sage called sage.misc.explain_pickle, which
>> >> is useful for helping to understand and debug how non-trivial objects
>> >> in Sage are pickled and unpickled.
>> >>
>> > I am adding another testimonial  on the usefulness of the routine. On 
>> > several occasions I was in a pickle (sorry for the pun), which could be 
>> > solved immediately by explain_pickle. it was a big time-saver that it was 
>> > available *right there*, because I wasn't looking forward to having to 
>> > hunt down a third party package that may or may not help me. I also think 
>> > that with multiprocessing, serialization remains very important to support 
>> > for (hopefully) all data structures in sage. That means that whenever a 
>> > new structure pops up, errors and debugging will be inevitable. The 
>> > problems in serialization are often triggered by non-local interactions, 
>> > so I would not expect that problems with serialization in sage will become 
>> > rarer (in fact, I expect them to become more complex due to more intricate 
>> > interactions).
>> >
>> > I would be a little sad to see explain_pickle go.
>>
>> Per my reply to Jeroen, what if it were still "there" in
>> sage.misc.explain_pickle, but the meat of it were moved out to a
>> separate module (which could still be included in
>> sage-the-distribution, as at least an optional package if not a
>> standard package)?
>>
>> My reasoning here is not so much that it isn't useful (which I think
>> it clearly is), but rather that it's a pretty general tool that
>> deserves to live outside Sage.  And it's also in need of maintenance,
>> which eventually will make it a blocker for Sage, which is not so good
>> given that it can clearly exist outside of Sage itself.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] latex for desolve results

2018-09-21 Thread Samuel Lelievre
Andy,

three weeks ago, after the partial exploration discussed on this list,
I switched to other preoccupations and forgot to get back to this.

To recap and go a little further, here is how I would describe
the issue and some steps to explore it:

Current:

sage: h = e^-x
sage: latex(h)
e^{\left(-x\right)}

Wish:

sage: h = e^-x
sage: latex(h)
e^{-x}

The function `latex` (see `latex??`) calls `self._latex_`
which itself (see `h._latex_??`) calls

  self._parent._latex_element_(self)

In this case, self._parent is Sage's symbolic ring,
so the issue can be reformulated as:

Current:

sage: h = e^-x
sage: SR._latex_element_(h)
'e^{\\left(-x\\right)}'

Wish:

sage: h = e^-x
sage: SR._latex_element_(h)
'e^{-x}'

This method `SR._latex_element_` (see `SR._latex_element_??`)
is defined in sage/symbolic/ring.pyx, see:

  
https://github.com/sagemath/sage/blob/master/src/sage/symbolic/ring.pyx#L888

Exploring further, it calls:

  char_to_str(GEx_to_str_latex(&x._gobj))

The only other place I find `GEx_to_str_latex` is in

  sage/src/sage/libs/pynac/pynac.pxd

see also (searching the sagemath/sage repo on GitHub):

  
https://github.com/sagemath/sage/blob/master/src/sage/libs/pynac/pynac.pxd#L261

Pynac's wiki has a note about the latexing of symbolic expressions:

  https://github.com/pynac/pynac/wiki/%7C-printing

Not sure where to go from there. This seems to be leaving the Python
world and to be calling some C or C++ library, where I'm less fluent.

I created a ticket for this issue. I hope this can get solved!

- Sage Trac ticket 26337
  Extraneous parentheses in latex(e^-x)
  https://trac.sagemath.org/ticket/26337

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Developer guide for casual user

2018-09-21 Thread Samuel Lelievre
Hi Andy, thanks for your offer to make it easier to contribute to Sage
by adding tips to the developer guide. I'm sure the community will
jump in to help where needed. Regarding the latex formatting issue
you reported three weeks ago, I opened a ticket to track progress:

- Sage Trac ticket 26337
  Extraneous parentheses in latex(e^-x)
  https://trac.sagemath.org/ticket/26337

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Developer guide for casual user

2018-09-21 Thread Travis Scrimshaw
Hi Andy,
   It would be great to improve our methodologies for recruiting/training 
new contributors and developers, and I am happy to hear you are willing to 
work on this.

I'm a casual user of sage and python. I know a little of both, but far 
> far from expert. There have been a number of very minor bugs that I 
> could fix, but was stymied because I don't know, or have forgotten, how 
> to debug sage code, how to find the code be called etc.


That seems a little contradictory IMO. If you know they are (very) minor 
bugs, you already (mostly) know how to fix them. Although I might have a 
different definition of minor than you for this.
 

> To the regular sage developer these are quite minor issues, but they are 
> enough to stop me from pursuing issues further. 
>
> I'm a C++ developer, so general concepts are not the issue, it is 
> sage/python specific things that I need help with. 
>
> I propose adding a section to the sage developer guide that address 
> things like: 
>
> How to setup a testing environment that won't interfere with my 
> installed sage. 
>

Technically that is impossible because you have to modify Sage to test your 
development changes. However, the practical answer is git already provides 
this for you. Just make your changes in a new branch.
 

> How to debug code on the command line. 
>
How to debug in code in Jupyter. 
>

Without modifying the source code (which you cannot do from either of those 
options), all you can really do is isolate a MWE.
 

> What are the differences between Sage's use of python and vanilla python? 
>

None. Sage uses a preparser via IPython, which can amount to differences 
between writing true Python code (a .py file) and Sage code (a .sage file).

Are there tricks to sage development that make it simpler? 
>

I'm sorry, but that really sounds like "I want to get really good without 
practicing".
 

> How to I find the code being called? 
>

%prun is reasonably good for that. The foo?? is also very useful for 
looking at a particular block of code.

Which python debugger are best for sage? 
>

This is bound to have lots of bikeshedding or just be pdb.

>
> I can write those sections, but I will need help and direction from the 
> community. My goal is to make it dead easy for people like myself to fix 
> minor problems. Some of the above are probably generic python questions. 
> However, having them addressed here makes it more likely the casual user 
> will contribute. Even if all the doc does is to provide links to python 
> sites, that is helpful. 
>

>From my experience, the biggest issue that prevents people from fixing bugs 
in Sage is getting used to our development workflow and learning how to 
work with git (and more generally, version control software). This is the 
part where we need to focus on more. I think people are fairly adept at 
finding where they need to fix a bug, although this could be improved as 
well (in contrast, finding the correct spot where to add new code to Sage 
seems to be more problematic).

Best,
Travis

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] latex for desolve results

2018-09-21 Thread Andy Howell
Samuel,

I am the personification of preoccupations upon preoccupations. No problem.

My meager attempt lead me to pynac as well, though not into the library
itself. I do know C++, so maybe I can make some progress there.

I cloned pynac. There are some dependencies to work out to get it to
build. I'll fiddle with it some more.

Thanks for your help.

Andy



On 09/21/2018 05:47 PM, Samuel Lelievre wrote:
> Andy,
>
> three weeks ago, after the partial exploration discussed on this list,
> I switched to other preoccupations and forgot to get back to this.
>
> To recap and go a little further, here is how I would describe
> the issue and some steps to explore it:
>
> Current:
>
>     sage: h = e^-x
>     sage: latex(h)
>     e^{\left(-x\right)}
>
> Wish:
>
>     sage: h = e^-x
>     sage: latex(h)
>     e^{-x}
>
> The function `latex` (see `latex??`) calls `self._latex_`
> which itself (see `h._latex_??`) calls
>
>   self._parent._latex_element_(self)
>
> In this case, self._parent is Sage's symbolic ring,
> so the issue can be reformulated as:
>
> Current:
>
>     sage: h = e^-x
>     sage: SR._latex_element_(h)
>     'e^{\\left(-x\\right)}'
>
> Wish:
>
>     sage: h = e^-x
>     sage: SR._latex_element_(h)
>     'e^{-x}'
>
> This method `SR._latex_element_` (see `SR._latex_element_??`)
> is defined in sage/symbolic/ring.pyx, see:
>
>  
> https://github.com/sagemath/sage/blob/master/src/sage/symbolic/ring.pyx#L888
>
> Exploring further, it calls:
>
>   char_to_str(GEx_to_str_latex(&x._gobj))
>
> The only other place I find `GEx_to_str_latex` is in
>
>   sage/src/sage/libs/pynac/pynac.pxd
>
> see also (searching the sagemath/sage repo on GitHub):
>
>  
> https://github.com/sagemath/sage/blob/master/src/sage/libs/pynac/pynac.pxd#L261
>
> Pynac's wiki has a note about the latexing of symbolic expressions:
>
>   https://github.com/pynac/pynac/wiki/%7C-printing
>
> Not sure where to go from there. This seems to be leaving the Python
> world and to be calling some C or C++ library, where I'm less fluent.
>
> I created a ticket for this issue. I hope this can get solved!
>
> - Sage Trac ticket 26337
>   Extraneous parentheses in latex(e^-x)
>   https://trac.sagemath.org/ticket/26337
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sage-devel+unsubscr...@googlegroups.com
> .
> To post to this group, send email to sage-devel@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Developer guide for casual user

2018-09-21 Thread William Stein
Since Travis answered, I'll also throw in some answers for variety (I
mainly going to mention things that are complementary)...

On Fri, Sep 21, 2018 at 9:29 AM, Andy Howell  wrote:
> How to setup a testing environment that won't interfere with my
> installed sage.

I would *always* install a completely separate copy of Sage for this
purpose.  You definitely don't want
your dev version messing up your production work.Just download the
sage source code, extract it
somewhere else, and build it.  That will be your "test environment".
 If you have the disk space but your computer
isn't super fast, then this may be better than what Travis suggests,
since switching branches and doing
a build can be very slow with Sage, unfortunately.

> How to debug code on the command line.

In addition to what Travis said, don't be embarrassed to simply use
print.  Also, sys.stdout.flush() can be useful
to ensure that your output appears exactly when you expect it to appear.

For debugging Cython code, gdb is also very useful.  For memory leaks,
valgrind is useful.

> How to debug in code in Jupyter.

Don't -- just switch to the command line.  If you're debugging or
profiling something, it's best to be as close to the metal
as you can get, and eliminate any sources of complexity, if possible.

> What are the differences between Sage's use of python and vanilla python?

The Sage command line prompt uses a preparser.  Given a line of code
"foo...", type

sage: preparse("foo...")

to see exactly what it is transformed into before being given to
Python.   This can be a very sensible
thing to do as a first step when debugging, in order to eliminate a
layer of complexity (see above).

The Sage library itself does NOT have any code that is run through the
preparser -- it's 100% normal
Python (or Cython) code, plus the other languages in Sage.

> Are there tricks to sage development that make it simpler?

Yes, tons, but that tricks that are useful depend heavily on what area
of Sage you want to do development on.

> How to I find the code being called?

I think %prun is very useful for this, since it shows all functions
called in evaluating a line of code, how many times
they were called, how long it took, etc.

> Which python debugger are best for sage?

Personally I like print statements and Ipython's built in debugger,
which is very good for Python code (but useless for Cython).

> I can write those sections, but I will need help and direction from the
> community. My goal is to make it dead easy for people like myself to fix
> minor problems. Some of the above are probably generic python questions.
> However, having them addressed here makes it more likely the casual user
> will contribute. Even if all the doc does is to provide links to python
> sites, that is helpful.
>
> A couple weeks ago I was looking at a latex formatting issue that Samuel
> Lelievre helped me with (Thanks Samuel), but I wasn't able to trace the
> code in the debugger. I still want to address that.
>
> Regards,
>
> Andy
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.