[sage-devel] Linux on Windows

2016-03-30 Thread Mike Hansen
It's looking like Windows is getting support for the Linux API in its 
kernel (think the reverse of Wine) allowing it to run native Linux 
binaries. 
 See http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html.  It 
seems like this might be a great alternative to Cygwin for Sage on Windows.

--Mike

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


Re: [sage-combinat-devel] Tutte polynomial error?

2015-05-05 Thread Mike Hansen
I've gone through and made the edge handling with respect to labels more 
explicit which also fixes the problem listed above.  The trac ticket can be 
found at http://trac.sagemath.org/ticket/18366

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Images disappeared in new Askbot

2014-07-09 Thread Mike Hansen
Hello,

This should be fixed now.

--Mike

On Wed, Jul 9, 2014 at 3:29 PM,  v...@ukr.net wrote:
   Hello!
   Today I noticed that the images embedded into the answer to my
 question on ask.sagemath.org are not shown. I know for sure that these
 images were present on that page before. I believe, they disappeared
 after the Askbot version upgrade.

   Here is the question I am talking about:
 http://ask.sagemath.org/question/9148/spectral-density-of-a-signal/

   Regards,
 Vladimir

 -
  v...@ukr.net

 --
 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.

-- 
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] ask.sagemath.org

2014-06-28 Thread Mike Hansen
Hello all,

We've recently updated http://ask.sagemath.org to the newest version
of askbot and installed some additional tools to help with spam.  New
users should be able to register and post questions, but they will
have to complete a reCAPTCHA until they reach karma 10.

Let me know if you have any issues with the new site.

--Mike

-- 
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: sage crashes when current working directory is $SAGE_ROOT/src/sage !?

2014-01-07 Thread Mike Hansen
The issue is just that there is a doctest module in src/sage/ which
gets imported instead of the stdlib's doctest module.

--Mike
--Mike


On Tue, Jan 7, 2014 at 4:35 PM, P Purkayastha ppu...@gmail.com wrote:
 Same crash on Linux x86_64.



 On 01/07/2014 11:19 PM, Vincent Delecroix wrote:

 I do have the problem.

 2014/1/7, Niles Johnson nil...@gmail.com:

 Am I confused?  My sage root directory is /Applications/sage.  I cd to

 /Applications/sage/src/sage

 and then attempt to start sage with either

 /Applications/sage/sage

 or

 ../../sage

 Either of these results in a crash which looks related to 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/groups/opt_out.

-- 
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/groups/opt_out.


Re: [sage-combinat-devel] Re: Symmetrica errors

2013-10-16 Thread Mike Hansen
If your test.c is

scan(POW_SYM,a);
scan(INTEGER, c);
t_POWSYM_SCHUR(a, b);
println(b);

then you still get the wrong answer so the problem is somewhere in Symmetrica.

--Mike
--Mike


On Wed, Oct 16, 2013 at 8:49 PM, Mike Zabrocki mike.zabro...@gmail.com wrote:
 There is more:

 Step 3:

 % make test

 Step 4:
 run the program but make sure it is in your path:

 % ./test
 SYMMETRICA VERSION 3.0 - STARTING
  Thu Feb 26 14:58:10 MET 1998
 integerobject
 5
 120

 SYMMETRICA VERSION 3.0 - ENDING
 last changed:  Thu Feb 26 14:58:10 MET 1998

 Note that I entered 5 and it returned 120.
 I don't know where it is getting SYMMETRICA VERSION 3.0 from.  Other
 indications is that this is v 2.0.

 -Mike

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-combinat-devel+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-combinat-devel@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-combinat-devel.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [sage-devel] Zero as a symbol for a permutation group

2013-07-01 Thread Mike Hansen
Here's a ticket with patch: http://trac.sagemath.org/sage_trac/ticket/14845

--Mike
--Mike


On Mon, Jul 1, 2013 at 1:14 PM, Nathann Cohen nathann.co...@gmail.com wrote:
 (#14772 is a Permutations patch currently waiting for a review which touches
 a lot of things. Sooo if you want to patch it somehow, you will have to
 give it a look)

 Nathann



 On Monday, July 1, 2013 2:11:10 AM UTC+2, Mike Hansen wrote:

 A better workaround is something like:

 sage: P = PermutationGroup([(0,1)], domain=[0,1]); P
 Permutation Group with generators [(0,1)]
 sage: P.domain()
 {0, 1}
 sage: P.list()
 [(), (0,1)]

 --Mike
 --Mike


 On Mon, Jul 1, 2013 at 12:28 AM, Rob Beezer goo...@beezer.cotse.net
 wrote:
  All,
 
  A power user sent me something akin to:
 
  sage: PermutationGroup([(1,2)])
  Permutation Group with generators [(1,2)]
 
  sage: PermutationGroup([('a','b')])
  Permutation Group with generators [('a','b')]
 
  sage: PermutationGroup([(0,1)])
 
  ---
  ValueErrorTraceback (most recent call
  last)
  snip
  ValueError: Invalid permutation vector: [(0, 1)]
 
  We expanded the possibilities for symbol sets, and it would be nice if
  this
  0-index case was picked up properly.  I could not find a ticket
  anywhere,
  and will make one unless I hear otherwise that this is known (or needs
  review!).
 
  For the record, here's a reasonable workaround:
 
  sage: S = SymmetricGroup([0,1])
  sage: S.subgroup([(0,1)])
  Subgroup of (Symmetric group of order 2! as a permutation group)
  generated
  by [(0,1)]
 
  Rob
 
  --
  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+...@googlegroups.com.
  To post to this group, send email to sage-...@googlegroups.com.
  Visit this group at http://groups.google.com/group/sage-devel.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

 --
 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/groups/opt_out.



-- 
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/groups/opt_out.




Re: [sage-devel] Zero as a symbol for a permutation group

2013-07-01 Thread Mike Hansen
 Looks like the code that you
 change does not come from the same patch, but it looks to me that if a
 PermutationGroup handles both 1, ...,n and a, b, c as its
 elements, then I expect that it should handle 0, 1, 2 as it handles
 a, b, c, that it to say probably with labels, and an internal
 relabeling of 0,...,n-1 to 1,...,n.

 But perhaps I am just worried over nothing O_o

This is exactly what the patch I posted does.  It also does

sage: PermutationGroup([(0,1)]).domain()
{0, 1}
sage: PermutationGroup([(-2, 4)]).domain()
{-2, -1, 0, 1, 2, 3, 4}

which is consistent with what it does on the upper end:

sage: PermutationGroup([(1, 6)]).domain()
{1, 2, 3, 4, 5, 6}

--Mike

-- 
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/groups/opt_out.




Re: [sage-devel] Zero as a symbol for a permutation group

2013-06-30 Thread Mike Hansen
A better workaround is something like:

sage: P = PermutationGroup([(0,1)], domain=[0,1]); P
Permutation Group with generators [(0,1)]
sage: P.domain()
{0, 1}
sage: P.list()
[(), (0,1)]

--Mike
--Mike


On Mon, Jul 1, 2013 at 12:28 AM, Rob Beezer goo...@beezer.cotse.net wrote:
 All,

 A power user sent me something akin to:

 sage: PermutationGroup([(1,2)])
 Permutation Group with generators [(1,2)]

 sage: PermutationGroup([('a','b')])
 Permutation Group with generators [('a','b')]

 sage: PermutationGroup([(0,1)])
 ---
 ValueErrorTraceback (most recent call last)
 snip
 ValueError: Invalid permutation vector: [(0, 1)]

 We expanded the possibilities for symbol sets, and it would be nice if this
 0-index case was picked up properly.  I could not find a ticket anywhere,
 and will make one unless I hear otherwise that this is known (or needs
 review!).

 For the record, here's a reasonable workaround:

 sage: S = SymmetricGroup([0,1])
 sage: S.subgroup([(0,1)])
 Subgroup of (Symmetric group of order 2! as a permutation group) generated
 by [(0,1)]

 Rob

 --
 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/groups/opt_out.



-- 
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/groups/opt_out.




Re: [sage-devel] Recursive function and local variable

2013-06-29 Thread Mike Hansen
I'm guessing this is just due to you using dict() in the function
definition.  See http://effbot.org/zone/default-values.htm .  If you
replace it with None do something like

if l is None:
l = {}

at the beginning of the function, then things should be okay.

--Mike
--Mike


On Sat, Jun 29, 2013 at 11:29 AM, Matthieu Deneufchâtel
matthieudeneu...@yahoo.fr wrote:
 In a recursive function, I use a dictionary (which contains the elements of
 the expansion of the argument on another basis). Since each call to the
 function needs the dictionary, I don't want the user to be forced to put the
 dictionary as an argument (i.e. I want him to call to_pbw(elem) instead of
 to_pbw(elem,{})). But I get a little confused between local and global
 variables with the code below since the dictionary is not emptied when
 needed (my function as the expected behavior only when I call
 to_pbw(elem,{})).

 Could anyone help me (provided my question is not unclear)?
 Matthieu

 def to_pbw(f,l=dict()):
 from sage.combinat.words.finite_word import to_monoid_element
 if f!= 0 * f.parent().one():
 support = [to_word(i[1]) for i in list(f)]
 min=support[0]
 if len(support)  1:
 for word in support[1:len(support)-1]:
 if min.lex_less(word):
 min = word
 coeff = list(f)[support.index(min)][0]
 if min not in l.keys():
 l[min]=coeff
 else:
 l[min] += coeff
 remainder = f - coeff * pbw_element(to_monoid_element(min))
 return to_pbw(remainder,l)
 return l

 --
 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/groups/opt_out.



-- 
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/groups/opt_out.




Re: [sage-devel] trac down?

2013-06-13 Thread Mike Hansen
It's up for me:

http://www.downforeveryoneorjustme.com/trac.sagemath.org

--Mike
--Mike


On Thu, Jun 13, 2013 at 2:37 PM, kcrisman kcris...@gmail.com wrote:
 $ ping trac.sagemath.org
 PING sagemath.org (128.208.160.197): 56 data bytes
 Request timeout for icmp_seq 0
 Request timeout for icmp_seq 1
 Request timeout for icmp_seq 2
 ^C
 --- sagemath.org ping statistics ---
 4 packets transmitted, 0 packets received, 100.0% packet loss

 --
 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?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Make mod_int signed?

2013-05-21 Thread Mike Hansen
I would just make sure that the unpickling old matrices still works.

--Mike
--Mike


On Tue, May 21, 2013 at 2:02 PM, Jean-Pierre Flori jpfl...@gmail.com wrote:


 On Tuesday, May 21, 2013 2:47:07 PM UTC+2, Martin Albrecht wrote:

 Sounds like a good idea to me.

 Sounds good to me too.


 On Tuesday 21 May 2013, Volker Braun wrote:
  Reposted at the top to increase visiblitiy (see
  https://groups.google.com/d/msg/sage-devel/5PdRIUic2Es/l0yDYLG_8qIJ)
 
  The sage matrices use unsigned long for the mod_int datatype. This does
  not
  fit into a (signed) python int, so whenever it reaches Python (assigning
  to
  a Python variable, or passing as an argument to a non-cdef function) it
  gets converted to a Python arbitrary-precision integer. This wastes
  quite a
  bit of time when creating it and gets worse once you start doing
  arithmetic:
 
  --
  ctypedef unsigned long mod_int   # this is how we define it
 
  cpdef caster_slow():
  cdef int i
  foo = None
  for i in range(1000):
  foo = mod_int(1.0)
 
  cpdef caster_fast():
  cdef int i
  foo = None
  for i in range(1000):
  foo = int(1.0)
  --
 
  Then we get
 
  sage: timeit('caster_slow()')
  5 loops, best of 3: 137 ms per loop
  sage: timeit('caster_fast()')
  25 loops, best of 3: 34.4 ms per loop
 
  Should we just switch to (signed) long? This wastes one bit (factor of
  2)
  of maximum modulus length, but at least for now we define MAX_MODULUS =
  2**23 so this wouldn't be an issue.

 Cheers,
 Martin

 --
 name: Martin Albrecht
 _pgp: http://pgp.mit.edu:11371/pks/lookup?op=getsearch=0x8EF0DC99
 _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
 _www: http://martinralbrecht.wordpress.com/
 _jab: martinr...@jabber.ccc.de

 --
 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?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Re: Mutability

2013-05-02 Thread Mike Hansen

 No Latin, definitely not :-)

 @require_mutable / @require_immutable


+1

--Mike

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-devel] Re: sage startup time hasn't improved...

2012-08-12 Thread Mike Hansen
On Sun, Aug 12, 2012 at 12:51 PM, Volker Braun vbraun.n...@gmail.com wrote:
 For comparison, here is sage-5.1.rc1. It looks like the notebook update
 pulled in two slow modules: flaskext.babel and pytz. And we now have a
 longer sys.path (from 26 to 39 entries), which makes module loading overall
 slower. Especially since the filesystem is 4x slower than on my laptop for
 some reason.

One easy improvement is to use pip instead of setuptools so that
things aren't added to sys.path when installing modules -- they're
just put directly in site-packages.  We should also be able to
restructure notebook imports so as not to have to pull in
flaskext.babel and pytz.

--Mike

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





Re: [sage-devel] Re: Documenting Factory Functions (RE trac #13282)

2012-07-30 Thread Mike Hansen
On Mon, Jul 30, 2012 at 10:31 AM, Nils Bruin nbr...@sfu.ca wrote:
 While I agree that tab completion is very useful as a low-cost
 documentation tool, I find it a little worrisome if our design
 decisions come to be dominated by having tab completion generate
 appropriate indices. In lots of cases it will go hand in hand with
 writing clean code to begin with (messy namespaces are often a sign of
 messy code), but if it forces us to go through strange contortions
 (like a separate index namespace module as above) perhaps we have to
 rethink our use of tab completion.

The new version of IPython has an option to have the tab completion
respect the __all__ variable in the module.  This would be one way to
deal with this.  See https://github.com/ipython/ipython/pull/1529

--Mike

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





Re: [sage-devel] comparisons in real number field

2012-07-08 Thread Mike Hansen
There is a patch at http://trac.sagemath.org/sage_trac/ticket/7160
which uses the embedding for the comparison, but there are two doctest
failures still.

--Mike

On Sun, Jul 8, 2012 at 8:54 AM, vdelecroix 20100.delecr...@gmail.com wrote:
 Hi,

 Once I initialize a number field with a real embedding, I would like
 (as a user) that the order defined on the number field (ie the answers
 of comparisons) is the one induced from RR. This is not the case right
 now. I started to implement the thing for quadratic number field, and
 it works well (ticket #13213). Any comment welcome...

 My question is about further algorithms that depends on the order: the
 floor and ceiling function. Right now, the answers are wrong in many
 cases. I found very efficient function to compute the floor or the
 ceiling of sqrt(D) either based on Newton method or a more direct
 squaring method. Does anybody know an algorithm for computing the
 floor of (a + b sqrt(D)) / d where all a,b,d and D are integers ? And
 for more general number field ? A naive approach would be to use
 arithmetic interval but it is very slow (my attempt is to have a
 reasonable speed for Rosen continued fraction and more general
 approximation algorithms in real number fields).

 Cheers,
 Vincent

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

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


[sage-combinat-devel] CombinatorialFreeModule, UniqueRepresentation, print_options, and doctests!

2012-05-29 Thread Mike Hansen
Hello all,

Recently, we noticed a problem with CombinatorialFreeModule and
doctests.  Say in one doctest, you have

sage: F = CombinatorialFreeModule(QQ, ['a','b','c'])
sage: F.print_options(monomial_cmp = lambda x,y: -cmp(x,y))

This F is cached in CombinatorialFreeModule.__classcall__.cache along
with the lambda function whose scope is tied to the global scope in
which it was defined.  In a later doctest, we have

sage: F = CombinatorialFreeModule(QQ, ['a','b','c'])
sage: F._sum_of_monomial(['a', 'b'])

which will try to use the previous lambda function for monomial_cmp
while printing the answer.  However, the doctest framework clears the
globals dictionary at the end of each block of doctests in order to
facilitate garbage collection.  Thus, the lambda function will fail to
evaluate (because it can't even look up cmp) and this is caught in
f._sorted_items_for_printing.  The element then (possibly) gets
printed incorrectly.

Proposal:  One way to fix this, and maybe remove some confusion since
these cached objects are mutable is to remove it from the cache when a
print_option is set.

Thoughts?

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] constructing the same poset twice

2012-05-25 Thread Mike Hansen
If posets are unique, then the code is probably doing an equality test
which could be taking up the time.

On Friday, May 25, 2012, Christian Stump wrote:

 to have some more data:

 sage: time p = P(100); p
 Time: CPU 0.01 s, Wall: 0.01 s
 Finite poset containing 100 elements
 sage: time p = P(100); p
 Time: CPU 0.20 s, Wall: 0.20 s
 Finite poset containing 100 elements

 sage: time p = P(1000); p
 Time: CPU 0.08 s, Wall: 0.08 s
 Finite poset containing 1000 elements
 sage: time p = P(1000); p
 Time: CPU 10.62 s, Wall: 10.63 s
 Finite poset containing 1000 elements

 %prun p = P(999)

 10022 function calls (10002 primitive calls) in 0.208 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
20.0940.0470.0940.047 {posix.waitpid}
10.0300.0300.0310.031
 generic_graph.py:15255(relabel)
50.0120.0020.0140.003
 generic_graph.py:8513(edge_iterator)
 10000.0070.0000.0080.000
 generic_graph.py:7826(add_edge)
   110.0070.0010.0140.001 __init__.py:1(module)
20.0070.0040.0070.004 {posix.read}
20.0050.0020.0050.002 {posix.fork}
30.0040.0010.1210.040 digraph.py:311(__init__)
 ...


 and running it again gives:

 3008181 function calls (3008179 primitive calls) in 11.302 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  3009.8110.0009.8110.000
 generic_graph.py:8320(has_edge)
11.4101.410   11.222   11.222 generic_graph.py:69(__eq__)
10.0320.0320.0330.033
 generic_graph.py:15255(relabel)
40.0100.0020.0110.003
 generic_graph.py:8513(edge_iterator)
 10000.0070.0000.0080.000
 generic_graph.py:7826(add_edge)
30.0040.0010.0130.004 digraph.py:311(__init__)

 --
 You received this message because you are subscribed to the Google Groups
 sage-combinat-devel group.
 To post to this group, send email to 
 sage-combinat-devel@googlegroups.comjavascript:;
 .
 To unsubscribe from this group, send email to
 sage-combinat-devel+unsubscr...@googlegroups.com javascript:;.
 For more options, visit this group at
 http://groups.google.com/group/sage-combinat-devel?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-devel] Re: Cephes licence : repackage?

2012-05-19 Thread Mike Hansen
On Sat, May 19, 2012 at 4:58 PM, Volker Braun vbraun.n...@gmail.com wrote:
 I think boost.math would be a better choice of special function library e.g.
 for systems where the libc implementation sucks.

I don't think that boost.math supports the things that we need it to,
for example complex.h.

Also, it seems like cephes
 is included in scipy distribution (scipy-0.9.p1/src/scipy/special/cephes/)
 so we ship it already.

I believe this is something totally different.

--Mike

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


Re: [sage-devel] Re: Cephes licence : repackage?

2012-05-19 Thread Mike Hansen
On Sat, May 19, 2012 at 5:33 PM, Volker Braun vbraun.n...@gmail.com wrote:
 On Saturday, May 19, 2012 8:15:06 PM UTC-4, Mike Hansen wrote:

 I don't think that boost.math supports the things that we need it to,
 for example complex.h.
 Oh I see you are saying they don't support complex arguments for all
 functions.

No -- Cygwin doesn't have C9X complex support nor long double support
(things like cabs or sqrtl).  The cephes package provides that.

 Also, it seems like cephes
  is included in scipy distribution
  (scipy-0.9.p1/src/scipy/special/cephes/)
 I believe this is something totally different.
 I'm pretty sure this is the same cephes, the sources contain Cephes Math
 Library Release 2.3:  March, 1995 Copyright 1984, 1995 by Stephen L.
 Moshier.

It looks like an older version of the double library for special
functions (src/double/ in the cephes spkg), but that's only a small
part of what is needed.

--Mike

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


Re: [sage-devel] Benchmarks for sage...

2012-04-04 Thread Mike Hansen
On Wed, Apr 4, 2012 at 12:44 PM, Florent Hivert florent.hiv...@lri.fr wrote:
 What do you think ?

There is some work in this direction going on by David Roe and Robert
Bradshaw.  See http://trac.sagemath.org/sage_trac/ticket/12720 .
Maybe they will have more to say on this.

--Mike

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


Re: [sage-devel] Depreciated is_AlgebraElement function

2012-03-26 Thread Mike Hansen
On Sun, Mar 25, 2012 at 11:06 PM, Starx jst...@gmail.com wrote:
 1) How are functions depreciated?  I ran
 search_src(is_AlgebraElement) and looked at all the results and I
 can only find this function occurring in either its definition or in
 import statements.  How does sage know to print a depreciation warning
 for this function?

See sage/all.py  -- they are only deprecated from Sage's global
namespace in order to avoid users seeing things like

sage: is_Integer(int(2))
False

 2) What is sage's philosophy when depreciating?  Is this to be
 eventually deleted?  And if so why not delete it now, as it isn't used
 anywhere else in the source.

Yes, they should probably be removed from the global namespace in Sage
5.0 as that deprecation warning has been there quite awhile.

 Finally 3) What's with all the is_Something(x) functions anyway?  As
 far as I can see they always just return isinstance(x, Something).  Is
 it because we don't expect a user to know the python isinstance
 function?

They were from awhile back, but I think it's better to just use
isinstance directly.

--Mike

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


Re: [sage-combinat-devel] Re: Is there a way to get rid of the new google groups?

2012-03-19 Thread Mike Hansen
On Mon, Mar 19, 2012 at 2:11 PM, Nicolas M. Thiery
nicolas.thi...@u-psud.fr wrote:
 On Mon, Mar 19, 2012 at 05:26:16PM +0800, Dima Pasechnik wrote:
 Hi sage-combinat-devel folks,
 could you advice on how you manage your group?

 As far as I remember, I haven't done anything specific. Mike (Hansen),
 have you?

Nope

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-devel] Re: distutils versus setuptools for the Sage library

2012-03-17 Thread Mike Hansen
There is a patch at http://trac.sagemath.org/sage_trac/ticket/12659
which builds the Sage library in place just using distutils.

--Mike

On Sat, Mar 17, 2012 at 10:36 AM, Keshav Kini keshav.k...@gmail.com wrote:
 Hmm. What is this? http://stackoverflow.com/a/6522905 Maybe it's worth
 looking into using this new thing?

 -Keshav

 
 Join us in #sagemath on irc.freenode.net !

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

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


Re: [sage-devel] distutils versus setuptools for the Sage library (was Re: Segregating development from production)

2012-03-12 Thread Mike Hansen
On Sat, Mar 10, 2012 at 6:59 AM, William Stein wst...@gmail.com wrote:
 I would like to make this change sometime in the next few months.  If
 anybody has any thoughts, feel free to share.

There's a patch at http://trac.sagemath.org/sage_trac/ticket/12659.
It should allow you have to both old (out-of-place) and new (in-place)
copies of the Sage library working side-by-side.

--Mike

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


Re: [sage-devel] git

2012-02-19 Thread Mike Hansen
On Sun, Feb 19, 2012 at 12:39 PM, Minh Nguyen mvngu.n...@gmail.com wrote:
 To preserve the commit history under Mercurial, we need to convert
 from hg to git format.  This can be done using various tools.  I've
 personally used fast-export [1] before to convert a hg repository to a
 git repo.  From there, we should be able to start using git for
 development.  Git should be able to import patches produced by hg.
 For those transitioning from hg to git, here's a brief dictionary [2]
 between hg/git commands.

This doesn't seem to be what William wants -- he wants to make the
changes in git and be able to contribute those to Sage (as if he
hadn't used git).  Other than producing patches with git and then say
qimporting them into hg, the best bet looks to be
https://github.com/offbytwo/git-hg where you can experimentally push
to an hg repo.

The other direction (hg client talking to get repo) seems to be much
more fully supported.

--Mike

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


Re: [sage-devel] use ./configure; make for Sage?

2012-02-09 Thread Mike Hansen
On Thu, Feb 9, 2012 at 11:30 AM, Michael Orlitzky mich...@orlitzky.com wrote:
 No one has proposed anything un-vague yet. But yes, some of the environment
 variables would become ./configure options. Many of them would just go away
 though, since they manually tell the build process things that ./configure
 can determine on its own.

This would probably also involve changing how the spkgs are built
since typically autotools will process a .in file to replace
constants.  So, such a change would probably involve moving all of the
spkg-install (etc.) files out of the spkg files so that autotools can
process them.  I think that change on its  one might be more
worthwhile.

--Mike

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


Re: [sage-devel] Re: Literal matrix syntax

2012-01-26 Thread Mike Hansen
On Thu, Jan 26, 2012 at 1:43 AM, Dima Pasechnik dimp...@gmail.com wrote:
 then, for consistency, it should be then
 [1,2;3,4;], i.e. end each row with ;

It can be optional:

In [6]: (1,2,3)
Out[6]: (1, 2, 3)
In [7]: (1,2,3,)
Out[7]: (1, 2, 3)

--Mike

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


Re: [sage-devel] Symmetric polynomial in terms of elementary symmetric polynomials

2011-12-08 Thread Mike Hansen
On Thu, Dec 8, 2011 at 10:56 AM, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 On 2011-12-04 14:34, Nicolas M. Thiery wrote:
 On Sun, Dec 04, 2011 at 03:56:39AM -0800, Dima Pasechnik wrote:
    unless I missed something,
    your 
 http://combinat.sagemath.org/doc/thematic_tutorials/demo-symmetric-functions.html
    lacks any information as to how to take any symmetric polynomial, and
    expand it  in some basis of symmetric functions.

 Indeed: this tutorial is very incomplete. Someone should stand up and
 take the time to gather all the bits of docs from here and there, and
 merge a nice and clean tutorial on Symmetric functions into Sage.

    Is it even possible with the combinat functionality?

 It definitely is. Here is a story without subtitles (please ask for
 those if needed:

     sage: S = SymmetricFunctions(QQ)
     sage: m = S.m()
     sage: e = S.e()
     sage: f = e[3,2,1]
     sage: f_as_poly = f.expand(3); f_as_poly
     x0^3*x1^2*x2 + x0^2*x1^3*x2 + x0^3*x1*x2^2 + 3*x0^2*x1^2*x2^2 + 
 x0*x1^3*x2^2 + x0^2*x1*x2^3 + x0*x1^2*x2^3
     sage: f_as_poly.parent()
     Multivariate Polynomial Ring in x0, x1, x2 over Rational Field

     sage: f_in_m = m.from_polynomial(f_as_poly); f_in_m
     3*m[2, 2, 2] + m[3, 2, 1]

     sage: f_in_e = e(f_in_m)
     sage: f_in_e
     e[3, 2, 1] - 3*e[4, 1, 1] - 2*e[4, 2] + 13*e[5, 1] - 18*e[6]

 Oops, but we don't get the original symmetric function f! Actually
 this is perfectly correct since we lost information by only expanding
 in 3 variables:

     sage: f_in_e.expand(3) == f.expand(3)

 If one kills all terms with parts larger than 3 (since
 e_4=e_5=e_6=...=0 in three variables).
 So I think this illustrates exactly Dima's sentiment that Sage doesn't
 have functionality to write a given symmetric polynomial in terms of
 elementary symmetric polynomials.  Maybe it's technically possible, but
 surely not easy!

 Also, it's not clear to me even what e[3,2,1] means.  How do Sage's
 elementary symmetric functions relate to
 http://en.wikipedia.org/wiki/Elementary_symmetric_polynomial#Examples

You can get the symmetric polynomials on that page by expanding Sage's
elementary symmetric functions out in a finite number of variables.

sage: e = SymmetricFunctions(QQ).e()
sage: e[1].expand(4)
x0 + x1 + x2 + x3
sage: e[2].expand(4)
x0*x1 + x0*x2 + x1*x2 + x0*x3 + x1*x3 + x2*x3
sage: e[3].expand(4)
x0*x1*x2 + x0*x1*x3 + x0*x2*x3 + x1*x2*x3
sage: e[4].expand(4)
x0*x1*x2*x3

e[3,2,1] represents the product e[3]*e[2]*[1]:

sage: e[3]*e[2]*e[1]
e[3, 2, 1]

To get a symmetric function from a polynomial, you use the
from_polynomial method as Nicolas mentioned.  The only awkward part
is that this method only exists for the the monomial basis.  (It would
be easy to add a method to the other bases which converted the
polynomial to the monomial basis and then to itself, but that doesn't
exist yet.)

sage: m = SymmetricFunctions(QQ).m()
sage: f = e[2].expand(4); f
x0*x1 + x0*x2 + x1*x2 + x0*x3 + x1*x3 + x2*x3
sage: f_in_e = e(m.from_polynomial(f)); f_in_e
e[2]
sage: f_in_e.expand(4)
x0*x1 + x0*x2 + x1*x2 + x0*x3 + x1*x3 + x2*x3

--Mike

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


Re: [sage-devel] Can I input n variables in python?

2011-09-22 Thread Mike Hansen
On Thu, Sep 22, 2011 at 1:37 PM, Anna Haensch annahaen...@gmail.com wrote:
 Is there any way in sage, or rather python, to define a function which
 takes as its input n variables, rather than assigning a fixed
 number?

 I've just written a piece of code for the Quadratic Forms module,
 which takes as input a Quadratic Lattice, Q, and three vectors, so
 (Q,v_1,v_2,v_3), and it generates the lattice L which is on the same
 underlying quadratic space as Q but with basis v_1,v_2,v_3.

You can do something like the following:

sage: def f(*args):
: return sum(args)
:
sage: f(1,2,3)
6
sage: f(2,3,5,8)
18

For more info, you can look at
http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/
or in more detail at
http://docs.python.org/tutorial/controlflow.html#defining-functions

--Mike


 Now, at the moment this is only for ternary forms, but I'd like to
 extend it to forms of any finite dimension.  The problem is that I
 can't see how to input vectors v_1,...,v_n.

 Any tips would be greatly appreciated!

 Thanks,
 Anna

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


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


Re: [sage-devel] status on lion and xcode 4

2011-08-31 Thread Mike Hansen
On Wed, Aug 31, 2011 at 7:10 PM, Maarten Derickx
m.derickx.stud...@gmail.com wrote:
 On sage support there was a question on building sage on lion and using
 xcode 4. So I was wondering is there any news in this area?

The main thing holding it back right now were problems building
boehm_gc and ECL, but both have been fixed in (unreleased) upstream
versions of the libraries.  sqrt5.cs.washington.edu has been
unresponsive so I have not been able to test ECL and Maxima yet.

--Mike

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


Re: [sage-devel] wiki.sagemath.org

2011-08-21 Thread Mike Hansen
On Sun, Aug 21, 2011 at 3:21 AM, Ivo Hedtke hed...@me.com wrote:
 Doesn't work for me: Login - click on Sage Days 32 - I am instantly logged 
 out.

What browser are using?

--Mike

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


Re: [sage-devel] build error in schroot+debootstrap

2011-08-12 Thread Mike Hansen
On Fri, Aug 12, 2011 at 2:54 PM, Jason B Hill jason.b.h...@colorado.edu wrote:
 RuntimeError: Unable to start gap because the command 'gap -r -b -p -T
 -o G /opt/sage/data//extcode/gap/sage.g' failed.

What if you do sage -sh and try to run gap -r -b -p -T -o G
/opt/sage/data//extcode/gap/sage.g manually?  What error does it
give?
--Mike

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


[sage-devel] Re: sagemath cluster

2011-08-05 Thread Mike Hansen
On Fri, Aug 5, 2011 at 10:51 AM, William Stein wst...@gmail.com wrote:
 Are the trac notifications queued somewhere or will they be lost?


 I have no clue.  I hope Mike Hansen or somebody can look into this.  I do
 not really understand how trac is setup..

It doesn't looked like they were queued up due to some permissions
problem, but they should be working again now.

--Mike

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


[sage-devel] Fwd: [IPython-dev] [ANN] IPython 0.11 is officially out

2011-07-31 Thread Mike Hansen
-- Forwarded message --
From: Fernando Perez fperez@gmail.com
Date: Sun, Jul 31, 2011 at 10:19 AM
Subject: [IPython-dev] [ANN] IPython 0.11 is officially out
To: IPython Development list ipython-...@scipy.org, IPython User
list ipython-u...@scipy.org, Discussion of Numerical Python
numpy-discuss...@scipy.org, SciPy Developers List
scipy-...@scipy.org, SciPy Users List scipy-u...@scipy.org,
Matplotlib Users matplotlib-us...@lists.sourceforge.net, NIPY
Developer's List nipy-de...@neuroimaging.scipy.org


Hi all,

on behalf of the IPython development team, I'm thrilled to announce,
after more than two years of development work, the official release of
IPython 0.11.

This release brings a long list of improvements and new features
(along with hopefully few new bugs).  We have completely refactored
IPython, making it a much more friendly project to participate in by
having better separated and organized internals.  We hope you will not
only use the new tools and libraries, but also join us with new ideas
and development.

After this very long development effort, we hope to make a few
stabilization releases at a quicker pace, where we iron out the kinks
in the new APIs and complete some remaining internal cleanup work.  We
will then make a (long awaited) IPython 1.0 release with these stable
APIs.

*Downloads*
Download links and instructions are at: http://ipython.org/download.html
And IPython is also on PyPI: http://pypi.python.org/pypi/ipython

Those contain a built version of the HTML docs; if you want pure
source downloads with no docs, those are available on github:

Tarball: https://github.com/ipython/ipython/tarball/rel-0.11
Zipball: https://github.com/ipython/ipython/zipball/rel-0.11

* Features *
Here is a quick listing of the major new features:

- Standalone Qt console
- High-level parallel computing with ZeroMQ
- New model for GUI/plotting support in the terminal
- A two-process architecture
- Fully refactored internal project structure
- Vim integration
- Integration into Microsoft Visual Studio
- Improved unicode support
- Python 3 support
- New profile model
- SQLite storage for history
- New configuration system
- Pasting of code with prompts

And many more...

We closed over 500 tickets, merged over 200 pull requests, and more
than 60 people contributed over 2200 commits for the final release.
Please see our release notes for the full details on everything about
this release: https://github.com/ipython/ipython/zipball/rel-0.11

As usual, if you find any problem, please file a ticket --or even
better, a pull request fixing it-- on our github issues site
(https://github.com/ipython/ipython/issues/).

Many thanks to all who contributed!

Fernando, on behalf of the IPython development team.

http://ipython.org
___
IPython-dev mailing list
ipython-...@scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-dev

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


Re: [sage-devel] Re: Citing used Sage components automatically

2011-07-27 Thread Mike Hansen
On Wed, Jul 27, 2011 at 10:48 AM, Jason Grout
jason-s...@creativetrax.com wrote:
 IIRC, someone (Mike Hansen, I believe) wrote something that would track
 pexpect interfaces or something to see what software was being used.  I
 cannot find the command name for his function, though.


sage: from sage.misc.citation import get_systems

--Mike

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


Re: [sage-devel] Re: On the Server

2011-07-08 Thread Mike Hansen
On Fri, Jul 8, 2011 at 10:06 PM, leif not.rea...@online.de wrote:
 On 9 Jul., 01:52, William Stein wst...@gmail.com wrote:
 The main fileserver for the sage.math cluster has had a major hardware 
 failure.
 Fortunately, I do have a working recent backup, and will be able to 
 eventually
 restore functionality.  Rebuilding /home in order to do this will take
 hopefully at most a day.

 Hmmm, trac is back, but I get the following error for ticket #11475:

 Unsupported version control system svn: Can't find an appropriate
 component, maybe the corresponding plugin was not enabled?

I went ahead and fixed that.

--Mike

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


Re: [sage-devel] Is Sage better because of the notebook?

2011-06-15 Thread Mike Hansen
On Wed, Jun 15, 2011 at 2:09 PM, Ceigh Boone schaffer...@gmail.com wrote:
 Assuming that you always have your browser running, it
 is a good idea that your math software runs inside it also, instead of
 hogging resources of it own. Is this true for trivial reasons? Do you have
 any insights?

All of the memory and resources that Sage uses (say when you are
working with a large matrix) are in a process which is completely
separate from the browser.  The browser just provides a window into
seeing what is going on in that process.

--Mike

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


Re: [sage-devel] Re: __init__.py vs. all.py

2011-06-14 Thread Mike Hansen
On Tue, Jun 14, 2011 at 1:03 PM, Keshav Kini keshav.k...@gmail.com wrote:
 Sorry for the necrobump. Anything new to report here? Any new opinions?

I still think that it'd be unsettling to have sage.plot.plot be both a
function and a module depending on which context you use it in.

--Mike

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


Re: [sage-devel] Re: __init__.py vs. all.py

2011-06-14 Thread Mike Hansen
On Tue, Jun 14, 2011 at 3:27 PM, Keshav Kini keshav.k...@gmail.com wrote:
 I think the solution would be exactly as Martin said on trac - don't let
 sage.plot.plot be a function, and make sage.plot.plot.plot the function
 (unfortunate as that triple plot is). We could set the usage of
 sage.plot.all.plot and sage.plot.plot as deprecated usages.

That's not a solution.  If you're going to use __init__.py to
propagate things to the global namespace instead of all.py , then
sage.plot.plot has to be a function.

--Mike

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


Re: [sage-combinat-devel] How to install (parts of) the combinat queue on many machines?

2011-06-09 Thread Mike Hansen
On Thu, Jun 9, 2011 at 5:51 AM, Christian Stump
christian.st...@gmail.com wrote:
 Gregg is planning to use our cluster package for a summer school at
 the MSRI in August (http://www.msri.org/web/msri/scientific/workshops/
 summer-graduate-workshops/show/-/event/Wm550).

 One solution'' we came up with was:

 1. Downloading and running a compiled version of Sage
 2. Downloading a prepared python file containing everything needed and
 attach it within the session

It seems like you could just have them download a version of Sage with
the appropriate things already merged into Sage repository.

If the files are orthogonal to the existing Sage files, you just just
put together a Python packages with the cluster code that could be
installed.

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-devel] Re: Hyperelliptic curve point counting speed regression

2011-06-08 Thread Mike Hansen
On Wed, Jun 8, 2011 at 4:11 AM, John Cremona john.crem...@gmail.com wrote:
 The same used to happen for elliptic curves, until someone (possibly
 me) decided that it was worth doing two things:  (1) if you do want to
 check that the equation is satisfied, do so in a naive way rather than
 using the whole scheme machinery; (2) have a check=False parameter
 for point creation, for when you know that the coordinates do define a
 point on the curve, e.g. for internal use n code with no bugs!  But I
 only did that for elliptic curves, and the general case is left as it
 was.

This should be fixed by
http://trac.sagemath.org/sage_trac/ticket/11389 which needs review.

--Mike

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


Re: [sage-devel] Re: Hyperelliptic curve point counting speed regression

2011-06-08 Thread Mike Hansen
On Wed, Jun 8, 2011 at 9:15 AM, John Cremona john.crem...@gmail.com wrote:
 Good!  Is that an educated guess, or have you tried the speed test
 before  after applying the patch at #11389?

I tried before and after the patch after looking into what was causing
all of the traceback.format_exc to be called.

--Mike

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


Re: [sage-combinat-devel] Re: Categorification of tableaux

2011-05-20 Thread Mike Hansen
On Fri, May 20, 2011 at 10:07 AM, Jason Bandlow jband...@gmail.com wrote:
 For the calling syntax, if T is a tableau, both T((0,0)) and T(0,0) will
 work in the current version.

Is there a reason that __call__ is used instead of __getitem__?  By
default, T[(0,0)] and T[0,0] are the same thing.

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-devel] Re: Coefficients of univariate polynomials

2011-05-10 Thread Mike Hansen
On Tue, May 10, 2011 at 6:52 PM, Rob Beezer goo...@beezer.cotse.net wrote:
 OK, thanks for the explanation, Tom.  p.exponents() was the missing
 piece I did not have.

It would probably make sense to have p.monomials() method to be
consistent with the multivariate case:

sage: R.t,s = QQ[]
sage: p = t^4 + 8
sage: p.coefficients()
[1, 8]
sage: p.monomials()
[t^4, 1]
sage: sum(c*m for c,m in zip(p.coefficients(), p.monomials()))
t^4 + 8

p.coeffs() might be better off renamed to something like
all_coefficients or dense_coefficients or 

--Mike

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


Re: [sage-devel] matrices for the univeral cyclotomic field

2011-05-02 Thread Mike Hansen
On Fri, Apr 22, 2011 at 7:15 AM, Christian Stump
christian.st...@gmail.com wrote:
 The problem is that, even though every element in the UCF has a fixed
 degree, the elements in the matrix might all have different degrees;
 moreover I cannot predict the degree, especially not when adding or
 multiplying such matrices.

 Is there a fast way to store the data as a 2-dim array with entries
 being dictionaries with keys being basis elements in the Zumbroich
 basis, and with rational values? Any other suggestions?

To start with, you could just use the generic dense matrix
implementation as opposed to the optimized implementation for
cyclotomic field which should just involve changing the following
lines in sage/matrix/matrix_space.py:

elif sage.rings.number_field.number_field.is_CyclotomicField(R):
import matrix_cyclo_dense
return matrix_cyclo_dense.Matrix_cyclo_dense

--Mike

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


Re: [sage-devel] Problems building Maxima with ECL on Cygwin.

2011-04-27 Thread Mike Hansen
On Wed, Apr 27, 2011 at 10:30 PM, Dr. David Kirkby
david.kir...@onetel.net wrote:
 Hi,
 it has been reported that there are issues in trying to build Maxima on
 Cygwin using ECL. Does this look like an ECL issue. See error message at

 http://trac.sagemath.org/sage_trac/ticket/11260

Another data point: it builds fine under WinXP.

--Mike

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


Re: [sage-devel] Re: Windows port status

2011-04-16 Thread Mike Hansen
On Fri, Apr 15, 2011 at 11:43 PM, Dima Pasechnik dimp...@gmail.com wrote:
 I recall reporting some weirdness on Windows 7, originating from the
 randomized addressing issue.
 (that's what rebase and rebaseall Cygwin utilities are/were fighting).
 At that time Cygwin still had Python 2.5.

 Is it correct that since then it has fixed itself, as Cygwin folks
 found a way to fix these problems?

Everything I've done has been on WindowsXP since that's the only
Windows box I currently have access to.

--Mike

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


Re: [sage-devel] Windows port status

2011-04-15 Thread Mike Hansen
Hello,

Sorry about the delay in response.

On Thu, Apr 14, 2011 at 11:29 AM, Alexandre Blondin Massé
alexandre.blondin.ma...@gmail.com wrote:
 1. What remains to be done?

All of the current known build issues are listed at
http://trac.sagemath.org/sage_trac/wiki/CygwinPort under the Build
Tickets section.  They all currently have fixes, but some work needs
to be done in updating spkgs for some of them.  With those fixes, I
got all the spkgs in Sage 4.7.alpha3 to build on Cygwin.

Currently Sage 4.7.alpha3 does not start up due to a segfault caused
by either the new PARI added in 4.6 or the new interrupt handling
code.  I have a clean backtrace for this, but I haven't delved into it
yet.

There are some tickets on there for doctest failures that need to be
looked into, but a number of them are trivial.

 2. Who is working actively/partially actively on the project?

I think I am the only one who is spending some time on it every now and then.

 3. What human ressource is needed? What profile should people working
 on it have?

It seems like most the issues left are with C code so someone who is
very familiar building Unix C code would be best.

--Mike

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


Re: [sage-devel] Re: http://flask.sagenb.org -- test it!!!

2011-03-27 Thread Mike Hansen
Hello,

On Sun, Mar 27, 2011 at 1:08 AM, Jason Grout
jason-s...@creativetrax.com wrote:
 Rado or Mike: how do you think we should get jmol requests to be recognized
 as requests coming from an authenticated user?

The issue is that the secure cookie that Flask uses is sent as
httponly, which the Java applet won't send.  Adding this patch to the
notebook code will fix that:


diff --git a/flask_version/base.py b/flask_version/base.py
--- a/flask_version/base.py
+++ b/flask_version/base.py
@@ -47,6 +53,28 @@
   endpoint='/static'+base_url,
   view_func=partial(self.static_view_func, root_path))

+def save_session(self, session, response):
+
+This method needs to stay in sync with the version in Flask.
+The only modification made to it is the ``httponly=False``
+passed to ``save_cookie``.
+
+Saves the session if it needs updates.  For the default
+implementation, check :meth:`open_session`.
+
+:param session: the session to be saved (a
+:class:`~werkzeug.contrib.securecookie.SecureCookie`
+object)
+:param response: an instance of :attr:`response_class`
+
+expires = domain = None
+if session.permanent:
+expires = datetime.utcnow() + self.permanent_session_lifetime
+if self.config['SERVER_NAME'] is not None:
+domain = '.' + self.config['SERVER_NAME']
+session.save_cookie(response, self.session_cookie_name,
+expires=expires, httponly=False, domain=domain)
+
 def message(self, msg, cont='/', username=None, **kwds):
 Returns an error message to the user.
 template_dict = {'msg': msg, 'cont': cont, 'username': username}

This still doesn't fix the issue for me, since the Jmol applet then
requests the .zip file from the worksheet directory rather than the
cell directory (and gets a 404).  However, this should not be too hard
to track down.

--Mike

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


[sage-devel] Re: [sage-algebra] Is a free algebra with one generator a univariate polynomial ring?

2011-03-27 Thread Mike Hansen
On Sun, Mar 27, 2011 at 11:02 AM, Simon King simon.k...@uni-jena.de wrote:
 There are constructors for parents that return instances of different
 classes for different input -- even if the resulting parents are
 isomorphic.

 Example:
  sage: type(PolynomialRing(QQ,['x']))
  class 'sage.rings.polynomial.polynomial_ring.PolynomialRing_field'
  sage: type(PolynomialRing(QQ,1,['x']))
  type
 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'

 Both are polynomial rings with one generator, but the classes are
 different. Is there an official policy to what extent such ambiguity
 is tolerable?

This was done on purpose.  There are methods on univariate polynomials
which are not the same for multivariate polynomials.  They behave
differently even though they are isomorphic.

 So, is it acceptable that FreeAlgebra(QQ,1,['x']) returns a univariate
 polynomial ring (which would be the case with the current patch from
 #7797)? Or are free algebras and polynomial rings too different?

I think that FreeAlgebra(QQ, 1, ['x']) shouldn't return a
PolynomialRing object until we can guarantee some level of consistency
between the two.

--Mike

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


Re: [sage-devel] Re: Failed tests for accuracy reasons

2011-03-16 Thread Mike Hansen
On Wed, Mar 16, 2011 at 8:55 AM, Robert Bradshaw
rober...@math.washington.edu wrote:
 Whatever process is used to compute the value, the fact is that the
 result has *no* rounding error on all other platforms. This platform
 produces inferior results, and I'd call it a bug. Let's fix/work
 around it, not mask it.

We also get the same failure on Cygwin.

--Mike

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


Re: [sage-devel] Re: trac server running out of space again?

2011-03-16 Thread Mike Hansen
Hello,

On Wed, Mar 16, 2011 at 10:48 AM, David Kirkby david.kir...@onetel.net wrote:
 If a password file gets deleted, I would at least consider the
 possibility the system may have been compromised.

 Dave

 i.e. hacked

 I find it hard to believe the trac server should delete a file, even
 under conditions of a resource shortage.

I don't believe the file was actually deleted, but instead had just 0
bytes of data.  My guess is that someone did an operation (such as
removing a user who spammed trac) which would cause the password file
to be rewritten.  If there weren't enough resources to write the file,
I believe you'd see such behavior.

--Mike

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


Re: [sage-devel] Re: trac server running out of space again?

2011-03-16 Thread Mike Hansen
On Wed, Mar 16, 2011 at 12:46 PM, Volker Braun vbraun.n...@gmail.com wrote:
 Just to clarify, William referred to /etc/passwd and not a .htpasswd file?

Trac authentication operates on a .htpasswd file, and this was the
file in question.

--Mike

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


Re: [sage-devel] Degrees of permutation groups, esp. stabilizers

2011-03-15 Thread Mike Hansen
On Wed, Mar 16, 2011 at 2:12 AM, Rob Beezer goo...@beezer.cotse.net wrote:
 I can fix the stabilizer, but I am wondering if something more
 systematic is called for - consistently setting _deg in subgroup
 creation, or earlier in general group creation, and with less reliance
 on the largest moved point as a best guess.  As this is perhaps
 different from the GAP philosophy (which I do not claim to know well)
 maybe there is a good reason for not being so careful?  Maybe there
 are times when it is important to scrunch down the degree as happened
 above?

I have a more systematic fix for this in my patch at #10335.  The
patch provides a explicit way to say on which set the group (and
subgroup) acts.  If you have issues with it, I have an update to the
patch that I'm trying to push to the combinat patch server.  I'm
having some issues with it authenticating; I'll post an update to this
thread when it's live.

sage: D = DihedralGroup(4)
sage: D.domain()
{1, 2, 3, 4}
sage: S = D.stabilizer(4)
sage: S.domain()
{1, 2, 3, 4}
sage: S.degree()
4
sage: S.orbits()
[[1, 3], [2], [4]]

The patch also goes through and make sure all subgroups constructed go
through a common subgroup code path.

--Mike

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


Re: [sage-combinat-devel] Rejection

2011-03-08 Thread Mike Hansen
Hi Florent,

On Tue, Mar 8, 2011 at 2:36 PM, Florent Hivert
florent.hiv...@univ-rouen.fr wrote:
 I just pushed a changeset with the following patches guarded because I had
 some rejection.

 trac_10335-permgroup_domain-mh.patch #-4_5 #-4_6_1 #-4_6_2
 trac_9534-permgroup_base.patch       #-4_5 #-4_6_1 #-4_6_2

I'll check into it and get it fixed today.

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: Re: [sage-devel] Re: About GSoC

2011-03-04 Thread Mike Hansen
On Fri, Mar 4, 2011 at 3:05 PM, David Kirkby david.kir...@onetel.net wrote:
 * Add GPIB support for Linux only - probably the only platform where
 this is doable with totally free software. FreeBSD would be possible
 if the port was complete. Solaris and OS X would probably need to use
 a commerical driver for the GPIB card. As I remarked the other day,
 the real issue to get commerical developers to use Sage for instrument
 control is having drivers for their instruments. But if the basic GPIB
 driver was implemented, then a couple of commands could be written in
 Sage to basically send and receive data. Drivers for specific
 instruments would essentially require the user to write the code based
 on their manual for the instrument. Getting a cheap instrument to test
 the basic code on is very easy.

There is already http://pyvisa.sourceforge.net/ which looks like it
provides this.

--Mike

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


Re: [sage-devel] Re: Maxima library mode nearing completion

2011-02-27 Thread Mike Hansen
On Sun, Feb 27, 2011 at 10:07 PM, rjf fate...@gmail.com wrote:
 One way around this is for the maxima/lisp function ASKSIGN
 to get back to Sage.

This happens naturally since Maxima and Sage are in the same process.
It will sit and wait for an answer on standard input.

 Another is to
 give an error and quit.

This is what is done -- an exception is thrown with the text from
Maxima.  See 
http://trac.sagemath.org/sage_trac/attachment/ticket/7377/trac_7377-better-ask-error.patch

--Mike

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


Re: [sage-devel] Re: Coercion between polynomial rings

2011-02-16 Thread Mike Hansen
On Wed, Feb 16, 2011 at 7:06 PM, mmarco mma...@unizar.es wrote:
 I already new all that, but my question would be: why
 S.has_coerce_map_from(R) returns False?

Because S(r) is doing a converion rather than a coercion.
Coercion is implicit and happens when doing arithmetic.
S.has_convert_map_from(R) should return True.

--Mike

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


Re: [sage-devel] Re: Parsing an expression according to a given grammar in Sage

2011-02-16 Thread Mike Hansen
On Wed, Feb 16, 2011 at 11:40 PM, Alexandre Blondin Massé
alexandre.blondin.ma...@gmail.com wrote:
 Maybe it's worth including such a package in Sage if it's not already
 done?

I believe it's included in matplotlib as matplotlib.pyparsing.

--Mike

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


Re: [sage-devel] Re: Help with understanding multiplication of symbolic expressions

2011-02-15 Thread Mike Hansen
On Tue, Feb 15, 2011 at 4:59 PM, Simon King simon.k...@uni-jena.de wrote:
 No, I was mistaken. Everything can be traced back to g_gcd, which is
 called in sage.symbolic.expression.Expression.gcd. At that point, I
 lost track: I can not find the code of g_gcd (even grep g_gcd does
 not give me a hint). In particular, I did not change g_gcd, but it
 seems that my patch had a side effect on it.

g_gcd just calls gcd in the GiNaC library.  You can find the
reference to it in sage/libs/ginac/decl.pxi.  That function will in
turn use the py_gcd function in pynac.pyx for Sage types that it does
not know natively.  Suppose we have

sage: var('x,y')
(x, y)
sage: g = x^2*4
sage: f = x*y*6
sage: f.gcd(g)
2*x

Then, roughly speaking, g_gcd will be responsible for figuring out
the x part of the answer, and py_gcd will be called to figure out
the 2 part of the answer.

--Mike

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


Re: [sage-devel] Re: Signature of a permutation

2011-02-12 Thread Mike Hansen
On Sat, Feb 12, 2011 at 3:09 AM, Dox o.castillo.felis...@gmail.com wrote:
 Hi again people!
 Just wanted to know if the Levi-Civita tensor can be emulated by using this,

 sage: G = SymmetricGroup(4)
 sage: G([4,2,3,1]).sign()
 -1

 because I'm not sure if the notation used in the documentation is equivalent
 to mine!

Yes, you can use that to get the sign of a permutation which is used
in the Levi-Civita tensor.

--Mike

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


Re: [sage-devel] Re: test Flask-based notebook

2011-02-08 Thread Mike Hansen
On Tue, Feb 8, 2011 at 7:54 PM, Jason Grout jason-s...@creativetrax.com wrote:
 This is somewhat off-topic, but has anyone considered celery for
 executing computation-heavy tasks?

 That's the basic idea of the notebook redesign.  See
 http://wiki.sagemath.org/Notebook%20design

 I hadn't heard of celery.  Thanks for the link.  It seems that it might be
 able to fit in to the Device role that manages worker processes.

I've used celery pretty extensively, but don't think that it will be
that useful for the notebook since the worksheet sessions have to
maintain state.  Where it might be useful is in doing things like
preparing a zip file of all of the worksheets for the user to
download.  Things that don't require any state except for what is in
the database.

--Mike

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


Re: [sage-combinat-devel] Re: wrong behaviour of Set

2011-02-02 Thread Mike Hansen
Hello,

2011/2/2 Frédéric Chapoton fchapot...@gmail.com:
 Here is a little more detail, a reduced example, coming from the
 problem above.

 sage: kiki
 {B[[1, 0, 1, 1, 0, 1, 0, 1, 0, 0]] + B[[1, 0, 1, 1, 1, 0, 0, 1, 0, 0]]
 + B[[1, 0, 1, 1, 0, 1, 1, 0, 0, 0]] + B[[1, 0, 1, 1, 1, 0, 1, 0, 0,
 0]] + B[[1, 0, 1, 1, 1, 1, 0, 0, 0, 0]], B[[1, 0, 1, 1, 0, 1, 0, 1, 0,
 0]] + B[[1, 0, 1, 1, 0, 1, 1, 0, 0, 0]] + B[[1, 0, 1, 1, 1, 0, 0, 1,
 0, 0]] + B[[1, 0, 1, 1, 1, 0, 1, 0, 0, 0]] + B[[1, 0, 1, 1, 1, 1, 0,
 0, 0, 0]]}
 sage: kiki.cardinality()
 2
 sage: kiki[0]==kiki[1]
 True
 sage: kiki[0]-kiki[1]
 0

 so these 2 linear combinations differ only by their order.

My guess is that it is an issue with the hashing of the elements of
kiki -- perhaps the hash is based on an ordering?  What types of
objects are they?  Here's a way to reproduce similar behavior:

class Foo(object):
def __init__(self, value):
self.value = value
def __eq__(self, other):
return isinstance(other, Foo) and self.value == other.value
def __hash__(self):
import random
return random.randint(0,1)
def __repr__(self):
return repr(self.value)


sage: a = Foo(1)
sage: b = Foo(1)
sage: a == b
True
sage: Set([a,b])
{1, 1}
sage: mySet = Set([a,b])
sage: Set([len([v for v in mySet if v==u]) for u in mySet])
{2}

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-devel] Re: FAQ suggestion: I'm a programmer, how can I contribute to Sage?

2011-02-01 Thread Mike Hansen
On Tue, Feb 1, 2011 at 3:21 PM, Dr. David Kirkby
david.kir...@onetel.net wrote:
 I don't know how hard it is, but I got the impression from William only a
 few months back that it did not need a lot of work. But I've come very
 suspicious about time estimates from many Sage developers.

I don't think it needs lots of work.  I think the major outstanding
issue is http://trac.sagemath.org/sage_trac/ticket/10247 .  However,
I've done _zero_ work on it in the last few months due to being busy
with other things.  Nobody one else has done any work either.  It may
not be a lot of work to get it done, but it's work that is not going
to get done on its own.

--Mike

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


Re: [sage-devel] Re: preparser is affecting commands like 'cd', 'mv', etc.

2011-01-18 Thread Mike Hansen
On Tue, Jan 18, 2011 at 9:57 AM, Niles nil...@gmail.com wrote:
 Fair enough -- I was afraid this might be the answer.  I asked about
 the non-proper syntax because I don't know how to do globbing
 properly.  Is there a proper syntax for the following?

 sage: mv tmp0-50/output-02*.png some-other-directory/

 Note that using quotes around the command fails here.

If you just want to run system commands, just use the IPython
command for that:

 !mv tmp0-50/output-02*.png some-other-directory/

--Mike

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


Re: [sage-devel] Re: cannot add attachment on trac

2011-01-17 Thread Mike Hansen
There's a problem with boxen running out of disk space.  I'm not sure
what is causing it.

--Mike

On Mon, Jan 17, 2011 at 1:13 AM, Gagan Sekhon gagan.d.sek...@gmail.com wrote:
 I am having the same problem. I tried to upload patch for trac 7763
 and got the following error.

 Oops…
 Trac detected an internal error:
 IOError: [Errno 28] No space left on device
 There was an internal error in Trac. It is recommended that you inform
 your local Trac administrator and give him all the information he
 needs to reproduce the issue.

 To that end, you could   a ticket.

 The action that triggered the error was:

 POST: /attachment/ticket/7763/
 TracGuide — The Trac User and Administration Guide

 On Jan 16, 11:13 pm, Dima Pasechnik dimp...@gmail.com wrote:
 while attempting to upload a patch on #6391, I get
 (http://trac.sagemath.org/sage_trac/attachment/ticket/6391/?
 action=newattachfilebutton=Attach+file)

 (using Safari on OSX 10.6.6)

 Traceback (most recent call last):
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
 web/api.py, line 377, in send_error
     'text/html')
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
 web/chrome.py, line 726, in render_template
     req.session.pop('chrome.%s.%d' % (type_, i)))
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
 web/api.py, line 195, in __getattr__
     value = self.callbacks[name](self)
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
 web/main.py, line 264, in _get_session
     return Session(self.env, req)
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
 web/session.py, line 157, in __init__
     self.get_session(req.authname, authenticated=True)
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
 web/session.py, line 173, in get_session
     super(Session, self).get_session(sid, authenticated)
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/
 web/session.py, line 56, in get_session
     (sid, int(authenticated)))
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/db/
 util.py, line 59, in execute
     return self.cursor.execute(sql_escape_percent(sql), args)
   File /usr/lib/python2.5/site-packages/Trac-0.11.5-py2.5.egg/trac/db/
 util.py, line 59, in execute
     return self.cursor.execute(sql_escape_percent(sql), args)
 ProgrammingError: current transaction is aborted, commands ignored
 until end of transaction block

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


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


Re: [sage-devel] Curly braces for LaTeX Sets?

2011-01-08 Thread Mike Hansen
Hello,

On Sat, Jan 8, 2011 at 8:26 PM, Eviatar eviatarb...@gmail.com wrote:
 I was wondering about people's opinions on typesetting lists in LaTeX
 with curly braces ({ }) instead of square brackets ([ ]) as is done in
 Python. This would be more mathematically correct, as sets are
 typically denoted like this in mathematics.

Sage's Set objects are typeset in LaTeX using using curly brackets.
With your change, they wouldn't be distinguishable.  Additionally,
lists have an ordering which make them mathematically different than
sets.

--Mike

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


Re: [sage-devel] Ticket #9163 needs review (expect.py on Cygwin and OS X)

2010-12-17 Thread Mike Hansen
On Fri, Dec 17, 2010 at 9:16 AM, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 Blocker ticket #9163 has a patch and needs review.  It fixes a doctest
 failure in sage/interfaces/expect.py.  The ticket claims the error
 happens on Cygwin and OS X.  I have tested the fix only on OS X 10.6.

I cannot test this on Cygwin since I don't have a working build right
now.  I do have one close to completion, but it fails due to #10247.

--Mike

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


Re: [sage-devel] Re: how does in work?

2010-11-28 Thread Mike Hansen
On Sun, Nov 28, 2010 at 3:09 PM, John H Palmieri jhpalmier...@gmail.com wrote:
 I think it's this code in sage/rings/polynomial/
 multi_polynomial_ring_generic.pyx:

    def __contains__(self, x):
        
        This definition of containment does not involve a natural
        inclusion from rings with less variables into rings with more.
        
        try:
            return x.parent() == self
        except AttributeError:
            return False

I think this code should be removed in favor of the default implementation.

--Mike

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


[sage-combinat-devel] Re: [sage-algebra] Bidirectional coercions?

2010-11-27 Thread Mike Hansen
On Sat, Nov 27, 2010 at 2:48 AM, Nicolas M. Thiery
nicolas.thi...@u-psud.fr wrote:
 I can't comment on the use case at hand. But in Sage-Combinat we do
 have a lot of use cases where we really want to have coercion maps in
 both directions; more generally, we have large strongly connected
 components in the coercion graph.

Do you really want to have coercion maps in both directions, or rather
just conversion maps?

 There is a single caveat: namely that the current coercion
 implementation does not handle those well (see #8878).

The examples there are conversion than coercion.

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-de...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] Re: souci en sage

2010-11-25 Thread Mike Hansen
Hello,

On Thu, Nov 25, 2010 at 6:19 AM, Nicolas M. Thiery
nicolas.thi...@u-psud.fr wrote:
 On Tue, Nov 23, 2010 at 12:09:54PM -0800, Anne Schilling wrote:
 Disabling

 coxeter3-mh.patch
 coxeter3-iterator.patch

 Good.

 fixed the problem. Should I set guards on these?

 As you feel like. It's only going to possibly hurt those who have
 installed the coxeter3 spkg. And we want one of them to fix the
 problem :-)

I'm currently looking into this.  It seems like it is a bug in Cython.

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-de...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-combinat-devel] Re: souci en sage

2010-11-25 Thread Mike Hansen
On Thu, Nov 25, 2010 at 1:17 PM, Mike Hansen mhan...@gmail.com wrote:
 I'm currently looking into this.  It seems like it is a bug in Cython.

This is now http://trac.cython.org/cython_trac/ticket/601

--Mike

-- 
You received this message because you are subscribed to the Google Groups 
sage-combinat-devel group.
To post to this group, send email to sage-combinat-de...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.



Re: [sage-devel] Searching OEIS is broken

2010-11-25 Thread Mike Hansen
On Thu, Nov 25, 2010 at 7:43 AM, ulfarsson ulfars...@gmail.com wrote:
 the function sloane_find seems to be broken after the recent updates
 to The online encyclopedia of integer sequences, oies.org. For example

 sloane_find([1,2,3,4,5,6])

 does not find anything in the database.

This is http://trac.sagemath.org/sage_trac/ticket/10056 and has been
fixed in Sage 4.6.1.

 Does anyone have a recent copy of teh gzipped file lying around
 somewhere that I could borrow until the oeis fixes their file?

I'm not sure how recent you need, but I believe this is from about a year ago.

http://sage.math.washington.edu/home/mhansen/database_sloane_oeis-2009-12/src/sloane/sloane-oeis.bz2

--Mike

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


Re: [sage-devel] Searching OEIS is broken

2010-11-25 Thread Mike Hansen
On Thu, Nov 25, 2010 at 12:15 PM, William Stein wst...@gmail.com wrote:
 Unfortunately, I looked at the new OEIS end user license.  Very, very
 sadly, redistributing the above file is a blatant violation of these
 terms (see Section 2, number 2). So Mike, please remove it at some
 point so I don't get into trouble.  (I doubt they are going to do
 anything right now.)

It is an optional package so there are probably a number of locations
where it occurs.

 http://oeis.org/wiki/The_OEIS_End-User_License_Agreement

 I wonder if the OEIS used to be available under a different license,
 or maybe Sloane just didn't worry about licenses?  If it did used to
 be available under different terms?

I checked an older archive.org version of his site, and it doesn't
seem like there is any sort of license accompanying the files.

 And if you're the sort of person (like
 me), who has contributed to OEIS, to think twice before doing so in
 the future.

I wonder if it would be useful to contact the foundation and/or Sloane.

--Mike

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


Re: [sage-devel] Importing stuff from the doc namespace in the sage namespace

2010-11-22 Thread Mike Hansen
On Mon, Nov 22, 2010 at 12:30 PM, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 How to do this? (this relates to ticket #10200)

You could add SAGE_ROOT/devel/sage/doc/common/ to sys.path, import the
module, and then remove it from sys.path.

--Mike

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


Re: [sage-devel] Re: Severe slowness of singular interface on some machines partially caused by _synchronize

2010-11-22 Thread Mike Hansen
On Mon, Nov 22, 2010 at 2:56 PM, Alex Leone acle...@gmail.com wrote:
 I wrote a small script (see attached) that reads ~1 second of the stdout of
 a command opened with subprocess.Popen().  For some reason singular doesn't
 like this and refuses to show any output.  However gap works fine:

pexpect (and other expect variants) were written specifically to avoid
deadlocks which you are most likely seeing with Singular.  For more
info on this, check out
http://effbot.org/pyfaq/how-do-i-run-a-subprocess-with-pipes-connected-to-both-input-and-output.htm

--Mike

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


Re: [sage-devel] what is the sage-native-execute script for?

2010-11-17 Thread Mike Hansen
On Wed, Nov 17, 2010 at 1:09 PM, Volker Braun vbraun.n...@gmail.com wrote:
 Is sage-native-execute supposed to run non-Sage programs?

It's suppose to run non-Sage programs such as opening an image viewer,
magma, matlab, latex, etc.

--Mike

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


Re: [sage-devel] Re: Policy on license conditions for new packages?

2010-11-11 Thread Mike Hansen
On Thu, Nov 11, 2010 at 6:37 AM, Dr. David Kirkby
david.kir...@onetel.net wrote:
 On 11/11/10 01:32 PM, Jason Grout wrote:


 As I understand it, currently, the whole Sage distribution is
 effectively GPLv3+, since it combines GPLv2+ and GPLv3+ code, so it is
 at least GPLv3. My understanding is that we currently can't include GPL2
 (not +) code. However, if someone wanted to take just the Sage library
 and certain GPLv2+ packages (something like Purple Sage), then they
 could make a GPLv2+ distribution, and then they could incorporate GPLv2
 (not +) code into their distribution.

 Another resource for this is the GPL FAQ, particularly:

 http://www.gnu.org/licenses/gpl-faq.html#AllCompatibility

 Thanks,

 Jason

 Thank you Jason. The particular page I was updating is just about adding new
 .spkg files and not the library, so we don't need to address that here. I
 think that's simpler anyway, but that's not the issue.



 One problem is that 95% of people don't actually follow the instructions in
 the GPL, but simply copy the 'COPYING' file, so it ends with:

  signature of Ty Coon, 1 April 1989
  Ty Coon, President of Vice

 That also means 95% of people don't actually add or any later version to
 their GPL2 code. For example, Maxima says:

                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991

 with no mention the code can be used under any later version of the GPL. If
 you look at the nset.lisp, it says

 ; Released under terms of GNU GPL v2 with Bill's approval.

 with no mention whatsoever of the or later.

For Maxima, this has been covered before.  See
http://www.mail-archive.com/sage-devel@googlegroups.com/msg12855.html
and the rest of that thread where it was confirmed that Maxima is
GPLv2+.

--Mike

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


Re: [sage-devel] Re: How does the Symbolic Ring work (in particular: new_Expression_from_GEx)

2010-11-03 Thread Mike Hansen
On Wed, Nov 3, 2010 at 4:34 AM, koffie m.derickx.stud...@gmail.com wrote:
 search_def(g_hold2_wrapper) doesn't return anything so it's not in
 sage self. I also used grep to maybe locate it in the pynac spkg but
 it's not there either (I wasn't sure if search_def also looked in the
 spkg files), and it's also not to be found in the GiNaC reference.

If you look in sage/libs/ginac/decl.pxi, you can see that it is a
wrapper for HOLD2 in the GiNaC/Pynac C++ library.

--Mike

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


Re: [sage-devel] How does the Symbolic Ring work (in particular: new_Expression_from_GEx)

2010-11-02 Thread Mike Hansen
On Tue, Nov 2, 2010 at 12:15 PM, koffie m.derickx.stud...@gmail.com wrote:
 return new_Expression_from_GEx(self._parent,
    g_hold2_wrapper(g_power_construct, self._gobj, g_ex1_2, hold))

 Can someone help with this?

It returns a new Expression (sage.symbolic.expression.Expression)
object that corresponds to a GiNaC/Pynac object (second argument) with
a given parent (first argument).  It's just a constructor for
Expression like Expression.__init__, except that it takes a pointer to
a C++ object.

--Mike

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


Re: [sage-devel] Re: parsing trac

2010-10-29 Thread Mike Hansen
On Fri, Oct 29, 2010 at 4:03 PM, Jason Grout
jason-s...@creativetrax.com wrote:
 It seems that Mike Hansen had some pretty cool ideas about how to use that
 plugin.

There's some code at [1] which handles the digest authentication that
xmlrpclib doesn't handle by default.  With the result of
SageTracServerProxy, you can do the examples at [2].

--Mike

[1] http://sage.math.washington.edu/home/mhansen/sagetrac_xmlrpc.py

[2] http://trac-hacks.org/wiki/XmlRpcPlugin

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


Re: [sage-devel] Re: Is it *really* necessary for everyone to download fortran.spkg ?

2010-10-26 Thread Mike Hansen
On Tue, Oct 26, 2010 at 1:42 PM, Dr. David Kirkby
david.kir...@onetel.net wrote:
 I personally don't see why the Cygwin port should be so hard. From what I
 understand, there are only a dozen or so doctest issues to resolve.

It's not hard -- I've just been busy with other things and haven't
worked on it.  No one else has worked on it either which is why it is
where it is.

--Mike

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


Re: [sage-devel] Re: assume(s,'real') is broken?

2010-10-22 Thread Mike Hansen
On Fri, Oct 22, 2010 at 8:47 AM, kcrisman kcris...@gmail.com wrote:
 So somehow that isn't getting through.  I may not have time to look
 into this for a while otherwise, so if no one else responds relatively
 soon feel free to make a new Trac ticket and cc: kcrisman.

What's going on is that the assumption system is pretty much
completely in Maxima.  So, in order for the assumptions to take
effect, you have to send the result to Maxima and get it back:

sage: var('a,b,y')
(a, b, y)
sage: assume(a,'real')
sage: real_part(a)
real_part(a)
sage: real_part(a).simplify()
a

There is also something similar in GiNaC:

sage: var('a', domain=RR)
a
sage: a = var('a', domain=RR)
sage: real_part(a)
a

These two interfaces aren't really unified, and it'd probably be a
good project to do so.  (Although, Maxima supports more assumptions
than GiNaC.)

--Mike

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


Re: [sage-devel] Re: bug wranglers

2010-10-19 Thread Mike Hansen
On Tue, Oct 19, 2010 at 8:09 AM, Dr David Kirkby drkir...@gmail.com wrote:
 If that crashes Sage, and stops lots of people working on a
 Sage server, I think that's pretty serious, though not as bad as
 incorrect results.

It only crashes that one user's session.  Each worksheet is run in a
different process.

--Mike

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


Re: [sage-devel] Re: a Cython class in the reference manual ?

2010-10-12 Thread Mike Hansen
On Tue, Oct 12, 2010 at 10:28 AM, Nathann Cohen nathann.co...@gmail.com wrote:
 Sorry, I was actually talking about the cdef'ed methods of my Cython classes 
 ^^;

cdef'd methods are not included in the documentation since there is no
way to access them from the Python level.  You could write some Sphinx
extension to try and parse the source code to include them.

--Mike

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


Re: [sage-devel] Re: a Cython class in the reference manual ?

2010-10-12 Thread Mike Hansen
On Tue, Oct 12, 2010 at 1:22 PM, Simon King simon.k...@nuigalway.ie wrote:
 Would it help to cpdef these methods? That way, they are accessible at
 Python level, but are still cythonised.

Yep, if you are able to cpdef them, then that would work.

--Mike

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


Re: [sage-devel] User identification, did something change ?

2010-10-11 Thread Mike Hansen
On Mon, Oct 11, 2010 at 5:11 AM, Thierry Dumont
tdum...@math.univ-lyon1.fr wrote:
 I am changing my server (used by  hundreds of students...). It was base on a
 old version of Sage, and I am switching to 4-5.2.

 In my old version, I installed a patch to avatars.py so that Sage looks at
 the ldap server of the university, and creates the user if necessary.

 Is Sage always using avatars.py ?

Are you patching devel/sage/sage/server/notebook/avatars.py?  If so,
then that is the wrong file.  All of the notebook code is now in the
sagenb spkg.  When 4.6 is out, it will be easier to change the sagenb
spkg as there will be a devel/sagenb directory.  Until then, you can
just extract the spkg with tar xvfj sagenb-0.8.x.spkg, make the
changes in there, do sage -spkg  sagenb-0.8.x to rebuild it, and
then do sage -f sagenb-0.8.x.spkg to install it.

--Mike

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


Re: [sage-devel] Cython syntax highlighting for Sphinx

2010-10-10 Thread Mike Hansen
On Sun, Oct 10, 2010 at 12:55 AM, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 Does anybody know how to have syntax highlighting for Cython code in
 Sage?  Clearly the code exists, because the official Cython
 documentation (see for example
 http://docs.cython.org/src/tutorial/external.html) is properly syntax
 highlighted.  So either this is not included in Sage or it is but I
 don't know how to enable it.

You can do

.. code-block:: cython

   cdef i

See http://sphinx.pocoo.org/markup/code.html for more info.

--Mike

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


Re: [sage-devel] Re: sage crashes on calculating roots of a polynom

2010-10-10 Thread Mike Hansen
On Sun, Oct 10, 2010 at 11:15 AM, maldun dom...@gmx.net wrote:
 sage: sage: a = var('a')
 sage: sage: R.x  = a.parent()[]
 sage: sage: (x - a).change_ring(RR) # boom!

I've posted a patch at http://trac.sagemath.org/sage_trac/ticket/10100
which fixes this.

--Mike

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


Re: [sage-devel] Re: sage crashes on calculating roots of a polynom

2010-10-10 Thread Mike Hansen
On Sun, Oct 10, 2010 at 2:05 PM, maldun dom...@gmx.net wrote:
 Thanks to your patch the segfault is now gone, but apperently a new
 problem arises:

That is what is supposed to happen.  There's no way to convert (x-a)
to a polynomial over the reals since -a cannot be converted to a
real number.

--Mike

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


Re: [sage-devel] macaulay2_console()

2010-10-10 Thread Mike Hansen
On Sun, Oct 10, 2010 at 3:51 PM, Dr. David Kirkby
david.kir...@onetel.net wrote:
 sage: macaulay2_console()
 sh: line 1: M2: not found

 Is M2 supposed to be an optional package, or something like that? If so we
 should state so in the help.

Yes, M2 is optional so macaulay2_console() will only work if the M2
executable can be found.

--Mike

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


Re: [sage-devel] Sage hangs on random_prime(1,0,-23)

2010-10-09 Thread Mike Hansen
On Sat, Oct 9, 2010 at 11:59 AM, David Kirkby david.kir...@onetel.net wrote:
 I beg to differ ~John - to me it is *very* confusing to me, but then
 I've not used Sage much.

It is because you aren't familiar with Python and its conventions.

 It's not obvious to me if random_prime()  is called with two
 arguments, whether the second argument is the lower bound, or the
 proof. How am I supposed to know?

If you call it with with only positional arguments then it uses the
order that is in the function definition.

 Neither is it obvious to me if the 'proof' should be one of  None,
 bool or False.

This is right in the docstring.

 * This returns a prime between 20 and 123, so I might reasonably
 expect that the second argument is the lower bound and not the proof.

 sage: random_prime(123,20)
 109

Incorrect.

 * But this returns a prime under 123, so I might conclude the second
 argument is taken to be the proof

When you call it like that, the second argument is the proof keyword.

 sage: random_prime(123,bool)
 29

Nope.  When bool is written in the docstring, it means to pass in
either True or False -- not the bool type.

 sage:  random_prime(123,None)
 59

This is the same as random_prime(123),

 sage:  random_prime(123,False)
 83

Usually, you'd write this random_prime(123, proof=False)

 * I don't have a *** clue what this is doing!

 sage: random_prime(123,2000)
 3

 Is 2000 the lower bound? The proof?

2000 is what you're passing in as the proof parameter.  Since
bool(2000) is True, this is equivalent to random_prime(123,
proof=True).


 I had a thought. Clearly the fact this generates random data can cause
 issues with doctesting. But we could avoid that by suitable choice or
 the range

This is handled by setting the random seed.

 Since I can't work out what the Sage one is doing, I'll use a couple
 of examples from Mathematica using RandomPrime[] which I feel is
 better documented.

 http://reference.wolfram.com/mathematica/ref/RandomPrime.html

 In[8]:= RandomPrime[{1000,1900}]

 Out[8]= 1871

 In[9]:= RandomPrime[{1000,1900}]

 Out[9]= 1103

If you want this, you'd do

random_prime(1900, lbound=1000)

--Mike

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


Re: [sage-devel] Re: mwrank(-10) - sensible or not ???

2010-10-09 Thread Mike Hansen
On Sat, Oct 9, 2010 at 1:17 PM, David Kirkby david.kir...@onetel.net wrote:
 * Binomial[] in Mathematica == Good error reporting
 * binomial() in Sage ==  Sub-optimal error reporting

I don't understand this -- they have basically the same error messages:

sage: binomial()
TypeError: binomial() takes exactly 2 arguments (0 given)
sage: binomial(1,2,3)
TypeError: binomial() takes exactly 2 arguments (3 given)

--Mike

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


Re: [sage-devel] Is trac down again?

2010-10-07 Thread Mike Hansen
It should be up now.

--Mike

On Thu, Oct 7, 2010 at 6:40 PM, Dr. David Kirkby
david.kir...@onetel.net wrote:
 Whatever ticket I pick, I get the error message

 Not Found
 The requested URL was not found on the server.
 If you entered the URL manually please check your spelling and try again.

 e.g. http://trac.sagemath.org/sage_trac/ticket/10092

 Dave

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


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


Re: [sage-devel] Please explain _pari_ and _pari_init_

2010-09-21 Thread Mike Hansen
Hello,

On Thu, Aug 19, 2010 at 2:54 PM, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 I noticed some classes in Sage have a _pari_ method (which seems to be
 used to convert self to a PARI GEN).  But there is also _pari_init_,
 which seems to be more or less the same (although, through a string).
 What is the point of this?  If there is any documentation about this,
 feel free to point it out to me.

Here's what is going on.  We have the pexpect interface to GP (which
we will refer to as gp) as well as C interface to PARI (which we will
refer to as pari).

gp:
   - Defined in sage/intefaces/gp.py
   - Specifies name=pari in the constructor
(sage/interfaces/gp.py:156), which would normally make gp(foo) try to
call foo._pari_(), but there is special case code in Expect.__call__
to change this to use foo._gp_() instead.
(sage/interfaces/expect.py:1056)
   -  foo._gp_(gp) which is supposed to return a GpElement
   - SageObject provides a default implementation of _gp_() which
calls SageObject._interface_(gp), which in turn tries to call
_pari_init_ (since gp has name=pari)
   - Generally, the thing returned from the _XXX_init_ methods is a
string, but what really matters is that it is some object such that
when it's passed to the __call__ method of the interface object, it
returns the right thing.  See sage/structure/sage_object.pyx:387.
   - SageObject also defines a default implementation of _gp_init_
which just calls _pari_init_.  I don't think this function is run
anywhere.


pari:
  - Defined in sage/libs/pari/gen.pyx
  - Uses foo._pari_() which is supposed to return a PARI GEN object.
sage/libs/pari/gen.pyx:8414
  - SageObject defines a default implementation of _pari_() which will
try calling pari(foo._pari_init_()).
  - pari(string) will eventually call gp_read_str(string) which
should return a GEN object.

The idea behind all of the _XXX_ and _XXX_init_ methods is that _XXX_
returns the actual object whereas _XXX_init_ returns something which
is fed into the parent's __call__ method.

The reason why the PARI situation is a bit more complicated is that
anything string you return from _gp_init_ should be valid as a
_pari_init_ function.  We should really name the name=pari in the gp
Expect object so that we can remove the special case code.  We should
then also just have the default implementation of _gp_init_ call
_pari_init_ so that if you just define that, it will work for both gp
and pari.

Sorry it took so long to answer this.

--Mike

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


Re: [sage-devel] sage/tests/startup.py fails too often

2010-09-17 Thread Mike Hansen
On Fri, Sep 17, 2010 at 12:12 AM, Jeroen Demeyer jdeme...@cage.ugent.be wrote:
 I do not like the sage/tests/startup.py test (which tests, only on
 sage.math.washington.edu, that Sage starts up in 1.5 seconds).  I
 regularly get non-reproducible failures in this doctest.  As far as I'm
 concerned, that test can simply be removed.

Or, an alternative to just removing the test is to make it so that
Sage starts up faster so that the test doesn't fail.  Something like
http://trac.sagemath.org/sage_trac/ticket/6494 is a step in that
direction.

--Mike

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


Re: [sage-devel] Re: How to deal with GAP's machine dependent random generator?

2010-09-11 Thread Mike Hansen
On Fri, Sep 10, 2010 at 10:17 PM, Dima Pasechnik dimp...@gmail.com wrote:
 Does current_randstate().set_seed_gap() actually sets GAP's random
 seed, so that
 subsequent GAP commands make use of the correctly set seed?

Yep.

--Mike

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


Re: [sage-devel] bug? is_triangular_number(0), Range Types: Bool, Integer

2010-09-08 Thread Mike Hansen
On Wed, Sep 8, 2010 at 4:35 PM, mda_ donmorri...@gmail.com wrote:
 The not coerces 0 into True, thereby keeping it in the list
 comprehension.  Should I file a bug?

According to the documentation for is_triangular_number, you should
use the following test if you want to consider 0 triangular:

sage:  [x for x in [0..3] if is_triangular_number(x) is not False]
[0, 1, 3]
sage:  [x for x in [0..3] if is_triangular_number(x) is False]
[2]

--Mike

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


Re: [sage-devel] How to deal with GAP's machine dependent random generator?

2010-09-06 Thread Mike Hansen
On Mon, Sep 6, 2010 at 4:55 AM, Simon King simon.k...@nuigalway.ie wrote:
 The remaining problem concerns the random generator of GAP. It behaves
 differently on T2 than on any other machine that I have access to.

My guess is that it is due to the endianness of the machine.  For
example, check out this snippet from sage.misc.randstate:

 # GAP's random number generator initialization
 # (in integer.c, in FuncInitRandomMT) takes its
 # seed as a string, then converts this string into
 # an array of 32-bit integers just by casting the
 # pointer.  Thus, the result depends on the
 # endianness of the machine.  As a workaround, we
 # swap the bytes in the string ourselves, so that
 # GAP always gets the same array of integers.

If you're using GAP from withing Sage, you might just want to do
current_randstate().set_seed_gap() to initialize the random number
generators.  Note that both of the following are reset:

 prev_mersenne_seed = gap.Reset(gap.GlobalMersenneTwister,
mersenne_seed)
 prev_classic_seed = gap.Reset(gap.GlobalRandomSource, classic_seed)

--Mike

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


  1   2   3   4   5   6   >