[sage-support] Re: Doctesting external files
On Sat, Apr 19, 2008 at 9:34 PM, Timothy Clemans <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm using Sage to doctest the code I've written for a new external > project that I started. Currently I have to put ">>> from table import > *" at the top of each of my doctest blocks. I don't want to have to > add and remove this line before each release especially as my code > base enlarges. > > I'm requesting that the Sage frontend to Python's doctest framework be > made more intelligent when dealing with external files and projects. > For example, maybe if a file is outside the Sage code base, then the > frontend would add "from blah import *" to each doctest block > automatically where blah is the file name minus the filetype > identifier. > > Timothy Perhaps you could just use Python's standard doctesting framework since you're using >>> instead of sage:, etc., and hence not using the Sage preparser, and maybe not the Sage library? E.g., put something like this at the bottom of your file and run it is as a script. This is the canonical thing to do for general Python code, and it's described in the Python doctest documentation. if __name__ == '__main__': import doctest, sys s = doctest.testmod(sys.modules[__name__], optionflags=doctest.NORMALIZE_WHITESPACE |doctest.ELLIPSIS, verbose=False) sys.exit(s[0]) --~--~-~--~~~---~--~~ 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] Doctesting external files
Hi, I'm using Sage to doctest the code I've written for a new external project that I started. Currently I have to put ">>> from table import *" at the top of each of my doctest blocks. I don't want to have to add and remove this line before each release especially as my code base enlarges. I'm requesting that the Sage frontend to Python's doctest framework be made more intelligent when dealing with external files and projects. For example, maybe if a file is outside the Sage code base, then the frontend would add "from blah import *" to each doctest block automatically where blah is the file name minus the filetype identifier. Timothy --~--~-~--~~~---~--~~ 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 in DirichletGroup?
Yep, that's my fault. Fix is up at #2959; if you try it out and run into any issues, just let me know. -cc On Sat, Apr 19, 2008 at 1:55 PM, David Joyner <[EMAIL PROTECTED]> wrote: > > Hi: > > I wonder if this behavior is a bug? > > sage: G = DirichletGroup(21) > sage: chi = G.0; chi > [-1, 1] > sage: chi.values() > [0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1] > > So far, so good (similar code is in the tutorial: > http://www.sagemath.org/doc/html/tut/node15.html). > Now use a different base ring: > > > sage: G = DirichletGroup(21, GF(37)) > sage: chi = G.0; chi > [36, 1] > sage: chi.values() > --- > Traceback (most recent call last) > > /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/ in () > > > /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/local/lib/python2.5/site-packages/sage/modular/dirichlet.py > in values(self) >1056 >1057 # record character value on n > -> 1058 result_list[n.ivalue] = R_values[value.ivalue] >1059 # iterate: >1060 # increase the exponent vector by 1, > > : list index out of range > > > Should I report this to trac? > > - David Joyner > > > > --~--~-~--~~~---~--~~ 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 in DirichletGroup?
On Apr 19, 11:28 pm, "David Joyner" <[EMAIL PROTECTED]> wrote: > > Yes, this is definitely a bug. Definitely report it to trac. > > Done:http://trac.sagemath.org/sage_trac/ticket/2959 > I set the milestone as 3.0.1 since I thought Michael said no more > new tickets in 3.0. Well, I said no more ticket for 3.0 but blockers ;) > > 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 in DirichletGroup?
On Sat, Apr 19, 2008 at 5:08 PM, William Stein <[EMAIL PROTECTED]> wrote: > > > On Sat, Apr 19, 2008 at 1:55 PM, David Joyner <[EMAIL PROTECTED]> wrote: > > > > Hi: > > > > I wonder if this behavior is a bug? > > > > sage: G = DirichletGroup(21) > > sage: chi = G.0; chi > > [-1, 1] > > sage: chi.values() > > [0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1] > > > > So far, so good (similar code is in the tutorial: > > http://www.sagemath.org/doc/html/tut/node15.html). > > Now use a different base ring: > > > > > > sage: G = DirichletGroup(21, GF(37)) > > sage: chi = G.0; chi > > [36, 1] > > sage: chi.values() > > > --- > > Traceback (most recent call > last) > > > > /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/ in () > > > > > /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/local/lib/python2.5/site-packages/sage/modular/dirichlet.py > > in values(self) > >1056 > >1057 # record character value on n > > -> 1058 result_list[n.ivalue] = R_values[value.ivalue] > >1059 # iterate: > >1060 # increase the exponent vector by 1, > > > > : list index out of range > > > > > > Should I report this to trac? > > > > - David > > Yes, this is definitely a bug. Definitely report it to trac. Done: http://trac.sagemath.org/sage_trac/ticket/2959 I set the milestone as 3.0.1 since I thought Michael said no more new tickets in 3.0. > > 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 in DirichletGroup?
On Sat, Apr 19, 2008 at 1:55 PM, David Joyner <[EMAIL PROTECTED]> wrote: > > Hi: > > I wonder if this behavior is a bug? > > sage: G = DirichletGroup(21) > sage: chi = G.0; chi > [-1, 1] > sage: chi.values() > [0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1] > > So far, so good (similar code is in the tutorial: > http://www.sagemath.org/doc/html/tut/node15.html). > Now use a different base ring: > > > sage: G = DirichletGroup(21, GF(37)) > sage: chi = G.0; chi > [36, 1] > sage: chi.values() > --- > Traceback (most recent call last) > > /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/ in () > > > /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/local/lib/python2.5/site-packages/sage/modular/dirichlet.py > in values(self) >1056 >1057 # record character value on n > -> 1058 result_list[n.ivalue] = R_values[value.ivalue] >1059 # iterate: >1060 # increase the exponent vector by 1, > > : list index out of range > > > Should I report this to trac? > > - David Yes, this is definitely a bug. Definitely report it to trac. 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] bug in DirichletGroup?
Hi: I wonder if this behavior is a bug? sage: G = DirichletGroup(21) sage: chi = G.0; chi [-1, 1] sage: chi.values() [0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1] So far, so good (similar code is in the tutorial: http://www.sagemath.org/doc/html/tut/node15.html). Now use a different base ring: sage: G = DirichletGroup(21, GF(37)) sage: chi = G.0; chi [36, 1] sage: chi.values() --- Traceback (most recent call last) /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/ in () /mnt/drive_hda1/sagefiles/sage-3.0.alpha5/local/lib/python2.5/site-packages/sage/modular/dirichlet.py in values(self) 1056 1057 # record character value on n -> 1058 result_list[n.ivalue] = R_values[value.ivalue] 1059 # iterate: 1060 # increase the exponent vector by 1, : list index out of range Should I report this to trac? - David Joyner --~--~-~--~~~---~--~~ 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: Sage server on a gentoo system
On Sat, Apr 19, 2008 at 9:59 AM, Alex Ghitza <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > William Stein wrote: > | On Sat, Apr 19, 2008 at 9:38 AM, Alex Ghitza <[EMAIL PROTECTED]> wrote: > > | The "mysterious reason" is that we enhanced the security of > | the notebook for local users. Namely, you now *must* do > | > | sage -c "notebook(address='the.address.of.your.computer')" > | > | in order to have the notebook listen on anything other than localhost. > | In 2.10.2 and some earlier versions we temporarily had a *bug* that > | made the notebook listen on all addresses by default. This is less > | secure since people using the notebook locally are exposing themselves > | to the possibility of somebody not logged into their computer attempting > | to hack into the notebook.This behavior is documented a tiny bit > | in the address section of "notebook?", though it's not very detailed! > | > | address-- (default: 'localhost'), address to listen on > | > > Excellent! Gerhard, this now works for me with sage-3.0.alpha5: > > sage -c "notebook(address='137.146.194.57', open_viewer=False, > directory='/home/ghitza/notebooks/ma311')" > > The same command with address='bayes.colby.edu' instead of the ip > address did not work. That *should* work, at least on most machines it works to give the hostname. That it doesn't on yours means there is something perhaps slightly unusual about your network's configuration. I'm glad using the ip address directly works fine. > Also, before issuing this command I had created > the various user accounts (see notebook? for details on how to do that). > > Best, > Alex > > > > - -- > Alexandru Ghitza > Assistant Professor > Department of Mathematics > Colby College > Waterville, ME 04901 > http://bayes.colby.edu/~ghitza/ > -BEGIN PGP SIGNATURE- > Version: GnuPG v2.0.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkgKJOUACgkQdZTaNFFPILgfzwCeMnZVqC4u3NqC5RNNBPRsIOLQ > rtoAn2RHTVRfj++tqZB12wcv1iQAlPSe > =fbuo > > > -END PGP SIGNATURE- > > > > -- 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] Re: Sage server on a gentoo system
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 William Stein wrote: | On Sat, Apr 19, 2008 at 9:38 AM, Alex Ghitza <[EMAIL PROTECTED]> wrote: | The "mysterious reason" is that we enhanced the security of | the notebook for local users. Namely, you now *must* do | | sage -c "notebook(address='the.address.of.your.computer')" | | in order to have the notebook listen on anything other than localhost. | In 2.10.2 and some earlier versions we temporarily had a *bug* that | made the notebook listen on all addresses by default. This is less | secure since people using the notebook locally are exposing themselves | to the possibility of somebody not logged into their computer attempting | to hack into the notebook.This behavior is documented a tiny bit | in the address section of "notebook?", though it's not very detailed! | | address-- (default: 'localhost'), address to listen on | Excellent! Gerhard, this now works for me with sage-3.0.alpha5: sage -c "notebook(address='137.146.194.57', open_viewer=False, directory='/home/ghitza/notebooks/ma311')" The same command with address='bayes.colby.edu' instead of the ip address did not work. Also, before issuing this command I had created the various user accounts (see notebook? for details on how to do that). Best, Alex - -- Alexandru Ghitza Assistant Professor Department of Mathematics Colby College Waterville, ME 04901 http://bayes.colby.edu/~ghitza/ -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgKJOUACgkQdZTaNFFPILgfzwCeMnZVqC4u3NqC5RNNBPRsIOLQ rtoAn2RHTVRfj++tqZB12wcv1iQAlPSe =fbuo -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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: Sage server on a gentoo system
On Sat, Apr 19, 2008 at 9:38 AM, Alex Ghitza <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I don't think you need to do anything special. Just install sage the > normal way (either from binaries or building from source), then run > > sage -notebook > > This can be run either as root or as a normal user (probably > preferable). You do not need to install or configure apache, since sage > comes with its own web server, twisted. > > It's probably a good idea, before you start a notebook, to type > notebook? in sage and read the documentation. > > BTW, for mysterious reasons I can only get sage-2.10.2 and earlier to > serve the notebook for outside connections; I've been having trouble > with the newer versions. So if you cannot get sage-2.11 or so to work, > you might want to try an earlier version. The "mysterious reason" is that we enhanced the security of the notebook for local users. Namely, you now *must* do sage -c "notebook(address='the.address.of.your.computer')" in order to have the notebook listen on anything other than localhost. In 2.10.2 and some earlier versions we temporarily had a *bug* that made the notebook listen on all addresses by default. This is less secure since people using the notebook locally are exposing themselves to the possibility of somebody not logged into their computer attempting to hack into the notebook.This behavior is documented a tiny bit in the address section of "notebook?", though it's not very detailed! address-- (default: 'localhost'), address to listen on By the way, if you will have multiple untrusted users you should users the accounts= option. 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: Sage server on a gentoo system
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I don't think you need to do anything special. Just install sage the normal way (either from binaries or building from source), then run sage -notebook This can be run either as root or as a normal user (probably preferable). You do not need to install or configure apache, since sage comes with its own web server, twisted. It's probably a good idea, before you start a notebook, to type notebook? in sage and read the documentation. BTW, for mysterious reasons I can only get sage-2.10.2 and earlier to serve the notebook for outside connections; I've been having trouble with the newer versions. So if you cannot get sage-2.11 or so to work, you might want to try an earlier version. Best, Alex gerhard wrote: | Does anybody have some hints on how to | get a sage server up and running on a gentoo system? | | I have never tried it on any system, and the guidelines | in the sage docs do not readily apply in this case. | | I presume I need to configure apache somehow, | create subdirectories with the sage code, | and ?? | | Thanks, | -gerhard | | | - -- Alexandru Ghitza Assistant Professor Department of Mathematics Colby College Waterville, ME 04901 http://bayes.colby.edu/~ghitza/ -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgKICIACgkQdZTaNFFPILgXkACff7zJ83HRcoT7XyQ7useaDwaF aJEAn0z6al6tQaDJPi+mCEaTBxJ3Myw/ =nrvO -END PGP SIGNATURE- --~--~-~--~~~---~--~~ 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] Sage server on a gentoo system
Does anybody have some hints on how to get a sage server up and running on a gentoo system? I have never tried it on any system, and the guidelines in the sage docs do not readily apply in this case. I presume I need to configure apache somehow, create subdirectories with the sage code, and ?? Thanks, -gerhard --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---