[sage-support] Re: bug: unix commands do not like backslashes and numbers
On Apr 29, 6:24 am, William Stein [EMAIL PROTECTED] wrote: On Mon, Apr 28, 2008 at 8:25 PM, schmmd [EMAIL PROTECTED] wrote: Hi, Sage has poor support for filenames that contain a space. For example, if you type `mkdir a\ e', which will create a directory named a e in bash, SAGE provides the not-so-friendly error: The file system underneath Sage is for now a Unix file system which uses space as a separator. It is generally a bad idea to use anything non [a-zA-Z0-9] in file names since it will likely break with other encodings and/or file systems. Windows introduced the rather stupid concept that allows file system path to contain spaces and it has broken numerous tools like the autotools for example. Having spaces or any other characters in file names is something you do not do and I personally see no reason why we should work around that limitation. As a workaround you might want to put an ! at the beginning of all lines that will be sent to the shell. E.g., sage: mkdir a\ e -- William sage: mkdir a\ e sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `LD_LIBRARY_PATH=$SAGE_ORIG_LD_LIBRARY_PATH;mkdir a._backslash_( e)' You must type `mkdir a e'. This is even more confusing with cd. If you have a directory named banana float and then type `cd banana' and hit tab, sage will complete the command as follows: sage: cd banana sage: cd banana\ float However, this command will once again only produce whine: sage: cd banana\ float [Errno 2] No such file or directory: 'banana._backslash_( float)' /home/michael You may type `cd banana float' or `cd banana float', even though this is not what sage's autocompletion suggests. There are also errors when cd-ing to a directory that contains a number in its name. sage: cd sage-3.0/ [Errno 2] No such file or directory: 'sage-RealNumber(3.0)/' /opt The likely issue here is that the preparser gets a hold of 3.0 and turns it into a RealNumer(3.0). Just enclosed the path you want to cd into with quotes and it does work: sage: mkdir 3.0 sage: cd 3.0 /home/mabshoff/3.0 sage: Sage will, however, still autocomplete without quotes. Yes, I would guess ipython is a little too clever for its own regard here. Cheers, Michael -- William Stein Associate Professor of Mathematics University of Washingtonhttp://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: bug: unix commands do not like backslashes and numbers
On Apr 28, 2008, at 11:32 PM, mabshoff wrote: On Apr 29, 6:24 am, William Stein [EMAIL PROTECTED] wrote: On Mon, Apr 28, 2008 at 8:25 PM, schmmd [EMAIL PROTECTED] wrote: Hi, Sage has poor support for filenames that contain a space. For example, if you type `mkdir a\ e', which will create a directory named a e in bash, SAGE provides the not-so-friendly error: The file system underneath Sage is for now a Unix file system which uses space as a separator. It is generally a bad idea to use anything non [a-zA-Z0-9] in file names since it will likely break with other encodings and/or file systems. Windows introduced the rather stupid concept that allows file system path to contain spaces and it has broken numerous tools like the autotools for example. Having spaces or any other characters in file names is something you do not do and I personally see no reason why we should work around that limitation. I think spaces in filenames is something that should be supported, especially as we look to porting to Windows (where the users entire home folder sits inside Documents and Settings. The preparser shouldn't be called on lines sent to the shell, though I'm not sure how to best detect that (other than explicitly prefacing with a !). It is kind of odd that ipython will automatically treat some commands as shell commands. As a workaround you might want to put an ! at the beginning of all lines that will be sent to the shell. E.g., sage: mkdir a\ e -- William sage: mkdir a\ e sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `LD_LIBRARY_PATH=$SAGE_ORIG_LD_LIBRARY_PATH;mkdir a._backslash_( e)' You must type `mkdir a e'. This is even more confusing with cd. If you have a directory named banana float and then type `cd banana' and hit tab, sage will complete the command as follows: sage: cd banana sage: cd banana\ float However, this command will once again only produce whine: sage: cd banana\ float [Errno 2] No such file or directory: 'banana._backslash_( float)' /home/michael You may type `cd banana float' or `cd banana float', even though this is not what sage's autocompletion suggests. There are also errors when cd-ing to a directory that contains a number in its name. sage: cd sage-3.0/ [Errno 2] No such file or directory: 'sage-RealNumber(3.0)/' /opt The likely issue here is that the preparser gets a hold of 3.0 and turns it into a RealNumer(3.0). Just enclosed the path you want to cd into with quotes and it does work: sage: mkdir 3.0 sage: cd 3.0 /home/mabshoff/3.0 sage: Sage will, however, still autocomplete without quotes. Yes, I would guess ipython is a little too clever for its own regard here. Cheers, Michael -- William Stein Associate Professor of Mathematics University of Washingtonhttp://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: bug: unix commands do not like backslashes and numbers
On Apr 29, 5:40 pm, Robert Bradshaw [EMAIL PROTECTED] wrote: On Apr 28, 2008, at 11:32 PM, mabshoff wrote: SNIP The file system underneath Sage is for now a Unix file system which uses space as a separator. It is generally a bad idea to use anything non [a-zA-Z0-9] in file names since it will likely break with other encodings and/or file systems. Windows introduced the rather stupid concept that allows file system path to contain spaces and it has broken numerous tools like the autotools for example. Having spaces or any other characters in file names is something you do not do and I personally see no reason why we should work around that limitation. I think spaces in filenames is something that should be supported, especially as we look to porting to Windows (where the users entire home folder sits inside Documents and Settings. The preparser shouldn't be called on lines sent to the shell, though I'm not sure how to best detect that (other than explicitly prefacing with a !). It is kind of odd that ipython will automatically treat some commands as shell commands. Yes, but there are two bugs here: a) an issue in ipython, i.e. sage: cd? Type: Magic function Base Class: type 'instancemethod' String Form:bound method InteractiveShell.magic_cd of IPython.iplib.InteractiveShell object at 0x6036e950 Namespace: IPython internal File: /home/mabshoff/sage-3.0.1.alpha0/local/lib/python2.5/ site-packages/IPython/Magic.py Definition: cd(self, parameter_s='') Docstring: Change the current working directory. cd either needs to learn how to escape certain characters or just put quotes around the name. Quotes won't help if you have quotes in a file name [which some people do - I have seen it]. On Windows we could always convert long file names [with spaces] to short 8.3 file names, but I guess that would require hacking on ipython itself. Either way, we are running some quite old version of ipython and we maybe should consider upgrading. b) The preparser, i.e. 3.0-RealNumber(3.0): This is a more general issue, i.e. people get bitten by it when using numpy/scipy regularly. I am not sure what can be done here on a technical level to avpoid this whole mess. Any ideas? SNIP Cheers, Michael --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: bug: unix commands do not like backslashes and numbers
On Tue, Apr 29, 2008 at 8:52 AM, mabshoff [EMAIL PROTECTED] wrote: On Apr 29, 5:40 pm, Robert Bradshaw [EMAIL PROTECTED] wrote: On Apr 28, 2008, at 11:32 PM, mabshoff wrote: SNIP The file system underneath Sage is for now a Unix file system which uses space as a separator. It is generally a bad idea to use anything non [a-zA-Z0-9] in file names since it will likely break with other encodings and/or file systems. Windows introduced the rather stupid concept that allows file system path to contain spaces and it has broken numerous tools like the autotools for example. Having spaces or any other characters in file names is something you do not do and I personally see no reason why we should work around that limitation. I think spaces in filenames is something that should be supported, especially as we look to porting to Windows (where the users entire home folder sits inside Documents and Settings. The preparser shouldn't be called on lines sent to the shell, though I'm not sure how to best detect that (other than explicitly prefacing with a !). It is kind of odd that ipython will automatically treat some commands as shell commands. Yes, but there are two bugs here: a) an issue in ipython, i.e. sage: cd? Type: Magic function Base Class: type 'instancemethod' String Form:bound method InteractiveShell.magic_cd of IPython.iplib.InteractiveShell object at 0x6036e950 Namespace: IPython internal File: /home/mabshoff/sage-3.0.1.alpha0/local/lib/python2.5/ site-packages/IPython/Magic.py Definition: cd(self, parameter_s='') Docstring: Change the current working directory. cd either needs to learn how to escape certain characters or just put quotes around the name. Quotes won't help if you have quotes in a file name [which some people do - I have seen it]. On Windows we could always convert long file names [with spaces] to short 8.3 file names, but I guess that would require hacking on ipython itself. Either way, we are running some quite old version of ipython and we maybe should consider upgrading. b) The preparser, i.e. 3.0-RealNumber(3.0): This is a more general issue, i.e. people get bitten by it when using numpy/scipy regularly. I am not sure what can be done here on a technical level to avpoid this whole mess. Any ideas? It's 3.0 - RealNumber('3.0') Regarding numpy/scipy the only longterm solution is to fix numpy/scipy to call the __float__ method instead of going boom on certain data types.People can also just type RealNumber = float and Integer=int, in the meantime, which works very well. -- William --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: bug: unix commands do not like backslashes and numbers
On Apr 29, 5:57 pm, William Stein [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 8:52 AM, mabshoff SNIP b) The preparser, i.e. 3.0-RealNumber(3.0): This is a more general issue, i.e. people get bitten by it when using numpy/scipy regularly. I am not sure what can be done here on a technical level to avpoid this whole mess. Any ideas? It's 3.0 - RealNumber('3.0') Regarding numpy/scipy the only longterm solution is to fix numpy/scipy to call the __float__ method instead of going boom on certain data types. People can also just type RealNumber = float and Integer=int, in the meantime, which works very well. I know about that :), I meant generally figuring out a way to use the Preparser in most cases, but not when handing off input to ipython for example. -- William Cheers, Michael --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: bug: unix commands do not like backslashes and numbers
On Tue, Apr 29, 2008 at 9:07 AM, mabshoff [EMAIL PROTECTED] wrote: On Apr 29, 5:57 pm, William Stein [EMAIL PROTECTED] wrote: On Tue, Apr 29, 2008 at 8:52 AM, mabshoff SNIP b) The preparser, i.e. 3.0-RealNumber(3.0): This is a more general issue, i.e. people get bitten by it when using numpy/scipy regularly. I am not sure what can be done here on a technical level to avpoid this whole mess. Any ideas? It's 3.0 - RealNumber('3.0') Regarding numpy/scipy the only longterm solution is to fix numpy/scipy to call the __float__ method instead of going boom on certain data types.People can also just type RealNumber = float and Integer=int, in the meantime, which works very well. I know about that :), I meant generally figuring out a way to use the Preparser in most cases, but not when handing off input to ipython for example. This particular case of not preparsing in case IPython is going to do some funny shell magic should be easy to fix (by changing IPython itself). I've cc'd Fernando Perez, since it's the sort of thing he can probably fix easily in an hour, or tell us what to do differently. -- william --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] normalizing a vector throws coercion exception
I noticed the following behavior today in Linear Algebra, which came up when trying to make an orthonormal basis. Does anyone know what is going on? sage: a=(QQ^3).subspace([[1,0,1]]) sage: b=a.basis()[0] sage: b/b.norm() --- type 'exceptions.TypeError' Traceback (most recent call last) /home/grout/ipython console in module() /home/grout/element.pyx in sage.structure.element.Vector.__div__ (sage/structure/element.c:10962)() /home/grout/element.pyx in sage.structure.element.Vector.__mul__ (sage/structure/element.c:10413)() /home/grout/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op_c (sage/structure/coerce.c:5292)() type 'exceptions.TypeError': unsupported operand parent(s) for '*': 'Vector space of degree 3 and dimension 1 over Rational Field Basis matrix: [1 0 1]' and 'Symbolic Ring' Note that the following does work: sage: b=vector(QQ,[1,0,1]) sage: b/b.norm() (1/sqrt(2), 0, 1/sqrt(2)) Thanks, Jason --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Fwd: Must SELinux be disabled to run sage?
-- Forwarded message -- From: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tue, Apr 29, 2008 at 8:15 AM Subject: Re: Must SELinux be disabled to run sage? To: William Stein [EMAIL PROTECTED] Cc: Richard Vaughn [EMAIL PROTECTED] Hi William: Thanks for the response. Always nice to learn it wasn't something *I* was doing. :) Is the issue here, as mentioned in the README, that SELinux affects default system behaviors such as shared Library loading, and that's why sage has a problem? (And, if that's the case, then wouldn't a lot of other applications also fail?) Thanks, -Richard Vaughn On Apr 23, 3:36 pm, William Stein [EMAIL PROTECTED] wrote: On Wed, Apr 23, 2008 at 12:33 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I recently installed sage on a Fedora Core 6 machine, and it appears that sage only runs when SELinux (secure linux) is disabled. When I run it w/ SELINUX=enforcing in /etc/sysconfig/selinux, I get cannot restore segment prot after reloc: Permission denied when I start sage. Is this the case, that SELinux must be disabled to run sage? Yes. This is mentioned in the Sage README.txt. Or is there perhaps a workaround? I don't know of one. I hope somebody eventually finds one and submits it to the sage project. Thanks, -Richard Vaughn -- William Stein Associate Professor of Mathematics University of Washingtonhttp://wstein.org -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Fwd: Must SELinux be disabled to run sage?
I'm running Sage on a RedHat EL box with SELinux turned on (and enforcing). After a bit of fighting with SELinux, here's what I did to get it working: 1. As root, I created /usr/local/sage and assigned ownership of that directory to my user account. The SELinux context of that directory is/are: root:object_r:usr_t 2. As me (my user level account, with UMASK set to permit group and other read/execute), I unpack sage into, e.g., /usr/local/sage/sage-3.0 which gets SELinux context: user_u:object_r:usr_t 3. I build sage in /usr/local/sage/sage-3.0 4. I then set a symbolc link /usr/local/sage/current - /usr/local/sage/sage-3.0 which has the same SELinux context as the referrent directory. Originally I tried building/installing Sage as root and I ran into all sorts of SELinux problems. Installing directly into system directories (even when using a chmod to change ownership to a user) also caused headaches. This particular system had lots of user (mainly my students) using Sage, and with this setup no one has complained to me about not being able to run Sage. --jason On Tue, Apr 29, 2008 at 3:10 PM, William Stein [EMAIL PROTECTED] wrote: -- Forwarded message -- From: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tue, Apr 29, 2008 at 8:15 AM Subject: Re: Must SELinux be disabled to run sage? To: William Stein [EMAIL PROTECTED] Cc: Richard Vaughn [EMAIL PROTECTED] Hi William: Thanks for the response. Always nice to learn it wasn't something *I* was doing. :) Is the issue here, as mentioned in the README, that SELinux affects default system behaviors such as shared Library loading, and that's why sage has a problem? (And, if that's the case, then wouldn't a lot of other applications also fail?) Thanks, -Richard Vaughn On Apr 23, 3:36 pm, William Stein [EMAIL PROTECTED] wrote: On Wed, Apr 23, 2008 at 12:33 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I recently installed sage on a Fedora Core 6 machine, and it appears that sage only runs when SELinux (secure linux) is disabled. When I run it w/ SELINUX=enforcing in /etc/sysconfig/selinux, I get cannot restore segment prot after reloc: Permission denied when I start sage. Is this the case, that SELinux must be disabled to run sage? Yes. This is mentioned in the Sage README.txt. Or is there perhaps a workaround? I don't know of one. I hope somebody eventually finds one and submits it to the sage project. Thanks, -Richard Vaughn -- -- Jason Worth Martin Asst. Professor of Mathematics http://www.math.jmu.edu/~martin --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: random questions
On Fri, Mar 28, 2008 at 9:05 AM, kcrisman [EMAIL PROTECTED] wrote: [...] Or I could make an init.sage file and put it in, right? It could be useful to put a sample of the sort of commands which live in that kind of file on the Wiki FAQ, or even a blank file with suggestions commented out in the actual distribution. +1 For now, here's mine. This allows me to reach python extensions installed with apt-get. [EMAIL PROTECTED]:~/.sage$ cat init.sage import sys sys.path += ['/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/var/lib/python-support/python2.5'] Best, -- Hector --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Cannot plot in SAGE 3.0 for MAC OS 10.4
i recently installed sage 2.11 and it ran without incident except that i was unable to run octave fully. this is one problem i would like worked out, but not the most immediate. i really like sage, and so installed 3.0 a few days ago as soon as it came out. installed the binary 'sage-3.0-osx10.4-intel-i386- Darwin.dmg' from the website http://www.sagemath.org/SAGEbin/apple_osx/intel/ i am running sage 3.0 on a Macbook Pro intel Core 2 Duo, with OS X 10.4.11. i operate sage from a firefox notebook interface. with the new install SAGE 3.0 i cannot plot anything, and am really stuck. when i say sage plot(sin(x), 0, 10) --- begin error message i get the following error message: Traceback (most recent call last): File stdin, line 1, in module File /Users/sediment/.sage/sage_notebook/worksheets/admin/12/code/ 1.py, line 6, in module plot(sin(x), Integer(0), Integer(10)) File /Applications/sage/local/lib/python2.5/site-packages/sympy/ plotting/, line 1, in module File sage_object.pyx, line 92, in sage.structure.sage_object.SageObject.__repr__ (sage/structure/ sage_object.c:620) File /Applications/sage/local/lib/python2.5/site-packages/sage/plot/ plot.py, line 738, in _repr_ self.show() File /Applications/sage/local/lib/python2.5/site-packages/sage/plot/ plot.py, line 1246, in show aspect_ratio=aspect_ratio) File /Applications/sage/local/lib/python2.5/site-packages/sage/plot/ plot.py, line 1346, in save from matplotlib.figure import Figure File /Applications/sage/local/lib/python2.5/site-packages/ matplotlib/figure.py, line 10, in module from axes import Axes, Subplot, PolarSubplot, PolarAxes File /Applications/sage/local/lib/python2.5/site-packages/ matplotlib/axes.py, line 20, in module from matplotlib import image as mimage File /Applications/sage/local/lib/python2.5/site-packages/ matplotlib/image.py, line 19, in module from matplotlib import _image ImportError: dlopen(/Applications/sage/local/lib/python2.5/site- packages/matplotlib/_image.so, 2): Library not loaded: /sw/lib/ libpng12.0.dylib Referenced from: /Applications/sage/local/lib/python2.5/site- packages/matplotlib/_image.so Reason: Incompatible library version: _image.so requires version 17.0.0 or later, but libpng12.0.dylib provides version 0.1.2 end error message -- i am not very savvy with coding/linux and getting into the guts of programs, and am wondering if there is a SIMPLE fix (if so, assume i know nothing and make any suggestions very EXPLICIT). thanks in advance. --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Cannot plot in SAGE 3.0 for MAC OS 10.4
I found the same problem using SAGE 3.0 on a MacBook running OS X. 4.11. Same behavior in both command line and notebook. Here's the error report that resulted from trying to plot from command line: * sage: plot(sin(x),0,10) --- type 'exceptions.ImportError' Traceback (most recent call last) /Users/shapiro/ipython console in module() /Applications/sage-3.0/local/lib/python2.5/site-packages/IPython/ Prompts.py in __call__(self, arg) 521 522 # and now call a possibly user-defined print mechanism -- 523 manipulated_val = self.display(arg) 524 525 # user display hooks can change the variable to be stored in /Applications/sage-3.0/local/lib/python2.5/site-packages/IPython/ Prompts.py in _display(self, arg) 545 546 -- 547 return self.shell.hooks.result_display(arg) 548 549 # Assign the default display method: /Applications/sage-3.0/local/lib/python2.5/site-packages/IPython/ hooks.py in __call__(self, *args, **kw) 132 #print prio,prio,cmd,cmd #dbg 133 try: -- 134 ret = cmd(*args, **kw) 135 return ret 136 except ipapi.TryNext, exc: /Applications/sage-3.0/local/lib/python2.5/site-packages/IPython/ hooks.py in result_display(self, arg) 160 161 if self.rc.pprint: -- 162 out = pformat(arg) 163 if '\n' in out: 164 # So that multi-line strings line up with the left column of /Applications/sage-3.0/local/lib/python/pprint.py in pformat(self, object) 109 def pformat(self, object): 110 sio = _StringIO() -- 111 self._format(object, sio, 0, 0, {}, 0) 112 return sio.getvalue() 113 /Applications/sage-3.0/local/lib/python/pprint.py in _format(self, object, stream, indent, allowance, context, level) 127 self._readable = False 128 return -- 129 rep = self._repr(object, context, level - 1) 130 typ = _type(object) 131 sepLines = _len(rep) (self._width - 1 - indent - allowance) /Applications/sage-3.0/local/lib/python/pprint.py in _repr(self, object, context, level) 193 def _repr(self, object, context, level): 194 repr, readable, recursive = self.format(object, context.copy(), -- 195 self._depth, level) 196 if not readable: 197 self._readable = False /Applications/sage-3.0/local/lib/python/pprint.py in format(self, object, context, maxlevels, level) 205 and whether the object represents a recursive construct. 206 -- 207 return _safe_repr(object, context, maxlevels, level) 208 209 /Applications/sage-3.0/local/lib/python/pprint.py in _safe_repr(object, context, maxlevels, level) 290 return format % _commajoin(components), readable, recursive 291 -- 292 rep = repr(object) 293 return rep, (rep and not rep.startswith('')), False 294 /Users/shapiro/sage_object.pyx in sage.structure.sage_object.SageObject.__repr__ (sage/structure/ sage_object.c:620)() /Applications/sage-3.0/local/lib/python2.5/site-packages/sage/plot/ plot.py in _repr_(self) 736 737 if SHOW_DEFAULT: -- 738 self.show() 739 return '' 740 else: /Applications/sage-3.0/local/lib/python2.5/site-packages/sage/plot/ plot.py in show(self, xmin, xmax, ymin, ymax, figsize, filename, dpi, axes, axes_labels, frame, fontsize, aspect_ratio) 1250 self.save(filename, xmin, xmax, ymin, ymax, figsize, dpi=dpi, axes=axes, 1251 frame=frame, fontsize=fontsize, - 1252 aspect_ratio=aspect_ratio) 1253 os.system('%s %s 2/dev/null 1/dev/null '% (sage.misc.viewer.browser(), filename)) 1254 /Applications/sage-3.0/local/lib/python2.5/site-packages/sage/plot/ plot.py in save(self, filename, xmin, xmax, ymin, ymax, figsize, figure, sub, savenow, dpi, axes, axes_labels, fontsize, frame, verify, aspect_ratio) 1344 axes = self.__show_axes 1345 - 1346 from matplotlib.figure import Figure 1347 if filename is None: 1348 filename = sage.misc.misc.graphics_filename() /Applications/sage-3.0/local/lib/python2.5/site-packages/matplotlib/ figure.py in module() 8 import artist 9 from artist import Artist --- 10 from axes import Axes, Subplot, PolarSubplot, PolarAxes 11 from cbook import flatten, allequal, Stack, iterable, dedent 12 import _image /Applications/sage-3.0/local/lib/python2.5/site-packages/matplotlib/ axes.py in module() 18 from matplotlib import dates as mdates 19 from matplotlib import font_manager --- 20 from matplotlib import image as mimage 21 from matplotlib import legend as mlegend 22
[sage-support] Re: Fwd: Must SELinux be disabled to run sage?
On Apr 29, 9:53 pm, Jason Martin [EMAIL PROTECTED] wrote: Hi, I'm running Sage on a RedHat EL box with SELinux turned on (and enforcing). Getting Sage to work with SELinux is not the problem, it is more knowing which roles are available and how to convince the OS to set them. It is likely that Sage could learn how to do so with common distributions like RHEL, but it is problematic and cannot likely work out of the box for some generic SELinux setup. That said we should provide scripts for common Linux releases and if people are willing to figure out how to run Sage+SELinux on $FOO we should add their methods. SNIP -- Jason Worth Martin Cheers, Michael Asst. Professor of Mathematicshttp://www.math.jmu.edu/~martin --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Cannot plot in SAGE 3.0 for MAC OS 10.4
On Apr 30, 2:08 am, JoelS [EMAIL PROTECTED] wrote: Hi, I found the same problem using SAGE 3.0 on a MacBook running OS X. 4.11. Same behavior in both command line and notebook. Here's the error report that resulted from trying to plot from command line: * sage: plot(sin(x),0,10) type 'exceptions.ImportError': dlopen(/Applications/sage-3.0/local/ lib/python2.5/site-packages/matplotlib/_image.so, 2): Library not loaded: /sw/lib/libpng12.0.dylib Referenced from: /Applications/sage-3.0/local/lib/python2.5/site- packages/matplotlib/_image.so Reason: image not found Both problems are essentially the same. In this case matplotlib ends up getting linked against the MacPorts libpng in sw. One solution is to clean your PATH and DY_LD_LIBRARY_PATH for now of any references to /sw. MacPorts is about as useful as Cygwin in general, but no need to rand and rave here. Reason: Incompatible library version: _image.so requires version 17.0.0 or later, but libpng12.0.dylib provides version 0.1.2 Here we end up linking against the system's libpng. I have to investigate why matplotlib is stupid in the first place, but python+libpng is an open problem with Sage on OSX 10.4 anyway and maybe the switch to 2.5.2 in 3.0 did introduce some changes that caused this to get worst. It has been on my list for a long, long time to finally teach Python and distutils about the need to obey and link against the libpng I tell it to, so please open a blocker ticket and let's get those issues fixed. Thanks for reporting the bug. Cheers, Michael --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] XDroplets for SAGE integration to Mac OS X
The README file for SAGE's Mac OS X version mentions that easier environment integration would be in order, were a Mac OS X developer to help. I don't need it myself – I actually prefer to call SAGE manually after opening a terminal window – but has anyone looked into XDroplets [1]? XDroplets is [a] set of launchers that better integrate X11 programs with the Mac OS X environment, along with an application to create new launchers. I haven't bothered to give it much of a look, but since the launchers are (according to the project page) AppleScript droplets [2], I'd bet they will work independently of XDroplets; it should be easy, then, to create an XDroplet launcher for SAGE and include it in the Mac OS X distribution. [1] http://www.rhythmiccanvas.com/software/xdroplets/index.html [2] http://en.wikipedia.org/wiki/AppleScript#Applets_and_Droplets -- Ja ne, Helio Perroni Filho Memory Leak http://xperroni.blogspot.com --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: mesh lines in a 3d plot
On Mar 31, 1:27 pm, Jason Grout [EMAIL PROTECTED] wrote: William Stein wrote: On Mon, Mar 31, 2008 at 11:03 AM, Jason Grout [EMAIL PROTECTED] wrote: Is there an easy way to getmeshlines in a plot3d surface? This is not implemented. I wish you would implement it :-) Robert Bradshaw might have some useful advise. Well, he already answered my question in the source. In sage/sage/plot/plot3d/index_set.pyx, starting at line 658 (in 2.10.4): # If we wanted to turn on display of themeshlines or dots # we would uncomment thse. This should be determined by # render_params, probably. #s += '\npmesh %smesh\n'%name #s += '\npmesh %s dots\n'%name Uncommenting the appropriate line does indeed give ameshinJMOL. So now the question is how to expose this to the user. And how to extend it to do nontrivialmeshfunctions. Jason After reading these lines I couldn't wait to lay my hands on index_set.pyx, uncomment those lines and start plotting some good stuff. I recently downloaded the Vmware version, since Fedora 8 won't let me render 3D (just 2D, I guess I'm gonna have to try the Sun JDK), and I've been pleased with the quality of the plots, there's a lot of potential there, but I still miss the 'good 'ol mesh'. My experience with Unix editing tools (ed, sed, grep, etc.) has been so superficial that I must confess I find it easier to click the Kwrite icon than trying to understand search methods or regular expressions. The best I could achieve was to dump the file to screen (using w3m and Firefox opening a new tab for me) and that was it. Look but don't touch. Any suggestions?? - Louie - --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: XDroplets for SAGE integration to Mac OS X
On Apr 30, 3:06 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, The README file for SAGE's Mac OS X version mentions that easier environment integration would be in order, were a Mac OS X developer to help. I don't need it myself – I actually prefer to call SAGE manually after opening a terminal window – but has anyone looked into XDroplets [1]? I haven't looked at it in detail, but it seems to have potential. It seems a little large (12 mb dmg) and its main goal seems to be as yo mention X related apps. XDroplets is [a] set of launchers that better integrate X11 programs with the Mac OS X environment, along with an application to create new launchers. I haven't bothered to give it much of a look, but since the launchers are (according to the project page) AppleScript droplets [2], I'd bet they will work independently of XDroplets; it should be easy, then, to create an XDroplet launcher for SAGE and include it in the Mac OS X distribution. It will likely work without Sage being an X app, but it also appears that we can likely get the same result by using AppleScript directly. We have some wiki page where we have collected info about turning Sage into a more OSX like application, but I cannot find it at the moment. If anybody remembers please add the info here to that page. [1]http://www.rhythmiccanvas.com/software/xdroplets/index.html [2]http://en.wikipedia.org/wiki/AppleScript#Applets_and_Droplets -- Ja ne, Helio Perroni Filho Memory Leakhttp://xperroni.blogspot.com Cheers, Michael --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: mesh lines in a 3d plot
On Tue, Apr 29, 2008 at 7:51 PM, louie [EMAIL PROTECTED] wrote: On Mar 31, 1:27 pm, Jason Grout [EMAIL PROTECTED] wrote: William Stein wrote: On Mon, Mar 31, 2008 at 11:03 AM, Jason Grout [EMAIL PROTECTED] wrote: Is there an easy way to getmeshlines in a plot3d surface? This is not implemented. I wish you would implement it :-) Robert Bradshaw might have some useful advise. Well, he already answered my question in the source. In sage/sage/plot/plot3d/index_set.pyx, starting at line 658 (in 2.10.4): # If we wanted to turn on display of themeshlines or dots # we would uncomment thse. This should be determined by # render_params, probably. #s += '\npmesh %smesh\n'%name #s += '\npmesh %s dots\n'%name Uncommenting the appropriate line does indeed give ameshinJMOL. So now the question is how to expose this to the user. And how to extend it to do nontrivialmeshfunctions. Jason After reading these lines I couldn't wait to lay my hands on index_set.pyx, uncomment those lines and start plotting some good stuff. I recently downloaded the Vmware version, since Fedora 8 won't let me render 3D (just 2D, I guess I'm gonna have to try the Sun JDK), and I've been pleased with the quality of the plots, there's a lot of potential there, but I still miss the 'good 'ol mesh'. My experience with Unix editing tools (ed, sed, grep, etc.) has been so superficial that I must confess I find it easier to click the Kwrite icon than trying to understand search methods or regular expressions. The best I could achieve was to dump the file to screen (using w3m and Firefox opening a new tab for me) and that was it. Look but don't touch. Any suggestions?? - Louie - This is trac ticket #2741: http://trac.sagemath.org/sage_trac/ticket/2741 I'll try to do it right now, so that mesh lines will be in the next version of Sage. William --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Cannot plot in SAGE 3.0 for MAC OS 10.4
On Tue, Apr 29, 2008 at 5:56 PM, mabshoff [EMAIL PROTECTED] wrote: On Apr 30, 2:08 am, JoelS [EMAIL PROTECTED] wrote: Hi, I found the same problem using SAGE 3.0 on a MacBook running OS X. 4.11. Same behavior in both command line and notebook. Here's the error report that resulted from trying to plot from command line: * sage: plot(sin(x),0,10) type 'exceptions.ImportError': dlopen(/Applications/sage-3.0/local/ lib/python2.5/site-packages/matplotlib/_image.so, 2): Library not loaded: /sw/lib/libpng12.0.dylib Referenced from: /Applications/sage-3.0/local/lib/python2.5/site- packages/matplotlib/_image.so Reason: image not found Both problems are essentially the same. In this case matplotlib ends up getting linked against the MacPorts libpng in sw. One solution is to clean your PATH and DY_LD_LIBRARY_PATH for now of any references to /sw. MacPorts is about as useful as Cygwin in general, but no need to rand and rave here. Reason: Incompatible library version: _image.so requires version 17.0.0 or later, but libpng12.0.dylib provides version 0.1.2 Here we end up linking against the system's libpng. I have to investigate why matplotlib is stupid in the first place, but python+libpng is an open problem with Sage on OSX 10.4 anyway and maybe the switch to 2.5.2 in 3.0 did introduce some changes that caused this to get worst. It has been on my list for a long, long time to finally teach Python and distutils about the need to obey and link against the libpng I tell it to, so please open a blocker ticket and let's get those issues fixed. Us posting binaries made on random machines with questionable system-wide libraries can always lead to problems. I got access to a clean 10.4 OSX box and am building an OS X 10.4 intel binary right now, which i'll upload. Of course, I would be happy if matplotlib wouldn't link in the stupid system wide libpng ever! -- William --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: mesh lines in a 3d plot
I recently downloaded the Vmware version, since Fedora 8 won't let me render 3D (just 2D, I guess I'm gonna have to try the Sun JDK), and I've been pleased with the quality of the plots, there's a lot of potential there, but I still miss the 'good 'ol mesh'. My experience with Unix editing tools (ed, sed, grep, etc.) has been so superficial that I must confess I find it easier to click the Kwrite icon than trying to understand search methods or regular expressions. The best I could achieve was to dump the file to screen (using w3m and Firefox opening a new tab for me) and that was it. Look but don't touch. Any suggestions?? - Louie - This is trac ticket #2741: http://trac.sagemath.org/sage_trac/ticket/2741 I'll try to do it right now, so that mesh lines will be in the next version of Sage. I've posted a patch to http://trac.sagemath.org/sage_trac/ticket/2741 If somebody (Jason Grout -- hint hint) referees it, then it'll be in the next sage release. It makes it so there is a mesh=True and dots=True option for plot3d and parametric_plot3d. The mesh looks pretty good. -- William --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: XDroplets for SAGE integration to Mac OS X
You don't need any fancy droplets or applets. You can just use the following AppleScript to activate Sage (take this script and save it as an AppleScript application, then put it in the same directory as the sage UNIX executable): tell application Finder set myFolder to container of (path to me) as string end tell tell application Terminal activate do script (POSIX path of myFolder) sage end tell If on the other hand you want to start the notebook and don't need the terminal window in front, you can use the following AppleScript to open a terminal window in the background and start Sage in notebook mode: tell application Finder set myFolder to container of (path to me) as string end tell tell application Terminal do script (POSIX path of myFolder) sage --notebook end tell What else did you folks have in mind in terms of Mac OS X integration? -- Greg On Tue, Apr 29, 2008 at 9:06 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: The README file for SAGE's Mac OS X version mentions that easier environment integration would be in order, were a Mac OS X developer to help. I don't need it myself – I actually prefer to call SAGE manually after opening a terminal window – but has anyone looked into XDroplets [1]? XDroplets is [a] set of launchers that better integrate X11 programs with the Mac OS X environment, along with an application to create new launchers. I haven't bothered to give it much of a look, but since the launchers are (according to the project page) AppleScript droplets [2], I'd bet they will work independently of XDroplets; it should be easy, then, to create an XDroplet launcher for SAGE and include it in the Mac OS X distribution. [1] http://www.rhythmiccanvas.com/software/xdroplets/index.html [2] http://en.wikipedia.org/wiki/AppleScript#Applets_and_Droplets -- Ja ne, Helio Perroni Filho Memory Leak http://xperroni.blogspot.com -- Gregory D. Landweber Assistant Professor of Mathematics Bard College --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---