[sage-support] Re: Strange construction in autogenerated Python

2009-03-28 Thread simon . king

Hi Greg,

On 28 Mrz., 06:25, Greg Kuperberg greg.kuperb...@gmail.com wrote:
 On Mar 27, 1:39 pm, simon.k...@uni-jena.de wrote:

  Side note: In order to change to the latest sage version, it is not
  needed to compile from scratch again. Just do
    sage -upgrade
  on the command line. Provided that you are connected with internet, it
  will retrieve the changes from sage 3.2.3 to the latest version and re-
  compile (only) the necessary bits. So, this is much faster than
  compiling from scratch.

 That's a good suggestion.  But I just did that, and it still took 90
 minutes, although starting the process was trivial.

Well, i said much faster. And 90 minutes, compared with 5 hours or
so for a fresh compilation, is quite good imho.

Cheers,
  Simon
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread Dan Drake
On Thu, 26 Mar 2009 at 10:24PM -0700, Timothy Clemans wrote:
 Instead of actually modifying Python to fix some annoyances Sage uses
 IPython to preparse the code. For example in Sage 4 ^ 6 is preparsed
 into 4 ** 6.

I think he's curious about Integer() being applied twice, when once is
obviously enough.

I just looked at an autogenerated .py file, and I only see things like
_sage_const_1 = Integer(1)...Greg, where do you have 2's in your
original .sage file?

Dan


 On Thu, Mar 26, 2009 at 9:52 PM, Greg Kuperberg
 greg.kuperb...@gmail.com wrote:
 
  Hi.  I see that when I make file called foo.sage, sage precompiles it
  into another file called foo.py.  The code statement in this file is:
 
  _sage_const_2 = Integer(Integer(2))
 
  Surely this is wrong?  Maybe it does not matter if this Python code is
  only executed once.  But still it looks strange.

-- 
---  Dan Drake dr...@kaist.edu
-  KAIST Department of Mathematical Sciences
---  http://mathsci.kaist.ac.kr/~drake


signature.asc
Description: Digital signature


[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread Greg Kuperberg

1) I am using sage 3.2.3, which was current when I installed it in
January.  It was convenient for me to compile it from scratch, but it
then takes a long time to install.

2) Here is my sage code.  The program estimates the probability of
ever getting a 6-way tie if you repeatedly roll a die and count the
number of times that you get each result.

n = 100
s = 0.
for k in xrange(1,n+1):
t = float(factorial(6*k)/factorial(k)^6/6^(6*k))
s += t
print k,s,float(t),t*float(k)^(2.5)
c = sqrt(6.)*float(2*pi)^(-2.5)
print Limit by Stirling's approx:,c
tu = 2*c/3.*float(n)^(-1.5)
print Tail upper bound:,tu
s += tu
print Total upper bound:,s
print Estimate for chance ever:,s/(1.+s)

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread simon . king

Hi Greg,

On 27 Mrz., 21:21, Greg Kuperberg greg.kuperb...@gmail.com wrote:
 1) I am using sage 3.2.3, which was current when I installed it in
 January.  It was convenient for me to compile it from scratch, but it
 then takes a long time to install.

Side note: In order to change to the latest sage version, it is not
needed to compile from scratch again. Just do
  sage -upgrade
on the command line. Provided that you are connected with internet, it
will retrieve the changes from sage 3.2.3 to the latest version and re-
compile (only) the necessary bits. So, this is much faster than
compiling from scratch.

Cheers,
  Simon

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange construction in autogenerated Python

2009-03-27 Thread Greg Kuperberg

On Mar 27, 1:39 pm, simon.k...@uni-jena.de wrote:
 Side note: In order to change to the latest sage version, it is not
 needed to compile from scratch again. Just do
   sage -upgrade
 on the command line. Provided that you are connected with internet, it
 will retrieve the changes from sage 3.2.3 to the latest version and re-
 compile (only) the necessary bits. So, this is much faster than
 compiling from scratch.

That's a good suggestion.  But I just did that, and it still took 90
minutes, although starting the process was trivial.

On the bright side, in Sage 3.4, the Integer(Integer(n)) bug is
fixed.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Strange construction in autogenerated Python

2009-03-26 Thread mabshoff



On Mar 26, 10:24 pm, Timothy Clemans timothy.clem...@gmail.com
wrote:
 Instead of actually modifying Python to fix some annoyances Sage uses
 IPython to preparse the code. For example in Sage 4 ^ 6 is preparsed
 into 4 ** 6.

Yep.

 On Thu, Mar 26, 2009 at 9:52 PM, Greg Kuperberg

 greg.kuperb...@gmail.com wrote:

  Hi.  I see that when I make file called foo.sage, sage precompiles it
  into another file called foo.py.  The code statement in this file is:

  _sage_const_2 = Integer(Integer(2))

  Surely this is wrong?  Maybe it does not matter if this Python code is
  only executed once.  But still it looks strange.

What Sage release are you using? In Sage 3.3 or so there was a bug so
that each input was preparsed twice, but that has since been fixed.

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---