[sage-support] Complex number and TypeError: 'float' object is not callable

2009-03-01 Thread Alasdair

Here's the error:

c=complex((sqrt(3)+2*I)^4)
imag(c)

returns

TypeError: 'float' object is not callable

So - how do I obtain the imaginary part of c?

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



[sage-support] Re: Small groups library is missing

2009-03-01 Thread mabshoff



On Mar 1, 5:04 am, David Joyner wdjoy...@gmail.com wrote:
 I can work on #5397 some today (finally).

 On Feb 27, 5:17 pm, mabshoff michael.absh...@mathematik.uni-

 dortmund.de wrote:
  On Feb 27, 3:37 am, David Joyner wdjoy...@gmail.com wrote:

   Just a guess that the skpg install script hardwires the wrong
   directory for the GAP pkgs.

  I have been thinking about such build problems and similar things
  happen in various other places.

  One way to attach this is to have a script called

   sage-gap-version

 I don't know how to add this using trac. I think the list of scripts
 is outside
 devel isn't it?





  that just returns the name of the current GAP install. This could be
  used if there were additional GAP packages in the future and there
  would be a good chance that things just keep working and as an added
  bonus would likely keep working with older Sage versions using older
  GAP releases, i.e. the optional GAP packages spkg would keep working
  with Sage releases prior to Sage 3.3.

  One way to attack this would be to use something along the lines of

  mabsh...@sage:/scratch/mabshoff/sage-3.4.alpha1/spkg/standard$ ./
  newest_version gap
  gap-4.4.12.p1

  and strip the .pX off the version number in case it exists. Another
  one would be to look into the right directory and find the highest
  currently installed GAP version.

 Here are the first few lines of the spkg-install script:

 

 #!/bin/sh

 # WARNING -- if you add a package here, also add it to
 # the gap_reset_workspace() command in
 #    SAGE_ROOT/devel/sage/sage/interfaces/gap.py
 #

 GAP=gap-4.4.10

 PATH=$SAGE_ROOT:$SAGE_ROOT/local/bin:$PATH

 export PATH

 rm -rf $SAGE_ROOT/local/lib/$GAP/pkg/
 mkdir $SAGE_ROOT/local/lib/$GAP/pkg/

 snip

 +++

 It is easy enough to (a) update the packages to their most recent
 version
 (my preference is, however, to remove nauty* from grape first), (b)
 replace 4.4.10 by 4.4.12 and rebuild.

No, see my comments earlier in this thread, i.e. do *not* hard code
the GAP release since this will break the spkg on Sage releases
earlier then 3.3 and also next time GAP is updated.

 Thoughts?

 sagemath and trac are down now anyway, so I'm not sure if this can be
 fixed today.
 I can start working on it after I finish grading an exam tomorrow and
 Almost definitely will be free to work on it a large chunk of the day
 Tuesday.


Cheers,

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



[sage-support] Re: Complex number and TypeError: 'float' object is not callable

2009-03-01 Thread Robert Bradshaw

On Mar 1, 2009, at 4:09 AM, Alasdair wrote:


 Here's the error:

 c=complex((sqrt(3)+2*I)^4)
 imag(c)

 returns

 TypeError: 'float' object is not callable

 So - how do I obtain the imaginary part of c?

c.imag

Our imag() function should really know about Python complex variables...

- Robert



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



[sage-support] Re: Complex number and TypeError: 'float' object is not c...

2009-03-01 Thread CalcPage
I didn't get c.imag() to work for me either,  I tried something like  this:
 
a=(sqrt(-3)+2)^2
print a
print a.expand()
print  a.expand().imag()
 
and got 
   2
(sqrt(3)  I +  2)

4 sqrt(3)  I +  1

4 sqrt(3)
 
HTH,
A.  Jorge Garcia
calcp...@aol.com
http://calcpage.tripod.com

Teacher   Professor
Applied Mathematics, Physics  Computer  Science
Baldwin Senior High School  Nassau Community  College



**A Good Credit Score is 700 or Above. See yours in just 2 easy 
steps! 
(http://pr.atwola.com/promoclk/100126575x1218822736x1201267884/aol?redir=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%26hmpgID
%3D62%26bcd%3DfebemailfooterNO62)

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



[sage-support] Re: Small groups library is missing

2009-03-01 Thread William Stein

 sagemath and trac are down now anyway, so I'm not sure if this can be
 fixed today.
 I can start working on it after I finish grading an exam tomorrow and
 Almost definitely will be free to work on it a large chunk of the day
 Tuesday.


They (=sagemath, cython, etc.) are all back up now.  Apache used up
all memory on sagemath for unknown reasons... and we're now logging
all output of top and have adjusted a bunch of parameters for apache2,
so we'll see what happens.

William

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



[sage-support] Re: Small groups library is missing

2009-03-01 Thread David Joyner

On Sun, Mar 1, 2009 at 8:37 AM, mabshoff
michael.absh...@mathematik.uni-dortmund.de wrote:






  One way to attack this would be to use something along the lines of

  mabsh...@sage:/scratch/mabshoff/sage-3.4.alpha1/spkg/standard$ ./
  newest_version gap
  gap-4.4.12.p1

  and strip the .pX off the version number in case it exists. Another
  one would be to look into the right directory and find the highest
  currently installed GAP version.

...


 No, see my comments earlier in this thread, i.e. do *not* hard code
 the GAP release since this will break the spkg on Sage releases
 earlier then 3.3 and also next time GAP is updated.


Okay, but won't having a script which earlier than 3.3 versions can't find
also break such an install? I guess I'm not completely understanding your idea
and how I can help gap_packages* by implementing it.




 Cheers,

 Michael
 


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



[sage-support] I can't load objets in Sage 3.2.3 that were created in Sage 3.1.1

2009-03-01 Thread Alex Lara

I'm using Sage 3.2.3. I can't load objects created and saved with Sage
3.1.1. I got the following message:
 DeprecationWarning: Your data is stored in an old format. Please use
the save() function to store your data in a more recent format.

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



[sage-support] Re: I can't load objets in Sage 3.2.3 that were created in Sage 3.1.1

2009-03-01 Thread Mike Hansen

Hi Alex,

On Sun, Mar 1, 2009 at 8:20 AM, Alex Lara lrodr...@gmail.com wrote:

 I'm using Sage 3.2.3. I can't load objects created and saved with Sage
 3.1.1. I got the following message:
  DeprecationWarning: Your data is stored in an old format. Please use
 the save() function to store your data in a more recent format.

They should still load.  The warning just tells you that the format
has changed so you should resave them to get the new format.  If they
don't actually load, could you please post a link to one of the .sobj
files?

--Mike

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



[sage-support] Re: Small groups library is missing

2009-03-01 Thread Simon King

Dear David,

On Mar 1, 5:04 pm, David Joyner wdjoy...@gmail.com wrote:
snip
   newest_version gap
   gap-4.4.12.p1

   and strip the .pX off the version number in case it exists. Another
   one would be to look into the right directory and find the highest
   currently installed GAP version.
snip
 Okay, but won't having a script which earlier than 3.3 versions can't find
 also break such an install? I guess I'm not completely understanding your idea
 and how I can help gap_packages* by implementing it.

As you say above, the spkg-install script has a hard-coded definition
GAP=gap-4.4.10. This is bad since in some situations the actual gap
version is a different one, so that things like
  rm -rf $SAGE_ROOT/local/lib/$GAP/pkg/
go to the wrong place.

Hence, the suggestion is to define the variable GAP by some script
that picks the latest version of gap. This can be done by the script
'newest_version' that you can find in SAGE_ROOT/spkg/standard/, and
which was there also in previous versions of Sage.

Hence, assuming that you are in spkg/standard, you could define
  GAP=`./newest_version gap`
which currently yields GAP=gap-4.4.10.p10, and then you have to
somehow remove the '.p10'.

Cheers
 Simon


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



[sage-support] Re: Small groups library is missing

2009-03-01 Thread Simon King

 Hence, assuming that you are in spkg/standard, you could define
   GAP=`./newest_version gap`
 which currently yields GAP=gap-4.4.10.p10, and then you have to
 somehow remove the '.p10'.

Upps, I tested the above in an *old* version of Sage. So, currently we
have
  ./newest_version gap
 gap-4.4.12.p1
and one needs to strip '.p1'.

Cheers,
 Simon

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



[sage-support] Re: Small groups library is missing

2009-03-01 Thread David Joyner

Thanks Simon! I didn't know that script already existed.
Now I know what needs to be done.


On Sun, Mar 1, 2009 at 11:59 AM, Simon King k...@mathematik.uni-jena.de wrote:

 Hence, assuming that you are in spkg/standard, you could define
   GAP=`./newest_version gap`
 which currently yields GAP=gap-4.4.10.p10, and then you have to
 somehow remove the '.p10'.

 Upps, I tested the above in an *old* version of Sage. So, currently we
 have
   ./newest_version gap
  gap-4.4.12.p1
 and one needs to strip '.p1'.

 Cheers,
     Simon

 


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



[sage-support] Re: I can't load objets in Sage 3.2.3 that were created in Sage 3.1.1

2009-03-01 Thread Alex Lara

From command line of Sage 3.1.1, I saved some object, and then I could
open it with sage 3.2.3. Next I open test.sobj (this was created by a
sage program) in sage 3.1.1,  saved it again, and when I tried to open
it on sage 3.2.3. Here you will find that object: 
http://math.arizona.edu/~alara/test.sobj

Alex

On 1 mar, 09:34, Mike Hansen mhan...@gmail.com wrote:
 Hi Alex,

 On Sun, Mar 1, 2009 at 8:20 AM, Alex Lara lrodr...@gmail.com wrote:

  I'm using Sage 3.2.3. I can't load objects created and saved with Sage
  3.1.1. I got the following message:
   DeprecationWarning: Your data is stored in an old format. Please use
  the save() function to store your data in a more recent format.

 They should still load.  The warning just tells you that the format
 has changed so you should resave them to get the new format.  If they
 don't actually load, could you please post a link to one of the .sobj
 files?

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



[sage-support] Re: I can't load objets in Sage 3.2.3 that were created in Sage 3.1.1

2009-03-01 Thread Mike Hansen

On Sun, Mar 1, 2009 at 9:56 AM, Alex Lara lrodr...@gmail.com wrote:

 From command line of Sage 3.1.1, I saved some object, and then I could
 open it with sage 3.2.3. Next I open test.sobj (this was created by a
 sage program) in sage 3.1.1,  saved it again, and when I tried to open
 it on sage 3.2.3. Here you will find that object: 
 http://math.arizona.edu/~alara/test.sobj

 Alex

Thanks.  I'll take a look at it.  I've also CC'd Craig Citro who most
likely knows what is going on here.

--Mike

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



[sage-support] Publsihing interact graphs with sage

2009-03-01 Thread dracero

I was trying to publish interactive graphics which I perform using
interact. I saw the slide bars and the numbers changing their values
but I could not see any graphic.
Does anybody help in order to get graphics in my published files?

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



[sage-support] Re: Publsihing interact graphs with sage

2009-03-01 Thread Timothy Clemans

Unfortunately published interact apps do not work by design for
security reasons.

On Sun, Mar 1, 2009 at 4:10 PM, dracero diego.rac...@gmail.com wrote:

 I was trying to publish interactive graphics which I perform using
 interact. I saw the slide bars and the numbers changing their values
 but I could not see any graphic.
 Does anybody help in order to get graphics in my published files?

 Thanks in advance.
 


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



[sage-support] Re: Importing lists from mathematica

2009-03-01 Thread thelamecamel

Hi guys,

For the benefit of others stuck as I was, or for those working on the
ticket, here's a simplified version of what's been working for me over
the last few months:

res = mathematica(mathcommand)
res_s = repr(res).replace('{','[').replace('}',']').replace
('*^','e').replace('\n','') #Convert string from mathematica syntax to
SAGE syntax
eval(res_s, {'I': numpy.complex(0,1)})

Note that mathematica uses *^ instead of 10^ or e.  There are some
other rules in sympy's parser, which is included with sage but is
seemingly unused (and possibly has minor whitespace issues?)

I had to use Python's eval, rather than sage_eval, because sage_eval
seems to die with some long inputs.  eval can crash too (with the same
EOF error), but it seems to be more robust.  Below is an example for
which both sage_eval() and eval() die.  If anyone could shed light on
the matter it would be appreciated.  N.B. the string should be a
single line, but may get wrapped by your email client.

This is Sage Version 3.2.3, Release Date: 2009-01-05 running on Mac OS
X 10.5.6, on a Core 2 Duo.


Cheers,
Felix


sage: import numpy
sage: sage_eval([[-1.8932465265296008 + 1.893245401219096*I,
1.6087131626818518e-13 + 0.2695869628135388*I, 4.038436252074007e-13 +
0.5773220560437329*I, 0.040116139014415714 - 1.817230393941216e-12*I,
0.08763251260817738 + 5.075925790798408e-12*I], [-0.31896241585415663
- 0.3189619384222391*I, -0.7736920455160119 + 6.955547249276606e-14*I,
-0.09760283144392495 - 1.446620601086579e-13*I,
-4.7592693674936015e-12 + 0.11967794129700637*I, 4.505212175542894e-12
- 0.03242615482565919*I], [0.15796096006135588 + 0.1579558759160282*I,
0.1033123763011309 + 5.815070647230414e-13*I, -0.760297341093265 -
1.257605131144146e-12*I, -1.7810239394400185e-11 +
0.1622656676464*I, 1.135841420918382e-12 - 0.12040909205325775*I],
[-0.04396392304349049 + 0.04395777885494245*I, -6.296074772649263e-13
+ 0.3269696039625*I, 4.616307336391401e-12 -
0.25810574383773044*I, -1.2307441793242817 - 1.56307189
[0.03422429098964126 - 0.03425285256357742*I, 3.7616437742471476e-13 +
0.04103981205323293*I, -6.284223141861389e-12 - 0.28800856674905706*I,
-0.21213614940591977 + 1.0860881638485864e-10*I, -1.1903766525513024 +
8.411160656862648e-12*I]], {'I': numpy.complex(0,1)})

   File string, line 1
 [[-RealNumber('1.8932465265296008')
SNIP
SyntaxError: unexpected EOF while parsing

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



[sage-support] Re: I can't load objets in Sage 3.2.3 that were created in Sage 3.1.1

2009-03-01 Thread Craig Citro

 From command line of Sage 3.1.1, I saved some object, and then I could
 open it with sage 3.2.3. Next I open test.sobj (this was created by a
 sage program) in sage 3.1.1,  saved it again, and when I tried to open
 it on sage 3.2.3. Here you will find that object: 
 http://math.arizona.edu/~alara/test.sobj

 Alex

 Thanks.  I'll take a look at it.  I've also CC'd Craig Citro who most
 likely knows what is going on here.

 --Mike


Hi Alex,

Yeah, this one is going to be a little bit annoying to fix. Here's
what's going on: in between 3.1.1 and 3.2.3, fraction fields got moved
over to the new coercion model. This is good, but as it happens, the
switch was done in such a way that it caused the pre-existing pickles
to not load correctly (which is exactly what you're seeing). There's
probably a clean and classy way to fix this, and I'll be happy to look
at it carefully in a few weeks if no one beats me to it (I'm busy
trying to finish up my thesis). This is now trac #5419.

In the interim, you probably want to hack something together so that
you can load your pickles. I managed to make sage 3.2.3 load the
pickles, but it's a pretty ugly hack, and you'll still need to re-save
the objects as newer pickles (which actually has one or two more
wrinkles), so that you don't have to deal with this in the short term.
How many of these files are there? If it's just a few, e-mail them to
me off-list, and I'll just re-pickle them in a newer format and send
them back to you. If there are more than that, I'll carefully explain
how you can fix them yourself. :)

-cc

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