Re: [sage-devel] RFC: correct way to deal with particular methods

2016-11-15 Thread Johan S . H . Rosenkilde
> Johan's suggestion is very intriguing but, unless I am completely mistaken, > it does not work in python. If I understand correctly if O is an instance of > Foo and O does not have the attribute x then python looks for Foo().x You're right, I seem to have confused myself with deleting

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Bruno Grenet
Le 15/11/2016 à 08:53, Vincent Delecroix a écrit : Not currently (though we have "Unknown"). The main problem is the interaction with Python booleans and the operators "or", "and", "not" (which are *not* logical operators). The Sage "Unknown" is badly broken for these reasons sage: not Unknown

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Thierry
On Tue, Nov 15, 2016 at 08:53:43AM +0100, Vincent Delecroix wrote: > Not currently (though we have "Unknown"). The main problem is the > interaction with Python booleans and the operators "or", "and", "not" > (which are *not* logical operators). The Sage "Unknown" is badly > broken for these

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Vincent Delecroix
On 15 November 2016 at 09:27, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > On 15 November 2016 at 09:19, Thierry wrote: >> On Tue, Nov 15, 2016 at 08:53:43AM +0100, Vincent Delecroix wrote: >>> Not currently (though we have "Unknown"). The main problem

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Vincent Delecroix
And what do you do with my_function1() or my_function2() or my_function3() shortcut or not shortcut? The current state of Python is that some of the above functions might not be evaluated (ie shortcut) *before* knowing the return type. On 15 November 2016 at 09:41, Thierry

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Vincent Delecroix
On 15 November 2016 at 09:19, Thierry wrote: > On Tue, Nov 15, 2016 at 08:53:43AM +0100, Vincent Delecroix wrote: >> Not currently (though we have "Unknown"). The main problem is the >> interaction with Python booleans and the operators "or", "and", "not" >>

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Vincent Delecroix
You are right this was a non-example... -- 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

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread Stan
Dear William, Thanks for the quick reply. The problem Thomas experience in SMC was that parts of his worksheet just disappeared and were not to be found in the snapshots. He could recover them from the log files and painfully put them in again, only to experience that bits started disappearing

[sage-devel] Re: Building 7.4.beta5 after building 7.5 betas

2016-11-15 Thread Dima Pasechnik
On Tuesday, November 15, 2016 at 1:34:00 AM UTC, Paul Masson wrote: > > > > On Monday, November 14, 2016 at 3:51:49 PM UTC-8, Dima Pasechnik wrote: >> >> Did you have a pressing need to build an old branch? >> I'd normally first rebase over the latest beta, and then build. >> > What do you mean

[sage-devel] Re: Building 7.4.beta5 after building 7.5 betas

2016-11-15 Thread Dima Pasechnik
On Tuesday, November 15, 2016 at 7:07:06 AM UTC, Ralf Stephan wrote: > > On Tuesday, November 15, 2016 at 2:34:00 AM UTC+1, Paul Masson wrote: >> >> Or is the current recommendation to always merge develop after every new >> beta? >> > > I think it's to use it sparingly. That the history from

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread Stan
This is amazing, I had no idea there was a way to run SMC locally already. Interestingly, https://hub.docker.com/u/sagemath/ points to sagemath.org as homepage, but I couldn't find a link to hub.docker.com at sagemath.org. I think it would be great to point to this resource at least on the

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread Stan
OK, I just asked Thomas to send me the email thread about his problem with SMC. His communication was with William Stein and Harald Schilly, and related to lost bits of a jupyter notebook that were not even recoverable using the revert button or the backup utility, plus bits started

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Vincent Delecroix
There is still a semantic problem to solve the following sage: Unknown or False False sage: False or Unknown Unknown Python is using __nonzero__ to deal with these or/and/not operators. This method __nonzero__ implicitly defines the conversion to booleans. And Python sets x or y := x if bool(x)

Re: [sage-devel] Building 7.4.beta5 after building 7.5 betas

2016-11-15 Thread Jeroen Demeyer
On 2016-11-14 23:56, Paul Masson wrote: I'm running into an problem that after building 7.5.beta1 or 7.5.beta2, building a branch based on 7.4.beta5 fails Well, it's a *beta* for a reason, failures can happen. In this case, the problem is #21672 which is fixed in 7.4.rc2. -- You received

[sage-devel] Re: "Tri bool"

2016-11-15 Thread Simon King
Hi Vincent, On 2016-11-15, Vincent Delecroix <20100.delecr...@gmail.com> wrote: >>> Perhaps was the proposal too greedy, so i wonder whether there would be a >>> possibility to have a trool adding an Unknown to bool that does not >>> perturb the speed when only True and False are used, and so

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Thierry
On Tue, Nov 15, 2016 at 09:43:18AM +0100, Vincent Delecroix wrote: > And what do you do with > > my_function1() or my_function2() or my_function3() Shortcut when you meet a True. For "and", shortcut when you meet a Unknown or a False. > shortcut or not shortcut? The current state of Python is

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread Dima Pasechnik
On Tuesday, November 15, 2016 at 2:29:30 PM UTC, Erik Bray wrote: > > On Mon, Nov 14, 2016 at 6:43 PM, William Stein > wrote: > > On Mon, Nov 14, 2016 at 8:40 AM, Erik Bray > wrote: > >> On Mon, Nov 14, 2016 at 4:49 PM, William Stein

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread William Stein
On Tuesday, November 15, 2016, Dima Pasechnik wrote: > > > On Tuesday, November 15, 2016 at 2:29:30 PM UTC, Erik Bray wrote: >> >> On Mon, Nov 14, 2016 at 6:43 PM, William Stein wrote: >> > On Mon, Nov 14, 2016 at 8:40 AM, Erik Bray

[sage-devel] Re: Errors from importing abs

2016-11-15 Thread Nils Bruin
On Monday, November 14, 2016 at 10:49:56 PM UTC-8, Ralf Stephan wrote: > > > so it seems the Python abs can be overridden. > Yes, abs is not a keyword. It's just a name that's by default bound to __builtin__.abs . However, given that python's "abs" gives access to a protocol that allows custom

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread Erik Bray
On Mon, Nov 14, 2016 at 6:43 PM, William Stein wrote: > On Mon, Nov 14, 2016 at 8:40 AM, Erik Bray wrote: >> On Mon, Nov 14, 2016 at 4:49 PM, William Stein wrote: >>> On Mon, Nov 14, 2016 at 6:21 AM, Stan wrote:

[sage-devel] Re: Building 7.4.beta5 after building 7.5 betas

2016-11-15 Thread Travis Scrimshaw
> Or is the current recommendation to always merge develop after every new >>> beta? >>> >> >> I think it's to use it sparingly. That the history from git log is >> gobbled is IMO a git bug. >> >> perhaps we need a policy that for a positive review of a ticket branch > things like merge

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread Dima Pasechnik
On Tuesday, November 15, 2016 at 5:10:40 PM UTC, William wrote: > > > > On Tuesday, November 15, 2016, Dima Pasechnik > wrote: > >> >> >> On Tuesday, November 15, 2016 at 2:29:30 PM UTC, Erik Bray wrote: >>> >>> On Mon, Nov 14, 2016 at 6:43 PM, William Stein

Re: [sage-devel] Speed question re the sigma function

2016-11-15 Thread Vincent Delecroix
On 15 November 2016 at 21:44, Jori Mäntysalo wrote: > On Tue, 15 Nov 2016, John H Palmieri wrote: > >> Also, should we switch to a naive implementation of sigma: essentially >> just >> return sum(divisors(n))? > > > The answer to questions like this is always the same, I

Re: [sage-devel] Speed question re the sigma function

2016-11-15 Thread William Stein
On Tue, Nov 15, 2016 at 11:47 AM, John H Palmieri wrote: > Inspired by the ask.sagemath question > https://ask.sagemath.org/question/35587/why-sigman-seems-not-so-performant-for-small-n/, > I started looking at timings for the sigma function (sigma(n) = sum of the >

[sage-devel] Speed question re the sigma function

2016-11-15 Thread John H Palmieri
Inspired by the ask.sagemath question https://ask.sagemath.org/question/35587/why-sigman-seems-not-so-performant-for-small-n/, I started looking at timings for the sigma function (sigma(n) = sum of the divisors of n, sigma(n, k) = sum of the kth powers of the divisors of n). On my computer, a

Re: [sage-devel] Speed question re the sigma function

2016-11-15 Thread Vincent Delecroix
I guess that it would be much better to also propose access to 1) the flint function void fmpz_divisor_sigma ( fmpz_t res , const fmpz_t n , ulong k ) 2) the pari function sigma For example, pari timing is competitive in this range $ sage -c "timeit('L = [sigma(n) for n in range(10**13,

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread Dima Pasechnik
On Tuesday, November 15, 2016 at 9:35:23 PM UTC, William wrote: > > On Tue, Nov 15, 2016 at 1:18 PM, Dima Pasechnik > wrote: > > as > https://docs.docker.com/docker-for-windows/#download-docker-for-windows > > says: > > "Docker for Windows requires 64bit Windows 10 Pro,

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread William Stein
On Tue, Nov 15, 2016 at 1:18 PM, Dima Pasechnik wrote: > as https://docs.docker.com/docker-for-windows/#download-docker-for-windows > says: > "Docker for Windows requires 64bit Windows 10 Pro, Enterprise and Education > (1511 November update, Build 10586 or later) and Microsoft

[sage-devel] run doctests of a single function

2016-11-15 Thread Franco Saliola
Hello, I'm wondering whether there is a way to run the doctests of a single function. Something like this: def f(): r""" sage: f() 42 """ return 41 run_doctests(f) (Note: there is a command called run_doctests, which runs all tests in a file / module, which I find very

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Vincent Delecroix
On 15 November 2016 at 09:12, Bruno Grenet wrote: > Le 15/11/2016 à 08:53, Vincent Delecroix a écrit : >> >> Not currently (though we have "Unknown"). The main problem is the >> interaction with Python booleans and the operators "or", "and", "not" >> (which are *not*

Re: [sage-devel] "Tri bool"

2016-11-15 Thread Thierry
On Tue, Nov 15, 2016 at 09:27:14AM +0100, Vincent Delecroix wrote: > On 15 November 2016 at 09:19, Thierry wrote: > > On Tue, Nov 15, 2016 at 08:53:43AM +0100, Vincent Delecroix wrote: > >> Not currently (though we have "Unknown"). The main problem is the > >>

[sage-devel] Hermite normal form of matrix over polynomial ring

2016-11-15 Thread Kwankyu Lee
Hi, The current Hermite normal form algorithm in Sage for matrices over k[x] seems embarrassingly slow. It is a generic algorithm for matrices over PIDs. What would be possible ways to improve the situation? Any reference to literature or implementations or like would be welcome. Thanks. --

[sage-devel] Re: why chrome kiosk mode in sage appliance??

2016-11-15 Thread Stan
Thanks, Volker. I just installed the VB image on my linux laptop and I can access the jupyter notebook through my local firefox on http://localhost:8000. So it seems to be a windows issue that Thomas can't. Do you have an idea what dodgy windows programs could be the reason? Antivirus? If you

[sage-devel] Re: why chrome kiosk mode in sage appliance??

2016-11-15 Thread Dima Pasechnik
On Tuesday, November 15, 2016 at 9:52:02 AM UTC, Stan wrote: > > Thanks, Volker. I just installed the VB image on my linux laptop and I can > access the jupyter notebook through my local firefox on > http://localhost:8000. So it seems to be a windows issue that Thomas > can't. Do you have an

[sage-devel] Re: why chrome kiosk mode in sage appliance??

2016-11-15 Thread Dima Pasechnik
On Tuesday, November 15, 2016 at 11:32:11 AM UTC, Stan wrote: > > You mean to start the VM (sage is started within the VM automatically), > ssh into it, shut down sage and restart with the options I want? Not sure > how to ssh into the VM, > Yes; even better, modify .xinitrc not to start Sage

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread William Stein
I think this was actually a problem with autosave we had for about one week. Of course we didn't know that at the time. I'm not sure why to say, except the root problem is probably solved, and if not there is a straightforward way to just use plain jupyter in SMC anyways. On Tuesday, November

Re: [sage-devel] why chrome kiosk mode in sage appliance??

2016-11-15 Thread William Stein
On Tue, Nov 15, 2016 at 2:35 PM, Dima Pasechnik wrote: > > > On Tuesday, November 15, 2016 at 9:35:23 PM UTC, William wrote: >> >> On Tue, Nov 15, 2016 at 1:18 PM, Dima Pasechnik wrote: >> > as >> >

[sage-devel] Re: "Tri bool"

2016-11-15 Thread Simon King
Hi Vincent, sorry for my previous post, as you discussed the example already. On 2016-11-15, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > There is still a semantic problem to solve the following > > sage: Unknown or False > False No. Unknown or False is Unknown. The shortcuts would

Re: [sage-devel] Re: "Tri bool"

2016-11-15 Thread Vincent Delecroix
Hi Simon, On 15 November 2016 at 11:44, Simon King wrote: > Hi Vincent, > > [...] > >> Python is using __nonzero__ to deal with these or/and/not operators. >> This method __nonzero__ implicitly defines the conversion to booleans. >> And Python sets >> >> x or y := x if

[sage-devel] Re: "Tri bool"

2016-11-15 Thread Simon King
Hi Vincent, On 2016-11-15, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > Indeed, __or__ is for the operator |. "or" can not be overridden. > > sage: class a(object): > : def __or__(self, other): > : return "hello" > sage: a() or True ><__main__.a object at

[sage-devel] Re: why chrome kiosk mode in sage appliance??

2016-11-15 Thread Stan
You mean to start the VM (sage is started within the VM automatically), ssh into it, shut down sage and restart with the options I want? Not sure how to ssh into the VM, but I'll play again with the .xinitrc. On Tuesday, November 15, 2016 at 11:11:39 AM UTC+1, Dima Pasechnik wrote: > > > > On

Re: [sage-devel] RFC: correct way to deal with particular methods

2016-11-15 Thread Erik Bray
On Mon, Nov 14, 2016 at 10:48 PM, VulK wrote: > Dear All, > sorry for the late reply and thank you very much for the input. > > > > As far as having methods not always defined the consensus here is leaning > towards making sublcasses but I am quite reluctant to do that because

Re: [sage-devel] Speed question re the sigma function

2016-11-15 Thread Jori Mäntysalo
On Tue, 15 Nov 2016, John H Palmieri wrote: Also, should we switch to a naive implementation of sigma: essentially just return sum(divisors(n))? The answer to questions like this is always the same, I guess: Add string-valued parameter 'algorithm' with None as default. For None use some