[sage-devel] Re: Code style guidelines

2011-10-26 Thread Simon King
Hi Florent, On 26 Okt., 17:58, Florent Hivert wrote: > If you want some example of what has been painful in the past, here they > are. Note: I don't intend any offense against the responsible of those > changes, I'm just asking for coordination; Trivial change for you are not > trivial at all for

[sage-devel] Re: Code style guidelines

2011-10-26 Thread leif
On 27 Okt., 03:18, Jason Grout wrote: > As Florent pointed out, the maintenance burden would be huge. Almost a one-liner for *both* fixing the whole Sage library as well as all pending patches. > Rejections for such an inconsequential bike-shedding issue that is > just a matter of taste are a h

[sage-devel] Re: Code style guidelines

2011-10-26 Thread john_perry_usm
On Oct 25, 9:43 pm, leif wrote: > > After all, comments and empty lines contribute to file bloat, but they > > also contribute to readability. > > Trailing blanks in contrast certainly don't, just like spaces on > otherwise empty lines :-) (perhaps unless your editor shows them -- > I've configure

[sage-devel] Re: Upgrading from sage-4.7 to sage-4.7.1

2011-10-26 Thread leif
On 27 Okt., 01:53, John H Palmieri wrote: > And note > , also.  That should be an > easy review. Haha, I did that without reading your message here... :-) -leif -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscr

[sage-devel] Re: sage -upgrade aborts - uncommitted changes

2011-10-26 Thread leif
Revived... -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org

[sage-devel] Re: Code style guidelines

2011-10-26 Thread Keshav Kini
This is now #11956. -Keshav Join us in #sagemath on irc.freenode.net ! -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google

[sage-devel] Re: Code style guidelines

2011-10-26 Thread Keshav Kini
>Let's just view not having >spaces on nonempty lines as good style and leave it at that. Perfect! This is exactly what I proposed in the OP, by the way :) Not sure how all these hammers appeared in my hand when the problem is pretty much already nailed down... I guess I indeed caught bikesheddi

[sage-devel] Re: Code style guidelines

2011-10-26 Thread Jason Grout
On 10/26/11 7:38 PM, Keshav Kini wrote: Well, the kernel devs try to remove trailing whitespace where it is found (and while in the process of doing something more meaningful) [1] and avoid introducing it in the first place at all [2] but do not create patchbombs by going out of their way to do s

[sage-devel] Re: Consistency for undefined expressions

2011-10-26 Thread Jason Grout
On 10/26/11 7:54 PM, Eviatar wrote: They are correct if using the limit definition. However, the signed zero is strange. IIRC, the standard for floating point arithmetic, IEEE 754, has both signed zeros and 1/0=infinity. See http://en.wikipedia.org/wiki/Signed_zero for example. Thanks, J

[sage-devel] Re: Consistency for undefined expressions

2011-10-26 Thread Eviatar
They are correct if using the limit definition. However, the signed zero is strange. -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://group

[sage-devel] Re: Consistency for undefined expressions

2011-10-26 Thread Kwankyu Lee
Hi, The second versions seem to me all bugs, resulted from implementation details. Kwankyu -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at ht

Re: [sage-devel] Re: Code style guidelines

2011-10-26 Thread Keshav Kini
Well, the kernel devs try to remove trailing whitespace where it is found (and while in the process of doing something more meaningful) [1] and avoid introducing it in the first place at all [2] but do not create patchbombs by going out of their way to do so. I mean, this just makes sense anyway

[sage-devel] Consistency for undefined expressions

2011-10-26 Thread Eviatar
Hello, Sage interprets expressions that are undefined differently when the input is an Integer or a RealNumber. For example, sage: 1/0 ZeroDivisionError sage: 1./0 +infinity sage: log(2, 0) ValueError sage: log(2., 0) -0.000 Is there any rationale for it to behave this way? --

[sage-devel] Re: Upgrading from sage-4.7 to sage-4.7.1

2011-10-26 Thread John H Palmieri
On Wednesday, October 26, 2011 4:47:03 PM UTC-7, leif wrote: > > I'll perhaps tweak sage-sage and sage-update a little; changing all > sage*.spkg's spkg-install files is another story. > > Feel free to modify the spkg-install file for the root repo, also, to deal with the specific hg issue disc

[sage-devel] Re: Upgrading from sage-4.7 to sage-4.7.1

2011-10-26 Thread leif
On 26 Okt., 22:47, John H Palmieri wrote: > > I don't recall where and when, but we already had some discussion on > > that, e.g. that files unknown to Mercurial ("? ...") should be ignored > > when checking whether there are uncommitted changes.  Keshav, John? > > In sage-devel in August (I hope

[sage-devel] Re: Sage on lion

2011-10-26 Thread Andrew Mathas
Thanks John. I didn't realise that this worked. Cheers, Andrew On Oct 26, 10:56 am, John H Palmieri wrote: > On Tuesday, October 25, 2011 3:52:24 PM UTC-7, Andrew Mathas wrote: > > > Hi All, > > > Is there an educated guess as to when/if sage will be ported to lion? > > I foolishly upgraded when

[sage-devel] Re: Upgrading from sage-4.7 to sage-4.7.1

2011-10-26 Thread John H Palmieri
On Wednesday, October 26, 2011 1:01:46 PM UTC-7, leif wrote: > > On 26 Okt., 17:15, William Stein wrote: > > I just tried to upgrade from sage-4.7 to sage-4.7.1 on > > > > I don't recall where and when, but we already had some discussion on > that, e.g. that files unknown to Mercurial ("?

[sage-devel] Re: Upgrading from sage-4.7 to sage-4.7.1

2011-10-26 Thread leif
On 26 Okt., 17:15, William Stein wrote: > I just tried to upgrade from sage-4.7 to sage-4.7.1 on > mod.math.washington.edu using "sage -upgrade", and get stopped by > >     There are uncommitted changes in the Sage root repository. Aborting. You evidently haven't tried to upgrade *from* a *devel*

Re: [sage-devel] Re: Code style guidelines

2011-10-26 Thread William Stein
Hi, [whitespace] What do other major open source projects (e.g., the Linux kernel) do regarding whitespace and patches? What are their policies? William -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr

[sage-devel] Re: Using sagetex for large blocks of code

2011-10-26 Thread leif
On 26 Okt., 17:06, javier wrote: >                 emph={access,and,break,class,continue,def,del,elif ,else,% >                 except,exec,finally,for,from,global,if,import,in,is,% >                 > lambda,not,or,pass,print,raise,return,try,while,cached_method}, OTOH + with, local, yield (Pe

Re: [sage-devel] Re: Code style guidelines

2011-10-26 Thread Florent Hivert
Hi Keshav, My last answer was a little rude or at least very short. Since Nicolas is on vacation I'm the only sage-combinat coordinator keeping an eye here this week. Anyway, we are both currently completely buried under the teaching load (eg: for me 15 hours new lectures since Monday). So p

[sage-devel] Upgrading from sage-4.7 to sage-4.7.1

2011-10-26 Thread William Stein
Hi, I just tried to upgrade from sage-4.7 to sage-4.7.1 on mod.math.washington.edu using "sage -upgrade", and get stopped by There are uncommitted changes in the Sage root repository. Aborting. This is some test done in sage-update. I have complaints: (1) This error message is confusin

[sage-devel] Re: Using sagetex for large blocks of code

2011-10-26 Thread javier
Hi Dan, I found a solution using listings indeed. I set up my own "sagecode" environment by adding to my preamble the following \usepackage{listings} % Used for code listing \usepackage{textcomp} % Used for syntax highlighting. \usepackage{setspace} % Used for changing linespace % This gives syn

Re: [sage-devel] Re: Sage on lion

2011-10-26 Thread Justin C. Walker
On Oct 25, 2011, at 16:56 , John H Palmieri wrote: > > > On Tuesday, October 25, 2011 3:52:24 PM UTC-7, Andrew Mathas wrote: >> >> Hi All, >> >> Is there an educated guess as to when/if sage will be ported to lion? >> I foolishly upgraded when it came out and have been unable to use sage >

Re: [sage-devel] Re: Using sagetex for large blocks of code

2011-10-26 Thread Dan Drake
On Wed, 26 Oct 2011 at 02:03AM -0700, javier wrote: > Basically what I want is to add "syntax highlight" to the code > listing. I thought that worked out of the box with sagecommandline but > now I realize it is only the sage prompt that gets colorized, so I > will probably make my own environment

Re: [sage-devel] Re: Creating an Array in Sage, and making a code in Sage involving if, then and for loops

2011-10-26 Thread John Cremona
On Wed, Oct 26, 2011 at 11:10 AM, Keshav Kini wrote: > Hi Chappman, > > Well, unless the simple formula also refers to total_prob itself, that seems > like a pretty pointless for loop, no? The variable will continually get > overwritten, and you will just end up with the value it was assigned in t

[sage-devel] Re: Creating an Array in Sage, and making a code in Sage involving if, then and for loops

2011-10-26 Thread Keshav Kini
Hi Chappman, Well, unless the simple formula also refers to total_prob itself, that seems like a pretty pointless for loop, no? The variable will continually get overwritten, and you will just end up with the value it was assigned in the last iteration of the loop, so unless that value referred

[sage-devel] Creating an Array in Sage, and making a code in Sage involving if, then and for loops

2011-10-26 Thread Chappman
Hi folks, I am relatively new to programming in Sage, and I am trying to find a method in of creating a 5 x 6 array, with probabilities as the the entrices to this array . Here's the tricky part, then I have to create a coding program which uses the probabilties in that array for example For i=

Re: [sage-devel] Re: Code style guidelines

2011-10-26 Thread Keshav Kini
Ah, I'm sorry, I misunderstood your question. Yes, that is a problem. I see no way around it in general. The only way to mitigate this is to try to avoid changing files that sage-combinat is working on. But I doubt that Sage developers want to commit to such a promise, unless sage-combinat want

[sage-devel] Re: Using sagetex for large blocks of code

2011-10-26 Thread javier
Hi Andrey and Dan, thanks for the replies! I don't actually care for the "sage:" prompts, just want to show the code. sageblock typesets the text just fine, but id doesn't add colorization. Basically what I want is to add "syntax highlight" to the code listing. I thought that worked out of the box

[sage-devel] Make lazy attributes transparent for introspection and use them to replace certain cached methods?

2011-10-26 Thread Simon King
Hi Jason, On 25 Okt., 22:48, Jason Grout wrote: > I think attributes are considered more pythonic for many things than > methods. That's good to know! So, I assume that it is OK that I suggest to replace C.all_super_categories() and C.super_categories() by lazy attributes. By the way, #11943 nee

Re: [sage-devel] Re: Code style guidelines

2011-10-26 Thread Florent Hivert
On Tue, Oct 25, 2011 at 11:42:05PM -0700, Keshav Kini wrote: > Since we would know where those lines are, we could search for the rest of > the line (i.e. the part that's not the trailing spaces) in your patch and > replace it with a line missing the whitespace. Voila, it is rebased, and > the p