Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Jeroen Demeyer
On 2013-02-01 00:17, Robert Bradshaw wrote: > On Thu, Jan 31, 2013 at 12:11 PM, Jeroen Demeyer > wrote: >> On 2013-01-31 20:42, Robert Bradshaw wrote: >>> I think this will be much easier to do once we've moved to git >> Why? What has git to do with this? > > Well, really moving to a proper rev

[sage-devel] Re: Should sage -b run sage -sync-build to get rid of outdated .py and .pyc files?

2013-01-31 Thread Keshav Kini
Robert Bradshaw writes: > On Thu, Jan 31, 2013 at 7:29 PM, Keshav Kini wrote: >> But an import statement succeeding when it shouldn't *is* something >> going wrong - it is exactly the kind of problem which is caused by not >> doing `sage --sync-build` after running `sage -b`. >> >> By the way, an

[sage-devel] Re: Sage live USB (Debian based, with self-replicating capabilities)

2013-01-31 Thread cch
Hi all, A different way as this thread, I also make a live USB system (for Sage-5.6 and Python3.3) for awhile and run very well on most PC, laptops.and my Macbook air (MBA13). Porteus linux is the live system I use (since it is very tiny). Replicate it only few steps required: 1. copy its is

Re: [sage-devel] Re: Should sage -b run sage -sync-build to get rid of outdated .py and .pyc files?

2013-01-31 Thread Robert Bradshaw
On Thu, Jan 31, 2013 at 7:29 PM, Keshav Kini wrote: > Dima Pasechnik writes: > >> On 2013-01-31, Keshav Kini wrote: >>> Dima Pasechnik writes: On 2013-01-23, Robert Bradshaw wrote: > On Tue, Jan 22, 2013 at 9:53 PM, tom d wrote: >> Another possible solution would be to change the

[sage-devel] Re: Python 3 formatting

2013-01-31 Thread Keshav Kini
Harald Schilly writes: > On Thu, Jan 31, 2013 at 11:00 AM, Jeroen Demeyer < > jdeme...@cage.ugent.be> wrote: > > On 2013-01-31 10:58, Volker Braun wrote: > > commit hook > What's that? > > > For an hg/git commit, a script is called prior to actually doing the > commit. if its exit code

[sage-devel] Re: Should sage -b run sage -sync-build to get rid of outdated .py and .pyc files?

2013-01-31 Thread Keshav Kini
Dima Pasechnik writes: > On 2013-01-31, Keshav Kini wrote: >> Dima Pasechnik writes: >>> On 2013-01-23, Robert Bradshaw wrote: On Tue, Jan 22, 2013 at 9:53 PM, tom d wrote: > Another possible solution would be to change the error message one gets > on a > failed import state

[sage-devel] Re: Sage Explorer / adding type information to functions

2013-01-31 Thread Jason Grout
On 1/31/13 4:37 PM, William Stein wrote: Unfortunately, type declarations, with that syntax, was*proposed* for Python 3, but then soundly rejected by Guido as "too ugly". That was referring to adding annotations about *generators*, according to the PEP (specifically using 'yields', 'is_sent',

Re: [sage-devel] Re: Sage Explorer / adding type information to functions

2013-01-31 Thread D. S. McNeil
> Ah, interesting. I guess Guido just didn't like part of the > notation.Note that the declaration doesn't actually do anything: > def f(a: int, b: float) -> (float, str): > ... print(a,b) > ... f(2.5,3) > 2.5 3 Yeah, IIRC enforcing this was a non-starter, and the decision was to

Re: [sage-devel] Re: Sage Explorer / adding type information to functions

2013-01-31 Thread William Stein
On Thu, Jan 31, 2013 at 7:45 PM, D. S. McNeil wrote: >>> As far as I understand, Python 3 will allow to achieve the same using >>> the natural syntax `def f(x: int, y: float) : ...`, with flexibility >>> on what "type" can be. >> >> Unfortunately, type declarations, with that syntax, was *proposed

[sage-devel] Re: Wrapping gap.IsConjugate

2013-01-31 Thread Dima Pasechnik
On 2013-01-31, Simon King wrote: > Hi Jori, hi Dima, > > On 2013-01-31, Dima Pasechnik wrote: >>> - What is naming policy? Should this be is_conjugate? What is best order >>> for >>> arguments? >> Indeed, I would keep the naming as close to GAP's one as possible. > > "As close as possible" is,

Re: [sage-devel] Re: Sage Explorer / adding type information to functions

2013-01-31 Thread D. S. McNeil
>> As far as I understand, Python 3 will allow to achieve the same using >> the natural syntax `def f(x: int, y: float) : ...`, with flexibility >> on what "type" can be. > > Unfortunately, type declarations, with that syntax, was *proposed* for > Python 3, but then soundly rejected by Guido as "to

[sage-devel] Re: Comparison between float inf and sage Infinity

2013-01-31 Thread Travis Scrimshaw
This is a good thing IMO: sage: d = RDF(2.0) sage: d = d^1 sage: inff = float('inf') sage: inff == f*f True sage: inff == d True sage: inff == r True sage: r == d True -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from th

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Robert Bradshaw
On Thu, Jan 31, 2013 at 12:11 PM, Jeroen Demeyer wrote: > On 2013-01-31 20:42, Robert Bradshaw wrote: >> I think this will be much easier to do once we've moved to git > Why? What has git to do with this? Well, really moving to a proper revision control workflow, as dealing with broken patches a

Re: [sage-devel] Re: Sage Explorer / adding type information to functions

2013-01-31 Thread William Stein
On Thu, Jan 31, 2013 at 6:04 AM, Nicolas M. Thiery wrote: > On Thu, Jan 31, 2013 at 10:40:14AM +0100, Julien Puydt wrote: >> Le 31/01/2013 10:29, Harald Schilly a écrit : >> >What's missing, in Sage, is a decorator for each method, which would >> >specify the input type. >> >> I thought that wasn'

[sage-devel] Re: Comparison between float inf and sage Infinity

2013-01-31 Thread Travis Scrimshaw
I forgot to mention that this also happens: sage: f = float(2.0) sage: f^100 --- OverflowError Traceback (most recent call last) /home/travis/sage-5.5.rc0/devel/sage-combinat/sage/combinat/ in

[sage-devel] Comparison between float inf and sage Infinity

2013-01-31 Thread Travis Scrimshaw
Hey everyone, While working on #13840, I noticed that sage's InfinityRing did not coerce a floating point infinity, so the following occurs: sage: oo == float('+inf') False sage: float('inf') < oo True What I am proposing is on ticket #14045wh

[sage-devel] Re: Sage live USB (Debian based, with self-replicating capabilities)

2013-01-31 Thread Jason Grout
On 1/31/13 2:45 PM, Thierry wrote: On Wed, Jan 16, 2013 at 03:30:06PM -0800, Sébastien Labbé wrote: Salut Thierry Monteil, This is really nice! I just tested it. Works on linux. But, I can't make a mac os x to boot on the usb key... Salut! this is due to the fact that Mac can only understand

[sage-devel] Re: Wrapping gap.IsConjugate

2013-01-31 Thread Volker Braun
LibGAP should be in Sage-5.7 and I'd say its ready for prime time. I already switched the abelian groups to libgap and am currently rewiring the matrix groups. The permutation groups still need to be done.. On Thursday, January 31, 2013 7:59:41 PM UTC, Javier López Peña wrote: > > Hi Jori, > >

Re: [sage-devel] Re: Sage live USB (Debian based, with self-replicating capabilities)

2013-01-31 Thread Thierry
On Wed, Jan 16, 2013 at 03:30:06PM -0800, Sébastien Labbé wrote: > Salut Thierry Monteil, > > This is really nice! I just tested it. Works on linux. But, I can't make a > mac os x to boot on the usb key... Salut! this is due to the fact that Mac can only understand GUID partition tables, and th

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Jeroen Demeyer
On 2013-01-31 20:42, Robert Bradshaw wrote: > I think this will be much easier to do once we've moved to git Why? What has git to do with this? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emai

[sage-devel] Re: Wrapping gap.IsConjugate

2013-01-31 Thread Javier López Peña
Hi Jori, there are indeed many GAP method that are not exposed to the sage library. A while back I wrote a wrapper for (some) conjugacy classes methods: http://trac.sagemath.org/sage_trac/ticket/7886 My approach (suggested by N. Thiery) was to create two different classes, a generic one for fal

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Robert Bradshaw
On Thu, Jan 31, 2013 at 10:39 AM, Harald Schilly wrote: > > On Thu, Jan 31, 2013 at 7:32 PM, Johannes wrote: >> >> some of those errors should be fixable by a little sed script like most >> of the whitespace warnings and '<>'. > > > No need to do this, autopep8 has a "--select=..." parameter, wh

Re: [sage-devel] Re: Wrapping gap.IsConjugate

2013-01-31 Thread Jori Mantysalo
On Thu, 31 Jan 2013, Simon King wrote: - What is naming policy? Should this be is_conjugate? Indeed, I would keep the naming as close to GAP's one as possible. "As close as possible" is, I think, not a good advice -- because it could be understood to adopt GAP's function name IsConjugate.

Re: [sage-devel] Add warning about Mac app store pref to download page - or README?

2013-01-31 Thread Michael Welsh
On 1/02/2013, at 8:19 AM, kcrisman wrote: > > Sounds viable to me. Any other ideas? Presumably this can be considered a > problem, since we want people who know nothing about App Store prefs > downloading Sage :) IIRC, the default setting is "MAS and registered developers", so we could theo

[sage-devel] Add warning about Mac app store pref to download page - or README?

2013-01-31 Thread kcrisman
>From a friend of Sage... +++ So, ... couple of [my students] had a problem that I think the Sage download server should warn about: They're running OS X.8, which has a default preference to only run software downloaded through the App Store. So what happened is that these folks downloaded and

[sage-devel] Re: Wrapping gap.IsConjugate

2013-01-31 Thread Simon King
Hi Jori, hi Dima, On 2013-01-31, Dima Pasechnik wrote: >> - What is naming policy? Should this be is_conjugate? What is best order for >> arguments? > Indeed, I would keep the naming as close to GAP's one as possible. "As close as possible" is, I think, not a good advice -- because it could be

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Harald Schilly
On Thu, Jan 31, 2013 at 7:32 PM, Johannes wrote: > some of those errors should be fixable by a little sed script like most > of the whitespace warnings and '<>'. > No need to do this, autopep8 has a "--select=..." parameter, where you can say which one of those E-numbers you want to have fixed.

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Johannes
some of those errors should be fixable by a little sed script like most of the whitespace warnings and '<>'. greatz Johannes On 31.01.2013 12:17, Jeroen Demeyer wrote: > $ pep8 -qq --statistics sage > 869 E111 indentation is not a multiple of four > 189 E121 continuation line indentation

[sage-devel] Re: Messing up hash and cmp with UniqueRepresentation

2013-01-31 Thread Nils Bruin
On Jan 31, 6:49 am, "Nicolas M. Thiery" wrote: > Shall we ask the Cython devs to implement the __classcall__ protocol? > Then we could merge the factory function and the class in Cython > classes as is done by UniqueRepresentation. I guess that could be quite doable for "python" style classes th

Re: [sage-devel] Compiling 32bit spkgs on 64bit platforms with Sage's bundled gcc

2013-01-31 Thread Jeroen Demeyer
On 2013-01-31 18:31, Nicolas M. Thiery wrote: > How shall we proceed? Would it make sense to configure gcc's > compilation to build and install the 32bits libraries? I wouldn't do this for all installations, I see little benefit. But in Linux at least, you can build/run Sage under the "linux32" pe

[sage-devel] Compiling 32bit spkgs on 64bit platforms with Sage's bundled gcc

2013-01-31 Thread Nicolas M. Thiery
Hi! We are working on the gap3 spkg. It's a very old version of GAP, but still important due to a couple GAP packages like Chevie (Coxeter groups and the like) which have never been ported to GAP4. There is one technicality, namely that gap3 can only be compiled in 32bits. That's usually n

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Robert Bradshaw
On Thu, Jan 31, 2013 at 2:36 AM, Volker Braun wrote: > On Thursday, January 31, 2013 10:31:16 AM UTC, Jeroen Demeyer wrote: >> >> I'd like to mention that in the release management script, there are a >> few things that I check for, such as: >> >> * no bare "except:" without exception class >> * n

Re: [sage-devel] How to determine the argspec of functions defined in .pyx files?

2013-01-31 Thread Robert Bradshaw
On Thu, Jan 31, 2013 at 6:36 AM, Nicolas M. Thiery wrote: > Dear Robert, > > On Mon, Jan 28, 2013 at 11:16:56AM -0800, Robert Bradshaw wrote: >> Now if foo was instead a CFunction (like those produced by Cython, or >> the Python builtins) this doesn't work >> >> sage: A.foo = len >> sage:

Re: [sage-devel] Re: Messing up hash and cmp with UniqueRepresentation

2013-01-31 Thread Nicolas M. Thiery
On Thu, Jan 24, 2013 at 12:08:15PM -0800, Nils Bruin wrote: > Ouch, yes that is a fundamental problem. What one should have is a > custom `__new__` on UniqueRepresentation, with the python semantics, > not the cython __cinit__ (formerly called and still accepted __new__). > And there you can see th

Re: [sage-devel] How to determine the argspec of functions defined in .pyx files?

2013-01-31 Thread Nicolas M. Thiery
Dear Robert, On Mon, Jan 28, 2013 at 11:16:56AM -0800, Robert Bradshaw wrote: > Now if foo was instead a CFunction (like those produced by Cython, or > the Python builtins) this doesn't work > > sage: A.foo = len > sage: a.foo() > --

Re: [sage-devel] Re: Sage Explorer / adding type information to functions

2013-01-31 Thread Nicolas M. Thiery
On Thu, Jan 31, 2013 at 10:40:14AM +0100, Julien Puydt wrote: > Le 31/01/2013 10:29, Harald Schilly a écrit : > >What's missing, in Sage, is a decorator for each method, which would > >specify the input type. > > I thought that wasn't really possible with python? There are a couple existing imple

[sage-devel] Re: Sage Explorer

2013-01-31 Thread Travis Scrimshaw
Hey everyone, On Thursday, January 31, 2013 4:54:52 AM UTC-5, Volker Braun wrote: > > I don't think we want to add decorators to each method. In fact, I > definitely don't :-) I agree. Plus how would this work with optional/variable-length arguments? (Also it gets away from the weakly typed na

[sage-devel] Re: Wrapping gap.IsConjugate

2013-01-31 Thread Dima Pasechnik
On 2013-01-31, Jori Mantysalo wrote: > There is function is_isomorphic in Sage, but there is not is_conjugate. > For curiosity I looked source, and it seems to be an oneliner to write > one: > > def are_conjugates(self, g1, g2): > """ > Returns ``True`` if ``g1`` and ``g2`

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Jeroen Demeyer
$ pyflakes sage 2>/dev/null |grep 'undefined name ' sage/symbolic/expression_conversions.py:748: undefined name 'QQ' sage/symbolic/integration/external.py:58: undefined name 'dvar' sage/server/introspect.py:38: undefined name 'get_docstring_last' sage/server/introspect.py:41: undefined name 'get_so

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Jeroen Demeyer
$ pep8 -qq --statistics sage 869 E111 indentation is not a multiple of four 189 E121 continuation line indentation is not a multiple of four 28 E122 continuation line missing indentation or outdented 66 E123 closing bracket does not match indentation of opening bracket's line 33

[sage-devel] Re: Python 3 formatting

2013-01-31 Thread Harald Schilly
On Thursday, January 31, 2013 11:59:08 AM UTC+1, Volker Braun wrote: > > Btw did you try other code analysis tools besides pep8? > no, thank's for the pointer to flake8 :-) h -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe fro

[sage-devel] Re: Python 3 formatting

2013-01-31 Thread Volker Braun
Btw did you try other code analysis tools besides pep8? There is http://pypi.python.org/pypi/flake8 which is a wrapper around pep8 and two other analyzers. This might be a useful starting point for making our own customizations... On Thursday, January 31, 2013 9:37:18 AM UTC, Harald Schilly

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Harald Schilly
On Thu, Jan 31, 2013 at 11:31 AM, Jeroen Demeyer wrote: > Also, I personally don't > agree with everything that is said in PEP 8. > yes, we could agree on a list of exceptions, with pep8, it's the --ignore=E[number] switch which would disable a selected list of errors. H -- You received this

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Volker Braun
Well at this point in time there is not much point in writing mercurial scripts. But its something that should be integrated in the git workflow. Also there isn't a dedicated hg qrefresh-hook as there is for commits, though that can be hacked around... On Thursday, January 31, 2013 10:42:25 A

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Jeroen Demeyer
On 2013-01-31 11:36, Volker Braun wrote: > On Thursday, January 31, 2013 10:31:16 AM UTC, Jeroen Demeyer wrote: > > I'd like to mention that in the release management script, there are a > few things that I check for, such as: > > * no bare "except:" without exception class > * no

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Volker Braun
On Thursday, January 31, 2013 10:31:16 AM UTC, Jeroen Demeyer wrote: > I'd like to mention that in the release management script, there are a > few things that I check for, such as: > > * no bare "except:" without exception class > * no TABs > * no use of AssertionError ("assert" is fine, but

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Jeroen Demeyer
On 2013-01-31 10:58, Volker Braun wrote: > We definitely should have some lint-type tool that we put into the > commit hook to automatically show errors/warning. But it's very important to check only newly added code, as there is so much code which doesn't conform to PEP 8. Also, I personally don

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Harald Schilly
On Thu, Jan 31, 2013 at 11:00 AM, Jeroen Demeyer wrote: > On 2013-01-31 10:58, Volker Braun wrote: > > commit hook > What's that? For an hg/git commit, a script is called prior to actually doing the commit. if its exit code is != 0, no commit happens. H -- You received this message because yo

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Julien Puydt
Le 31/01/2013 11:00, Jeroen Demeyer a écrit : On 2013-01-31 10:58, Volker Braun wrote: commit hook What's that? Some piece of code which gets triggered on every commit, used for example to : - reject it if it doesn't pass some tests ; - send a mail to the maintainer about it if it wasn't co

Re: [sage-devel] Optional package download system

2013-01-31 Thread Harald Schilly
On Thursday, January 31, 2013 10:54:59 AM UTC+1, Harald Schilly wrote: > give me a few minutes :-) Ok, list is fixed. To answer you: there is a script that does some indexing. It's from maybe 2008 and it's not so clear what it does (yes, it should be rewritten someday, too). What happens

[sage-devel] Wrapping gap.IsConjugate

2013-01-31 Thread Jori Mantysalo
There is function is_isomorphic in Sage, but there is not is_conjugate. For curiosity I looked source, and it seems to be an oneliner to write one: def are_conjugates(self, g1, g2): """ Returns ``True`` if ``g1`` and ``g2`` are conjugates under the action of ``self``

Re: [sage-devel] Re: Python 3 formatting

2013-01-31 Thread Jeroen Demeyer
On 2013-01-31 10:58, Volker Braun wrote: > commit hook What's that? -- 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 pos

[sage-devel] Re: Python 3 formatting

2013-01-31 Thread Volker Braun
We definitely should have some lint-type tool that we put into the commit hook to automatically show errors/warning. I'm not sure which one is best suited for our purpose, ideally something with some flexibility to adapt it to our needs. On Thursday, January 31, 2013 9:37:18 AM UTC, Harald

Re: [sage-devel] Optional package download system

2013-01-31 Thread Harald Schilly
On Thursday, January 31, 2013 10:51:26 AM UTC+1, Volker Braun wrote: > > Is that file hand-crafted? > >> >> No, I'll try to fix this, but it runs a very old script that I don't fully understand. Let's see give me a few minutes :-) H -- You received this message because you are subscribe

[sage-devel] Re: Sage Explorer

2013-01-31 Thread Volker Braun
I don't think we want to add decorators to each method. In fact, I definitely don't :-) A saner approach would be to leverage our existing doctests. Just go through the AST and see which methods are being called directly in doctests. Then, as you execute the doctests, save the types of the arg

Re: [sage-devel] Re: Sage Explorer

2013-01-31 Thread Harald Schilly
On Thu, Jan 31, 2013 at 10:40 AM, Julien Puydt wrote: > I thought that wasn't really possible with python? Well, not directly, but one could define and add a decorator that just attaches a hidden attribute, like, ".__argument_specification" to the method or function. then, one could read that li

Re: [sage-devel] Optional package download system

2013-01-31 Thread Volker Braun
Is that file hand-crafted? On Thursday, January 31, 2013 9:37:16 AM UTC, Jeroen Demeyer wrote: > > sage-spkg reads this file: > http://www.sagemath.org/packages/optional/list > > So yes, it's a server-side problem. > -- You received this message because you are subscribed to the Google Group

Re: [sage-devel] Re: Sage Explorer

2013-01-31 Thread Julien Puydt
Le 31/01/2013 10:29, Harald Schilly a écrit : What's missing, in Sage, is a decorator for each method, which would specify the input type. I thought that wasn't really possible with python? Snark on #sagemath -- You received this message because you are subscribed to the Google Groups "sage-

Re: [sage-devel] Optional package download system

2013-01-31 Thread Jeroen Demeyer
sage-spkg reads this file: http://www.sagemath.org/packages/optional/list So yes, it's a server-side problem. -- 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

[sage-devel] Re: Python 3 formatting

2013-01-31 Thread Harald Schilly
On Wednesday, January 30, 2013 7:10:46 PM UTC+1, Travis Scrimshaw wrote: > >Should we be encouraging (or enforce) new code to be python 3 > compliant? In particular, not using removed syntax such as exceptions as > `raise ExceptionType, args` or `<>` comparisons? > Are there any intentions t

[sage-devel] Re: Sage Explorer

2013-01-31 Thread Harald Schilly
On Wednesday, January 30, 2013 10:04:49 PM UTC+1, Nicolas M. Thiéry wrote: > > Future > -- > Just my 2 cents: When I saw it, I liked that it doesn't rely on javascript (ok, well, formula rendering), and had a linear top-down layout (by accident). This led me to the conclusion that it co

[sage-devel] Optional package download system

2013-01-31 Thread Volker Braun
How is the "newest package" implemented server-side? Something seems to be very wrong. Note that the current patchbot spkg is patchbot-1.2.5.spkg: [patchbot@volker-desktop sage-5.7.beta2]$ ./sage -f patchbot Attempting to download package patchbot >>> Checking online list of optional packages. [.