Re: [sage-devel] Re: reserved name for variables

2015-05-10 Thread Vincent Delecroix

On 10/05/15 23:14, Volker Braun wrote:
> On Sunday, May 10, 2015 at 11:02:05 PM UTC+2, vdelecroix wrote:
>>
>> Should we just allow the creation of such variable name but add a 
>> warning in the inject_variables function? 
>>
> 
> IMHO yes, both var and R. = QQ[] and anything else that injects 
> globals should fail at the injection only. If you don't inject then any 
> identifier should be allowed as variable label.

All right, added to the task list in #18390.

Vincent

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: reserved name for variables

2015-05-10 Thread Volker Braun
On Sunday, May 10, 2015 at 11:02:05 PM UTC+2, vdelecroix wrote:
>
> Should we just allow the creation of such variable name but add a 
> warning in the inject_variables function? 
>

IMHO yes, both var and R. = QQ[] and anything else that injects 
globals should fail at the injection only. If you don't inject then any 
identifier should be allowed as variable label.




 

>
> I am worried of making impossible the use of 'as' or 'or' as variable 
> names. The following looks like a plausible Sage usage 
>
> sage: alpha ='abcdefghijklmnopqrstuvwxyz' 
> sage: PolynomialRing(ZZ, [i+j for i in alpha for j in alpha]) 
>
> On 10/05/15 22:54, Volker Braun wrote: 
> > The checking in symbolic rings should be moved to sage.repl.user_globals 
> > and hooked into set_global. 
> > 
> > As for part 2, "None" is not a reserved keyword in Python2 so its in 
> > principle perfectly legal to use as identifier. Though it was later on 
> > specifically disallowed to assign to None, but assignment to True/False 
> is 
> > still possible. This is fixed in Python3 where None, True, False become 
> > keywords. 
> > 
> > We should probably exclude Python builtin names for that as well, i.e. 
> > dir(__builtin__), not because its not legal but because its mighty 
> > confusing to redefine int/str/id/all/... 
> > 
> > On Sunday, May 10, 2015 at 10:26:25 PM UTC+2, vdelecroix wrote: 
> >> 
> >> Hello, 
> >> 
> >> What should we do with variable names like 'or', 'and', ... This does 
> >> not break uniformly 
> >> 
> >> The symbolic ring refuses the creation of such variable 
> >> {{{ 
> >> sage: SR.var('and') 
> >> Traceback (most recent call last): 
> >> ... 
> >> ValueError: The name "and" is not a valid Python identifier. 
> >> }}} 
> >> 
> >> whereas polynomial rings silently fail 
> >> {{{ 
> >> sage: R = PolynomialRing(QQ, ('and', 'or')) 
> >> sage: R.inject_variables() 
> >> Defining and, or 
> >> sage: and 
> >> ... 
> >> SyntaxError: invalid syntax 
> >> sage: 'and' in globals() 
> >> True 
> >> }}} 
> >> 
> >> Vincent 
> >> 
> > 
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: reserved name for variables

2015-05-10 Thread Vincent Delecroix
And

sage: var('_')
_

On 10/05/15 22:38, Vincent Delecroix wrote:
> More subtle issue that isn't detected in the symbolic ring
> 
> sage: var('None')
> None
> sage: parent(None)
> 
> 
> On 10/05/15 22:26, Vincent Delecroix wrote:
>> Hello,
>>
>> What should we do with variable names like 'or', 'and', ... This does
>> not break uniformly
>>
>> The symbolic ring refuses the creation of such variable
>> {{{
>> sage: SR.var('and')
>> Traceback (most recent call last):
>> ...
>> ValueError: The name "and" is not a valid Python identifier.
>> }}}
>>
>> whereas polynomial rings silently fail
>> {{{
>> sage: R = PolynomialRing(QQ, ('and', 'or'))
>> sage: R.inject_variables()
>> Defining and, or
>> sage: and
>> ...
>> SyntaxError: invalid syntax
>> sage: 'and' in globals()
>> True
>> }}}
>>
>> Vincent
>>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: reserved name for variables

2015-05-10 Thread Vincent Delecroix
Should I take your e-mail only for 'var'? What about PolynomialRing?
Should we just allow the creation of such variable name but add a
warning in the inject_variables function?

I am worried of making impossible the use of 'as' or 'or' as variable
names. The following looks like a plausible Sage usage

sage: alpha ='abcdefghijklmnopqrstuvwxyz'
sage: PolynomialRing(ZZ, [i+j for i in alpha for j in alpha])

On 10/05/15 22:54, Volker Braun wrote:
> The checking in symbolic rings should be moved to sage.repl.user_globals 
> and hooked into set_global.
> 
> As for part 2, "None" is not a reserved keyword in Python2 so its in 
> principle perfectly legal to use as identifier. Though it was later on 
> specifically disallowed to assign to None, but assignment to True/False is 
> still possible. This is fixed in Python3 where None, True, False become 
> keywords.
> 
> We should probably exclude Python builtin names for that as well, i.e. 
> dir(__builtin__), not because its not legal but because its mighty 
> confusing to redefine int/str/id/all/...
>
> On Sunday, May 10, 2015 at 10:26:25 PM UTC+2, vdelecroix wrote:
>>
>> Hello, 
>>
>> What should we do with variable names like 'or', 'and', ... This does 
>> not break uniformly 
>>
>> The symbolic ring refuses the creation of such variable 
>> {{{ 
>> sage: SR.var('and') 
>> Traceback (most recent call last): 
>> ... 
>> ValueError: The name "and" is not a valid Python identifier. 
>> }}} 
>>
>> whereas polynomial rings silently fail 
>> {{{ 
>> sage: R = PolynomialRing(QQ, ('and', 'or')) 
>> sage: R.inject_variables() 
>> Defining and, or 
>> sage: and 
>> ... 
>> SyntaxError: invalid syntax 
>> sage: 'and' in globals() 
>> True 
>> }}} 
>>
>> Vincent 
>>
> 

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: File permissions on a debian install

2015-05-10 Thread Volker Braun
Your terminal doesn't understand utf-8 (are you local or ssh-ing in?)

The file permissions look ok, anything that is in the git repo has 755 or 
644 because that the only two possible permissions that git knows about. 
Your umask seems to be restrictive, which causes all newly-generated files 
to have 700 or 600, but that shouldn't be a problem.




On Sunday, May 10, 2015 at 10:47:54 PM UTC+2, Andrew wrote:
>
> I cloned sage from git://github.com/sagemath/sage.git and then built 
> version 6.6 on a system running debian wheezy 7.8. It seems to run fine 
> except that the prompt is screwy:
>
> > sage
> ââ 
> SageMath Version 6.6, Release Date: 2015-04-14 â
> â Type "notebook()" for the browser-based notebook interface.â
> â Type "help()" for help.â
> ââsage
> : 
>
> and the command-line options don't seem to work. For example,  sage -h 
> returns:
>
>
> ââ 
> SageMath Version 6.6, Release Date: 2015-04-14 â
> ââ
>
> What I find most strange, however, is that the file permissions in  
> SAGE_ROOT are all wrong:
>
> -rw---  1 mathas   11 May  8 19:06 .BUILDSTART
> drwxr-xr-x  5 mathas 4.0K May  7 16:28 .git/
> -rw-r--r--  1 mathas  842 Apr 29 14:31 .gitignore
> -rw-r--r--  1 mathas  69K Apr 29 14:31 COPYING.txt
> -rw-r--r--  1 mathas 5.8K Apr 29 14:31 Makefile
> -rw-r--r--  1 mathas  14K Apr 29 14:31 README.txt
> -rw-r--r--  1 mathas   38 Apr 29 14:31 VERSION.txt
> -rwxr-xr-x  1 mathas 3.6K Apr 29 14:31 bootstrap*
> drwxr-xr-x  3 mathas 4.0K May  8 12:52 build/
> drwx--  2 mathas 4.0K Apr 29 14:35 config/
> lrwxrwxrwx  1 mathas   20 May  8 12:52 config.log -> logs/pkgs/config.log
> -rwx--  1 mathas  30K May  8 12:52 config.status*
> -rwx--  1 mathas 238K Apr 29 14:35 configure*
> -rw-r--r--  1 mathas  26K Apr 29 14:31 configure.ac
> drwx-- 11 mathas 4.0K May  9 08:00 local/
> drwx--  3 mathas 4.0K May  9 08:06 logs/
> drwxr-xr-x  2 mathas 4.0K Apr 29 14:31 m4/
> -rwxr-xr-x  1 mathas 4.8K Apr 29 14:31 sage*
> drwxr-xr-x 10 mathas 4.0K May  9 07:25 src/
> drwx--  2 mathas 4.0K Apr 29 21:38 upstream/
>  
> Of course I can fix these by hand so that my student can use this. I'm 
> just wondering whether this is something that I have done or whether it's a 
> known issue.
> Andrew
>
>
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: reserved name for variables

2015-05-10 Thread Volker Braun
The checking in symbolic rings should be moved to sage.repl.user_globals 
and hooked into set_global.

As for part 2, "None" is not a reserved keyword in Python2 so its in 
principle perfectly legal to use as identifier. Though it was later on 
specifically disallowed to assign to None, but assignment to True/False is 
still possible. This is fixed in Python3 where None, True, False become 
keywords.

We should probably exclude Python builtin names for that as well, i.e. 
dir(__builtin__), not because its not legal but because its mighty 
confusing to redefine int/str/id/all/...





On Sunday, May 10, 2015 at 10:26:25 PM UTC+2, vdelecroix wrote:
>
> Hello, 
>
> What should we do with variable names like 'or', 'and', ... This does 
> not break uniformly 
>
> The symbolic ring refuses the creation of such variable 
> {{{ 
> sage: SR.var('and') 
> Traceback (most recent call last): 
> ... 
> ValueError: The name "and" is not a valid Python identifier. 
> }}} 
>
> whereas polynomial rings silently fail 
> {{{ 
> sage: R = PolynomialRing(QQ, ('and', 'or')) 
> sage: R.inject_variables() 
> Defining and, or 
> sage: and 
> ... 
> SyntaxError: invalid syntax 
> sage: 'and' in globals() 
> True 
> }}} 
>
> Vincent 
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] File permissions on a debian install

2015-05-10 Thread Andrew
I cloned sage from git://github.com/sagemath/sage.git and then built 
version 6.6 on a system running debian wheezy 7.8. It seems to run fine 
except that the prompt is screwy:

> sage
ââ 
SageMath Version 6.6, Release Date: 2015-04-14 â
â Type "notebook()" for the browser-based notebook interface.â
â Type "help()" for help.â
ââsage: 

and the command-line options don't seem to work. For example,  sage -h 
returns:


ââ 
SageMath Version 6.6, Release Date: 2015-04-14 â
ââ

What I find most strange, however, is that the file permissions in  
SAGE_ROOT are all wrong:

-rw---  1 mathas   11 May  8 19:06 .BUILDSTART
drwxr-xr-x  5 mathas 4.0K May  7 16:28 .git/
-rw-r--r--  1 mathas  842 Apr 29 14:31 .gitignore
-rw-r--r--  1 mathas  69K Apr 29 14:31 COPYING.txt
-rw-r--r--  1 mathas 5.8K Apr 29 14:31 Makefile
-rw-r--r--  1 mathas  14K Apr 29 14:31 README.txt
-rw-r--r--  1 mathas   38 Apr 29 14:31 VERSION.txt
-rwxr-xr-x  1 mathas 3.6K Apr 29 14:31 bootstrap*
drwxr-xr-x  3 mathas 4.0K May  8 12:52 build/
drwx--  2 mathas 4.0K Apr 29 14:35 config/
lrwxrwxrwx  1 mathas   20 May  8 12:52 config.log -> logs/pkgs/config.log
-rwx--  1 mathas  30K May  8 12:52 config.status*
-rwx--  1 mathas 238K Apr 29 14:35 configure*
-rw-r--r--  1 mathas  26K Apr 29 14:31 configure.ac
drwx-- 11 mathas 4.0K May  9 08:00 local/
drwx--  3 mathas 4.0K May  9 08:06 logs/
drwxr-xr-x  2 mathas 4.0K Apr 29 14:31 m4/
-rwxr-xr-x  1 mathas 4.8K Apr 29 14:31 sage*
drwxr-xr-x 10 mathas 4.0K May  9 07:25 src/
drwx--  2 mathas 4.0K Apr 29 21:38 upstream/
 
Of course I can fix these by hand so that my student can use this. I'm just 
wondering whether this is something that I have done or whether it's a 
known issue.
Andrew


-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: reserved name for variables

2015-05-10 Thread Vincent Delecroix
More subtle issue that isn't detected in the symbolic ring

sage: var('None')
None
sage: parent(None)


On 10/05/15 22:26, Vincent Delecroix wrote:
> Hello,
> 
> What should we do with variable names like 'or', 'and', ... This does
> not break uniformly
> 
> The symbolic ring refuses the creation of such variable
> {{{
> sage: SR.var('and')
> Traceback (most recent call last):
> ...
> ValueError: The name "and" is not a valid Python identifier.
> }}}
> 
> whereas polynomial rings silently fail
> {{{
> sage: R = PolynomialRing(QQ, ('and', 'or'))
> sage: R.inject_variables()
> Defining and, or
> sage: and
> ...
> SyntaxError: invalid syntax
> sage: 'and' in globals()
> True
> }}}
> 
> Vincent
> 

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] reserved name for variables

2015-05-10 Thread Vincent Delecroix
Hello,

What should we do with variable names like 'or', 'and', ... This does
not break uniformly

The symbolic ring refuses the creation of such variable
{{{
sage: SR.var('and')
Traceback (most recent call last):
...
ValueError: The name "and" is not a valid Python identifier.
}}}

whereas polynomial rings silently fail
{{{
sage: R = PolynomialRing(QQ, ('and', 'or'))
sage: R.inject_variables()
Defining and, or
sage: and
...
SyntaxError: invalid syntax
sage: 'and' in globals()
True
}}}

Vincent

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: upgrade Python to 2.7.9 (#18397)

2015-05-10 Thread Volker Braun
I worked with urllib3 (bundled with pip) to get rid of the ssl dependency, 
so thats one step towards using pip without ssl. I don't know if pip has 
upgraded the bundled urllib3 or if there are any other ssl dependencies in 
pip though.



On Sunday, May 10, 2015 at 9:55:20 PM UTC+2, Dima Pasechnik wrote:
>
>
>
> On Sunday, 10 May 2015 20:48:23 UTC+1, Volker Braun wrote:
>>
>> On Sunday, May 10, 2015 at 9:39:54 PM UTC+2, Dima Pasechnik wrote:
>>>
>>>
>>>- On the other hand it looks like pip has been incorporated into 
>>>Python proper. (https://docs.python.org/2/library/ensurepip.html is 
>>>in 2.7.9)
>>>
>>> Does it mean that the pip spkg could be removed?
>>>
>>
>> Its just an alternative way to install pip:
>>
>> The ensurepip package provides support for bootstrapping the pip 
>> installer into an existing Python installation or virtual environment. This 
>> bootstrapping approach reflects the fact that pip is an independent project 
>> with its own release cycle, and the latest available stable version is 
>> bundled with maintenance and feature releases of the CPython reference 
>> interpreter.
>>
>> In most cases, end users of Python shouldn’t need to invoke this module 
>> directly (as pip should be bootstrapped by default), but it may be needed 
>> if installing pip was skipped when installing Python (or when creating a 
>> virtual environment) or after explicitly uninstalling pip.
>>
>
> As far as I understand, at present pip cannot be installed directly in 
> Sage as it needs ssl. On the other hand it looks that 2.7.9 gets more ssl 
> support. Does it mean that pip can be installed by default if we move to 
> 2.7.9?
>
>   
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: upgrade Python to 2.7.9 (#18397)

2015-05-10 Thread Dima Pasechnik


On Sunday, 10 May 2015 20:48:23 UTC+1, Volker Braun wrote:
>
> On Sunday, May 10, 2015 at 9:39:54 PM UTC+2, Dima Pasechnik wrote:
>>
>>
>>- On the other hand it looks like pip has been incorporated into 
>>Python proper. (https://docs.python.org/2/library/ensurepip.html is 
>>in 2.7.9)
>>
>> Does it mean that the pip spkg could be removed?
>>
>
> Its just an alternative way to install pip:
>
> The ensurepip package provides support for bootstrapping the pip installer 
> into an existing Python installation or virtual environment. This 
> bootstrapping approach reflects the fact that pip is an independent project 
> with its own release cycle, and the latest available stable version is 
> bundled with maintenance and feature releases of the CPython reference 
> interpreter.
>
> In most cases, end users of Python shouldn’t need to invoke this module 
> directly (as pip should be bootstrapped by default), but it may be needed 
> if installing pip was skipped when installing Python (or when creating a 
> virtual environment) or after explicitly uninstalling pip.
>

As far as I understand, at present pip cannot be installed directly in Sage 
as it needs ssl. On the other hand it looks that 2.7.9 gets more ssl 
support. Does it mean that pip can be installed by default if we move to 
2.7.9?

  

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: upgrade Python to 2.7.9 (#18397)

2015-05-10 Thread Volker Braun
On Sunday, May 10, 2015 at 9:39:54 PM UTC+2, Dima Pasechnik wrote:
>
>
>- On the other hand it looks like pip has been incorporated into 
>Python proper. (https://docs.python.org/2/library/ensurepip.html is in 
>2.7.9)
>
> Does it mean that the pip spkg could be removed?
>

Its just an alternative way to install pip:

The ensurepip package provides support for bootstrapping the pip installer 
into an existing Python installation or virtual environment. This 
bootstrapping approach reflects the fact that pip is an independent project 
with its own release cycle, and the latest available stable version is 
bundled with maintenance and feature releases of the CPython reference 
interpreter.

In most cases, end users of Python shouldn’t need to invoke this module 
directly (as pip should be bootstrapped by default), but it may be needed 
if installing pip was skipped when installing Python (or when creating a 
virtual environment) or after explicitly uninstalling pip.


-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: upgrade Python to 2.7.9 (#18397)

2015-05-10 Thread Dima Pasechnik
there might be ssl-related surprises, 
as https://www.python.org/downloads/release/python-279/ says:


   - The entirety of Python 3.4's ssl module 
    has been backported for 
   Python 2.7.9. See PEP 466  for 
   justification.
   - HTTPS certificate validation using the system's certificate store is 
   now enabled by default. See PEP 476 
    for details.
   - SSLv3 has been disabled by default in httplib and its reverse 
   dependencies due to the POODLE attack 
   .
   - The ensurepip module  
module 
   has been backported, which provides the pip package manager in every Python 
   2.7 installation. See PEP 477 
   .

On the other hand it looks like pip has been incorporated into Python 
proper. (https://docs.python.org/2/library/ensurepip.html is in 2.7.9)
Does it mean that the pip spkg could be removed?




On Sunday, 10 May 2015 20:02:52 UTC+1, Volker Braun wrote:
>
> There are only minimal changes in python 2.x, its imho always safe to 
> upgrade
>
> On Sunday, May 10, 2015 at 7:28:05 PM UTC+2, Dima Pasechnik wrote:
>>
>> Should this be done in 6.7?
>>
>> http://trac.sagemath.org/ticket/18397
>>
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: upgrade Python to 2.7.9 (#18397)

2015-05-10 Thread Volker Braun
There are only minimal changes in python 2.x, its imho always safe to 
upgrade

On Sunday, May 10, 2015 at 7:28:05 PM UTC+2, Dima Pasechnik wrote:
>
> Should this be done in 6.7?
>
> http://trac.sagemath.org/ticket/18397
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] upgrade Python to 2.7.9 (#18397)

2015-05-10 Thread Dima Pasechnik
Should this be done in 6.7?

http://trac.sagemath.org/ticket/18397

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython

2015-05-10 Thread William Stein
On Fri, May 8, 2015 at 3:54 PM, Volker Braun  wrote:
> I've never seen that.
>
> Just to point out the obvious, [...]

OK, that was basically the problem.  Thanks!

(Details: I figured this out (or rather Volker's suggestion did it).
The code that saves a project to remote storage (on close) and checks
it out (on open) wasn't including core files, since that could waste
space.  This same code was used for migrating files from UW.   Numpy
and IPython both have a directories called "core", so they got deleted
and the sage installs broken.   Typing

  ./sage -f ipython numpy

fixes the problem... as far as I know.)

you don't have a coredump "core" file lying
> around in cwd or the ipython tree? That might mess up the "from core
> import"..
>
>
>
> On Friday, May 8, 2015 at 11:48:36 PM UTC+2, William wrote:
>>
>> Hi,
>>
>> Why is this happening?
>>
>> 1. I build sage.
>>
>> 2. I make a binary.
>>
>> 3. I extract the binary on an identical machine and start it and get
>> "ImportError: No module named core.getipython".
>>
>> 4. Doing ./sage -f ipython fixes the problem.
>>
>> I've seen this issue in all kinds of places lately.  What is ipython
>> messing up?
>>
>> ~$ cd sage-6.7.beta4/
>> ~/sage-6.7.beta4$ ./sage
>> ┌┐
>> │ SageMath Version 6.7.beta4, Release Date: 2015-05-05   │
>> │ Type "notebook()" for the browser-based notebook interface.│
>> │ Type "help()" for help.│
>> └┘
>> ┏┓
>> ┃ Warning: this is a prerelease version, and it may be unstable. ┃
>> ┗┛
>> Traceback (most recent call last):
>>   File
>> "/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/src/bin/sage-ipython",
>> line 7, in 
>> from sage.repl.interpreter import SageTerminalApp
>>   File
>> "/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/__init__.py",
>> line 3, in > ule>
>> from sage.repl.ipython_extension import load_ipython_extension
>>   File
>> "/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/repl/ipython_extension.py",
>> l
>> ine 59, in 
>> from IPython.core.magic import Magics, magics_class, line_magic
>>   File
>> "/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/IPython/__init__.py",
>> line 46, in
>> 
>> from .core.getipython import get_ipython
>> ImportError: No module named core.getipython
>> ~/sage-6.7.beta4$ ./sage -f ipython
>
> --
> 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 http://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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Use mirrors

2015-05-10 Thread leif
Volker Braun wrote:
> Define "static list of mirrors".

const char *default_mirror_list[48]=
{
  "http://sagemath.polytechnic.edu.na/";,
  "ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/";,
  "http://sagemath.mirror.ac.za/";,
  "http://sagemath.mirror.tn/";,
  "http://ftp.leg.uct.ac.za/pub/packages/sage/";,
  "http://mirrors-usa.go-parts.com/sage/";,
  "http://modular.fas.harvard.edu/sage/";,
  "http://mirrors.hub.co/sage/";,
  "http://modular.math.jmu.edu/";,
  "http://sage.scipy.org/sage/";,
  "http://www.cecm.sfu.ca/sage/";,
  "http://sage.technocozy.com/";,
  "http://mirror.clibre.uqam.ca/sage/";,
  "http://mirrors.xmission.com/sage/";,
  "http://sagemath.c3sl.ufpr.br/";,
  "http://linorg.usp.br/sage/";,
  "http://sage.asis.io/";,
  "http://mirrors.hustunique.com/sagemath/";,
  "http://mirror.hust.edu.cn/sagemath/";,
  "http://ftp.iitm.ac.in/sage/";,
  "http://mirror.unej.ac.id/mirrors/sage/";,
  "http://ftp.kaist.ac.kr/sage/";,
  "http://jambu.spms.ntu.edu.sg/sage/";,
  "http://ftp.riken.jp/sagemath/";,
  "http://mirrors.tuna.tsinghua.edu.cn/sagemath/";,
  "http://mirrors.ustc.edu.cn/sagemath/";,
  "http://ftp.tsukuba.wide.ad.jp/software/sage/";,
  "http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/";,
  "http://mirror.yandex.ru/mirrors/sage.math.washington.edu/";,
  "http://sage.yasar.edu.tr/";,
  "http://mirror.yongbok.net/sage/";,
  "http://mirror.aarnet.edu.au/pub/sage/";,
  "http://echidna.maths.usyd.edu.au/sage/";,
  "ftp://ftp.fu-berlin.de/unix/misc/sage/";,
  "http://sage.mirror.garr.it/mirrors/sage/";,
  "http://mirrors-uk.go-parts.com/sage/";,
  "http://mirrors-ru.go-parts.com/sage/";,
  "http://www-eu-1.sagedev.org/mirror/";,
  "http://www.mirrorservice.org/sites/www.sagemath.org/";,
  "http://sunsite.rediris.es/mirror/sagemath/";,
  "http://mirror.switch.ch/mirror/sagemath/";,
  "http://sage.Igor.onlineDirect.bg/";,
  "http://servingzone.com/mirrors/sage/";,
  "http://ftp.sh.cvut.cz/MIRRORS/sagemath/";,
  "http://mirrors.fe.up.pt/pub/sage/";,
  "http://www-ftp.lip6.fr/pub/math/sagemath/";,
  "http://ftp.ntua.gr/pub/sagemath/";,
  NULL
};

More seriously:

The ones currently *known* to us (perhaps excluding those that appear to
have definitely gone/have never(?) been set up like sage.scipy.org, but
including the ones that are currently not available).


> On Sunday, May 10, 2015 at 4:10:28 PM UTC+2, leif wrote:
> 
> since we now benchmark the mirrors in sage-download-file ourselves).
> 
> 
> We don't (until #15642 is reviewed)

Until it is merged and released.

But anyone can pull the branch already; it appears to be functional (atm).

[Please pull, build, test, review and report back!]TM


-leif


-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: max(sin(x),cos(x)) = sin(x)

2015-05-10 Thread Travis Scrimshaw
It is also worth mentioning that in our python code (i.e., the Sage library 
code), it uses the python functions (and int's, which can bite from time to 
time).

Best,
Travis


On Sunday, May 10, 2015 at 8:36:00 AM UTC-7, Nils Bruin wrote:
>
> On Sunday, May 10, 2015 at 2:22:49 AM UTC-7, vdelecroix wrote:
>>
>> > But that is precisely the problem: we are halfway through replacing 
>> > Python's functions with symbolic functions. Cos, sin, log, sqrt, abs. 
>> > All these are already overwritten by Sage symbolic equivalents. Though 
>> > not 'min' and 'max'. We should do it for all or for none, shouldn't 
>> > we? By not respecting any standard convention we are making it 
>> > unreliable. 
>>
>> cos is different from max. cos is in a Python library (math for 
>> instance) while max is a builtin. 
>>
>
> Perhaps sum is a better example. We do override it, it has an interface 
> that is comparable to that of max, and the performance penalty for 
> overriding it in sage is huge:
>
>  sage: L=[1,2,3,4,5]
> sage: %timeit sum(L)
> 100 loops, best of 3: 1.32 µs per loop
> sage: %timeit __builtin__.sum(L)
> 100 loops, best of 3: 387 ns per loop
>
> Sum, however, gives access to a fundamental symbolic construct that is 
> genuinely unavailable via the python routine. The results from 
> symbolic_min/symbolic_max are rarely useful (because we hardly support any 
> non-trivial automatic manipulation of these things), so there is an 
> argument to be made that the performance penalty isn't worth the gain.
>
> In that case we'd need to raise an exception on bool(sin(x) than "false for don't know", because clearly a silent erroneous result, as 
> we get now, is unacceptable if sum(1/n^2,n,1,oo) does work.
>
> And then it gets complicated, because then the domain starts playing a 
> role: Do we get an exception from bool(sin(x) this doesn't hold work? Luckily we don't have much compatibility to worry 
> about, since symbolic equalities have very poor functionality anyway:
>
> sage: bool(sin(x)^2+cos(x)^2==1)
> True
> sage: bool(sin(x)^2+cos(x)^2<=1)
> False
>
> so perhaps current;ly symbolic inequalities are just convenient to ship 
> constraints to linear programming routines?
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: max(sin(x),cos(x)) = sin(x)

2015-05-10 Thread Nils Bruin
On Sunday, May 10, 2015 at 2:22:49 AM UTC-7, vdelecroix wrote:
>
> > But that is precisely the problem: we are halfway through replacing 
> > Python's functions with symbolic functions. Cos, sin, log, sqrt, abs. 
> > All these are already overwritten by Sage symbolic equivalents. Though 
> > not 'min' and 'max'. We should do it for all or for none, shouldn't 
> > we? By not respecting any standard convention we are making it 
> > unreliable. 
>
> cos is different from max. cos is in a Python library (math for 
> instance) while max is a builtin. 
>

Perhaps sum is a better example. We do override it, it has an interface 
that is comparable to that of max, and the performance penalty for 
overriding it in sage is huge:

 sage: L=[1,2,3,4,5]
sage: %timeit sum(L)
100 loops, best of 3: 1.32 µs per loop
sage: %timeit __builtin__.sum(L)
100 loops, best of 3: 387 ns per loop

Sum, however, gives access to a fundamental symbolic construct that is 
genuinely unavailable via the python routine. The results from 
symbolic_min/symbolic_max are rarely useful (because we hardly support any 
non-trivial automatic manipulation of these things), so there is an 
argument to be made that the performance penalty isn't worth the gain.

In that case we'd need to raise an exception on bool(sin(x)http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Use mirrors

2015-05-10 Thread Volker Braun
Define "static list of mirrors". They are outside of our control.

On Sunday, May 10, 2015 at 4:10:28 PM UTC+2, leif wrote:
>
> since we now benchmark the mirrors in sage-download-file ourselves). 
>

We don't (until #15642 is reviewed)


-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Commit 02ba7045cf38725ca8cb5456df649b6bacdcbd8e deleted

2015-05-10 Thread Volker Braun
I think it would be easy to disallow changes to the commit field in our 
trac plugin (except for the git hook of course). Just needs somebody to 
implement it.



On Sunday, May 10, 2015 at 3:07:45 PM UTC+2, leif wrote:
>
> Dear trac experts, 
>
> is this necessary? 
>
> (As you will know, it happens each time somebody comments on an already 
> closed ticket with a branch.) 
>
> While it doesn't really hurt, it's pretty annoying. 
>
>
> -leif 
>
> DISCLAIMER:  I'm almost sure this has come up before, but I'm too lazy 
> to search the "forums" -- I'd presumably get hundreds of unrelated hits. 
>
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Use mirrors

2015-05-10 Thread leif
Samuel Lelievre wrote:
> kcrisman:
> 
> I'm surprised that there wouldn't be any US institution willing to
> host a mirror.
> 
> There is a mirror at MIT, both http and rsync:
> 
> http://mirrors.mit.edu/sage/
> rsync://mirrors.mit.edu/sage

... which raises the question whether there's also a publicly accessible
*static* list of Sage mirrors (probably more appropriate for casual use,
since we now benchmark the mirrors in sage-download-file ourselves).

http://www.sagemath.org/mirrors.html for example lists nine mirrors for
North America, of which only four appear to currently be available; at
least sage.scipy.org seems obsolete (it isn't set up at all).  The
mirror at MIT mentioned above is not among these nine; Harvard is, but
appears to be down.


-leif


-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Use mirrors

2015-05-10 Thread Dima Pasechnik


On Sunday, 10 May 2015 14:20:08 UTC+1, Samuel Lelievre wrote:
>
>
> kcrisman: 
>>
>> I'm surprised that there wouldn't be any US institution willing to host a 
>> mirror.
>>
>
>
> There is a mirror at MIT, both http and rsync:
>
> http://mirrors.mit.edu/sage/
> rsync://mirrors.mit.edu/sage
>
> but is that the question or is the question about
> where to host the master mirror?
>

it seems that links like http://sagemath.org/download-source.html
don't show the full list of mirrors (e.g. the MIT one is up-to date).
 

>
> Samuel
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Use mirrors

2015-05-10 Thread Samuel Lelievre

kcrisman: 
>
> I'm surprised that there wouldn't be any US institution willing to host a 
> mirror.
>


There is a mirror at MIT, both http and rsync:

http://mirrors.mit.edu/sage/
rsync://mirrors.mit.edu/sage

but is that the question or is the question about
where to host the master mirror?

Samuel

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython

2015-05-10 Thread William Stein
On Sun, May 10, 2015 at 5:59 AM, David Roe  wrote:
> On a related note, I get a similar error from within Sage.  When I try to
> create a free Z-module, Sage gives me an ImportError for core.numeric
> (traceback included below).  With this thread in mind, I tried reinstalling
> ipython, but `make build` fails as well with a similar import error.

You should toss that sage install and start over...   The underlying
machine architecture has changed (Opteron --> Intell) and the OS
(Ubuntu 14.10->15.04).

>
> sage: M = FreeModule(ZZ,2)
> ---
> ImportError   Traceback (most recent call last)
>  in ()
> > 1 M = FreeModule(ZZ,Integer(2))
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/src/sage/structure/factory.pyx
> in sage.structure.factory.UniqueFactory.__call__
> (build/cythonized/sage/structure/factory.c:1379)()
> 364 key, kwds = self.create_key_and_extra_args(*args, **kwds)
> 365 version = self.get_version(sage_version)
> --> 366 return self.get_object(version, key, kwds)
> 367
> 368 cpdef get_object(self, version, key, extra_args):
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/src/sage/structure/factory.pyx
> in sage.structure.factory.UniqueFactory.get_object
> (build/cythonized/sage/structure/factory.c:1753)()
> 408 except KeyError:
> 409 pass
> --> 410 obj = self.create_object(version, key, **extra_args)
> 411 self._cache[version, cache_key] = obj
> 412 try:
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
> in create_object(self, version, key)
> 371
> 372 elif base_ring in PrincipalIdealDomains():
> --> 373 return FreeModule_ambient_pid(base_ring, rank,
> sparse=sparse)
> 374
> 375 elif isinstance(base_ring,
> sage.rings.number_field.order.Order) \
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
> in __init__(self, base_ring, rank, sparse, coordinate_ring)
>4914 """
>4915 FreeModule_ambient_domain.__init__(self,
> base_ring=base_ring,
> -> 4916 rank=rank, sparse=sparse,
> coordinate_ring=coordinate_ring)
>4917
>4918 def _repr_(self):
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
> in __init__(self, base_ring, rank, sparse, coordinate_ring)
>4723 """
>4724 FreeModule_ambient.__init__(self, base_ring,
> -> 4725 rank, sparse, coordinate_ring)
>4726
>4727 def _repr_(self):
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
> in __init__(self, base_ring, rank, sparse, coordinate_ring)
>4088 """
>4089 FreeModule_generic.__init__(self, base_ring, rank=rank,
> -> 4090 degree=rank, sparse=sparse,
> coordinate_ring=coordinate_ring)
>4091
>4092 def __hash__(self):
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
> in __init__(self, base_ring, rank, degree, sparse, coordinate_ring,
> category)
> 724
> 725 if not hasattr(self, 'Element'):
> --> 726 self.Element = ent_class(coordinate_ring, sparse)
> 727
> 728 rank = sage.rings.integer.Integer(rank)
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
> in element_class(R, is_sparse)
>6737  'sage.modules.free_module_element.FreeModuleElement_generic_dense'>
>6738 """
> -> 6739 import sage.modules.vector_real_double_dense
>6740 import sage.modules.vector_complex_double_dense
>6741
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/src/sage/modules/vector_real_double_dense.pyx
> in init sage.modules.vector_real_double_dense
> (build/cythonized/sage/modules/vector_real_double_dense.c:6099)()
> > 1 r"""
>   2 Dense real double vectors using a Py backend.
>   3
>   4 EXAMPLES:
>   5 sage: v = vector(RDF,[1, pi, sqrt(2)])
>
> __init__.pxd in init sage.modules.vector_double_dense
> (build/cythonized/sage/modules/vector_double_dense.c:11673)()
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/numpy/__init__.py
> in ()
> 151 return loader(*packages, **options)
> 152
> --> 153 from . import add_newdocs
> 154 __all__ = ['add_newdocs', 'ModuleDeprecationWarning']
> 155
>
> /projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packa

[sage-devel] Commit 02ba7045cf38725ca8cb5456df649b6bacdcbd8e deleted

2015-05-10 Thread leif
Dear trac experts,

is this necessary?

(As you will know, it happens each time somebody comments on an already
closed ticket with a branch.)

While it doesn't really hurt, it's pretty annoying.


-leif

DISCLAIMER:  I'm almost sure this has come up before, but I'm too lazy
to search the "forums" -- I'd presumably get hundreds of unrelated hits.

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython

2015-05-10 Thread David Roe
On a related note, I get a similar error from within Sage.  When I try to
create a free Z-module, Sage gives me an ImportError for core.numeric
(traceback included below).  With this thread in mind, I tried reinstalling
ipython, but `make build` fails as well with a similar import error.

sage: M = FreeModule(ZZ,2)
---
ImportError   Traceback (most recent call last)
 in ()
> 1 M = FreeModule(ZZ,Integer(2))

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/src/sage/structure/factory.pyx
in sage.structure.factory.UniqueFactory.__call__
(build/cythonized/sage/structure/factory.c:1379)()
364 key, kwds = self.create_key_and_extra_args(*args, **kwds)
365 version = self.get_version(sage_version)
--> 366 return self.get_object(version, key, kwds)
367
368 cpdef get_object(self, version, key, extra_args):

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/src/sage/structure/factory.pyx
in sage.structure.factory.UniqueFactory.get_object
(build/cythonized/sage/structure/factory.c:1753)()
408 except KeyError:
409 pass
--> 410 obj = self.create_object(version, key, **extra_args)
411 self._cache[version, cache_key] = obj
412 try:

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
in create_object(self, version, key)
371
372 elif base_ring in PrincipalIdealDomains():
--> 373 return FreeModule_ambient_pid(base_ring, rank,
sparse=sparse)
374
375 elif isinstance(base_ring,
sage.rings.number_field.order.Order) \

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
in __init__(self, base_ring, rank, sparse, coordinate_ring)
   4914 """
   4915 FreeModule_ambient_domain.__init__(self,
base_ring=base_ring,
-> 4916 rank=rank, sparse=sparse,
coordinate_ring=coordinate_ring)
   4917
   4918 def _repr_(self):

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
in __init__(self, base_ring, rank, sparse, coordinate_ring)
   4723 """
   4724 FreeModule_ambient.__init__(self, base_ring,
-> 4725 rank, sparse, coordinate_ring)
   4726
   4727 def _repr_(self):

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
in __init__(self, base_ring, rank, sparse, coordinate_ring)
   4088 """
   4089 FreeModule_generic.__init__(self, base_ring, rank=rank,
-> 4090 degree=rank, sparse=sparse,
coordinate_ring=coordinate_ring)
   4091
   4092 def __hash__(self):

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
in __init__(self, base_ring, rank, degree, sparse, coordinate_ring,
category)
724
725 if not hasattr(self, 'Element'):
--> 726 self.Element = ent_class(coordinate_ring, sparse)
727
728 rank = sage.rings.integer.Integer(rank)

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/sage/modules/free_module.pyc
in element_class(R, is_sparse)
   6737 
   6738 """
-> 6739 import sage.modules.vector_real_double_dense
   6740 import sage.modules.vector_complex_double_dense
   6741

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/src/sage/modules/vector_real_double_dense.pyx
in init sage.modules.vector_real_double_dense
(build/cythonized/sage/modules/vector_real_double_dense.c:6099)()
> 1 r"""
  2 Dense real double vectors using a Py backend.
  3
  4 EXAMPLES:
  5 sage: v = vector(RDF,[1, pi, sqrt(2)])

__init__.pxd in init sage.modules.vector_double_dense
(build/cythonized/sage/modules/vector_double_dense.c:11673)()

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/numpy/__init__.py
in ()
151 return loader(*packages, **options)
152
--> 153 from . import add_newdocs
154 __all__ = ['add_newdocs', 'ModuleDeprecationWarning']
155

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/numpy/add_newdocs.py
in ()
 11 from __future__ import division, absolute_import, print_function
 12
---> 13 from py.lib import add_newdoc
 14
 15
###

/projects/612668ee-534c-456b-a5e8-81078cffd9c6/sage-6.7.beta4/local/lib/python2.7/site-packages/numpy/lib/__init__.py
in ()
  6 from py.version import version as __version__
  7
> 8 from .type_check import *
  

Re: [sage-devel] Re: max(sin(x),cos(x)) = sin(x)

2015-05-10 Thread Nathann Cohen
> cos is different from max. cos is in a Python library (math for
> instance) while max is a builtin.

We preparse integers, Vincent. We already change Python's default
behaviour. Look how schizophrenic we are about users:
- Volker said that it was a "breach of Sage's mission statement" to
not output pictures of objects that can esily be drawn, because users
expect it.
- We preparse integers so that 3/2 is not 1
- sqrt(2) is symbolic
- max(cos(x),0) is cos(x) because we cannot override Python builtins
- var('x') is thought to be bad because "we cannot expect everybody to
understand the difference between a Python variable and a symbolic
variable

It's like for everything we do we have a different picture of the end
user in mind. To me it would make sense if we said that global
namespace functions can be slow but are safe, and that if you need
more speed then you must load and use the appropriate functions.

Nathann

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: max(sin(x),cos(x)) = sin(x)

2015-05-10 Thread Vincent Delecroix


On 10/05/15 11:20, Nathann Cohen wrote:
> Yo !
> 
>> Secondly, I think that we should not override any Python builtin.
> 
> There is no denying that all the symbolic stuff is infinitely slower.
> It is because of you that I started paying attention to it, when you
> gained a crazy speedup by using math.sqrt instead of Sage's sqrt.
> 
> But that is precisely the problem: we are halfway through replacing
> Python's functions with symbolic functions. Cos, sin, log, sqrt, abs.
> All these are already overwritten by Sage symbolic equivalents. Though
> not 'min' and 'max'. We should do it for all or for none, shouldn't
> we? By not respecting any standard convention we are making it
> unreliable.

cos is different from max. cos is in a Python library (math for
instance) while max is a builtin.

this works

 $ python -c "print max(1,3)"

this does not

 $ python -c "print cos(1)"

Vincent

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: max(sin(x),cos(x)) = sin(x)

2015-05-10 Thread Nathann Cohen
Yo !

> Secondly, I think that we should not override any Python builtin.

There is no denying that all the symbolic stuff is infinitely slower.
It is because of you that I started paying attention to it, when you
gained a crazy speedup by using math.sqrt instead of Sage's sqrt.

But that is precisely the problem: we are halfway through replacing
Python's functions with symbolic functions. Cos, sin, log, sqrt, abs.
All these are already overwritten by Sage symbolic equivalents. Though
not 'min' and 'max'. We should do it for all or for none, shouldn't
we? By not respecting any standard convention we are making it
unreliable.

Nathann

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: residue produces incorrect results

2015-05-10 Thread Benjamin Hackl
Hi Ralf!

Well, no; I wasn't aware of the overview -- thanks for showing me. In 
principle, the wrong behavior of residue can be contributed to 
http://trac.sagemath.org/ticket/9555 -- except for the case where the 
singularity is not recognized, I guess. But that can be fixed in the ticket I 
opened.

Nevertheless, I believe that in order to fix the issue with series expansions 
at singular points (or at least to improve the current situation), the 
implementation in Pynac will have to be adopted. I'm actually quite tempted to 
play around a bit and see if I can make some improvements -- however, there are 
quite a lot of open tasks within my GSoC proposal, and until that project 
starts I'm rather busy with my master's thesis. (Of course, series expansions 
are an integral part of asypmptotic expressions; but everything in due time...)

In any case, as I need singular expansions for my research, I'll most likely 
work on it sooner or later anyhow. Thanks for your support!

Kind regards,
Benjamin

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: max(sin(x),cos(x)) = sin(x)

2015-05-10 Thread Vincent Delecroix


On 10/05/15 06:58, Nathann Cohen wrote:
>> Just confirming that this conversation has been had before - can you think
>> of places where we might advertise this more boldly?  We certainly had
>> places we updated doc but maybe you can think of others, Nathann?
> 
> I do not think that this is an advertising problem. Not when 'log,
> sin, cos' are symbolic and all of a sudden max_symbolic and
> min_symbolic go by a different name. Does that different standard make
> sense to you?

Yes. I do not want a slow down with max(1,3) because it is a symbolic
function. You can compare

sage: from sage.functions.other import factorial as symb_fac
sage: from sage.rings.arith import factorial as arith_fac
sage: timeit("symb_fac(20)", number=2000)
625 loops, best of 3: 3.27 µs per loop
sage: sage: timeit("arith_fac(20)", number=2000)
2000 loops, best of 3: 1.51 µs per loop

or

sage: timeit("cos(2.0)", number=2000)
2000 loops, best of 3: 12.5 µs per loop
sage: timeit("(2.0).cos()", number=2000)
2000 loops, best of 3: 9.53 µs per loop

Secondly, I think that we should not override any Python builtin.
Otherwise people will have python files that will behave differently
from the console/notebook. And this is dangerous (there is already a lot
of troubles with Python int versus Sage Integer).

Vincent

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Expression.series() = PowerSeriesRing(SR)?

2015-05-10 Thread Benjamin Hackl
I'm strongly in favor of returning an element of PowerSeriesRing -- within 
the current 
implementation, this happens:

sage: (1/(1+x)).series(x, 2) + (1/(1-x)).series(x, 2)
(1 + (-1)*x + Order(x^2)) + (1 + 1*x + Order(x^2))
sage: (1/(1-x)).series(x, 2) * (1/(1+x)).series(x)
(1 + (-1)*x + Order(x^2))*(1 + 1*x + Order(x^2))

Kind regards, Benjamin

Am Sonntag, 10. Mai 2015 09:10:04 UTC+2 schrieb Ralf Stephan:
>
> Instead of duplicating power series functionality (existing in rings/) in 
> Pynac,
> where there is momentarily only a skeleton implementation that does not 
> even
> play nice with the rest of symbolics, the series method of Expression
> should return an element of PowerSeriesRing(SR).
>
> I think this would be the right design, and now is the right time to at 
> least
> commit to this decision. So, what can be brought against it?
>
> http://trac.sagemath.org/ticket/18393
>
>

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: polynomial ring (bis)

2015-05-10 Thread Nils Bruin
On Saturday, May 9, 2015 at 11:33:39 PM UTC-7, Jonas Jermann wrote:
>
> What if there are infinitely/arbitrary many variables and the need to 
> print/reference/etc them (fetch the next) appropriately? 
> A PhD colleague of mine had this issue (iirc with Power-series rings)... 
>

See `InfinitePolynomialRing`.

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Expression.series() = PowerSeriesRing(SR)?

2015-05-10 Thread Ralf Stephan
Instead of duplicating power series functionality (existing in rings/) in 
Pynac,
where there is momentarily only a skeleton implementation that does not even
play nice with the rest of symbolics, the series method of Expression
should return an element of PowerSeriesRing(SR).

I think this would be the right design, and now is the right time to at 
least
commit to this decision. So, what can be brought against it?

http://trac.sagemath.org/ticket/18393

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.