Re: [sage-support] Re: Cython: importing a cdef class

2010-08-04 Thread Robert Bradshaw
On Sat, Jul 31, 2010 at 1:21 AM, Simon King simon.k...@nuigalway.ie wrote:
 Hi Jeroen!

 On 31 Jul., 02:30, Robert Bradshaw rober...@math.washington.edu
 wrote:
 ...
  In file A.pyx, I have
  cdef MyClass myobj
  cdef class MyClass:
     [...]

  In file A.pxd, I have
  cdef class MyClass:
     [...]

  In file B.pyx, I would like to access myobj from A.pyx, but how?

 You can't access cdef members of Cython modules from other modules
 (yet). Here you'd probably want to make an accessors method in A.
 Either that our you could not declare it as a MyClass (but in that
 case it'd be just a normal Python object).

 Would this work?

 in A.pyx:
 myobj_py = MyClass(...)
 cdef MyClass myobj = myobj_py
 cdef class MyClass ...

 in A.pxd
 cdef class MyClass:
    [...]

 in B.pyx:
 from A import myobj_py
 from A cimport MyClass
 cdef MyClass myobj = myobj_py

 In that way, you have the cdef object myobj in both A and B

Yep.

-- 
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
URL: http://www.sagemath.org


[sage-support] problem with installation ??

2010-08-04 Thread julien
Hello, I am completely new to Sage.. but I am so excited, it looks
like the ultimate tool !!!
Unfortunately, I have already big problems from the beginning...

I cannot just plot x^2 
here is the kind of error I get 

any ideas 
thnaks so much for your help !!
Julien


sage: plot(x^2,(x,300,500))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (805, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (785, 0))

---
EOF   Traceback (most recent call
last)

/home/julien/.sage/ipython console in module()

/usr/lib/python2.5/site-packages/sage/plot/plot.pyc in __call__(self,
funcs, *args, **kwds)
   3564 del kwds['show']
   3565 if hasattr(funcs, 'plot'):
- 3566 G = funcs.plot(*args, **kwds)
   3567 # if we are using the generic plotting method
   3568 else:

/usr/lib/python2.5/site-packages/sage/calculus/calculus.pyc in
plot(self, *args, **kwds)
896 break
897
-- 898 F = self.simplify()
899 if isinstance(F, Symbolic_object):
900 if hasattr(F._obj, '__call__'):

/usr/lib/python2.5/site-packages/sage/calculus/calculus.pyc in
simplify(self)
   3224 return self._simp
   3225 except AttributeError:
- 3226 S =
evaled_symbolic_expression_from_maxima_string(self._maxima_init_())
   3227 S._simp = None
   3228 self._simp = S

/usr/lib/python2.5/site-packages/sage/calculus/calculus.pyc in
evaled_symbolic_expression_from_maxima_string(x)
   8317 x^e + I + e^pi
   8318 
- 8319 return
symbolic_expression_from_maxima_string(maxima.eval(x))
   8320
   8321 def first_var(expr):

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
eval(self, code, strip, synchronize, **kwds)
915 try:
916 with gc_disabled():
-- 917 return '\n'.join([self._eval_line(L, **kwds)
for L in code.split('\n') if L != ''])
918 except KeyboardInterrupt:
919 # DO NOT CATCH KeyboardInterrupt, as it is being
caught

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_eval_line(self, line, allow_use_file, wait_for_prompt, reformat,
error_check)
559 return repr(a)
560 else:
-- 561 self._sendline(line)
562
563 if not wait_for_prompt:

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_sendline(self, str)
430
431 def _sendline(self, str):
-- 432 self._sendstr(str)
433 os.write(self._expect.child_fd, os.linesep)
434

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_sendstr(self, str)
435 def _sendstr(self, str):
436 if self._expect is None:
-- 437 self._start()
438 try:
439 os.write(self._expect.child_fd, str)

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_start(self)
420
421 def _start(self):
-- 422 Expect._start(self)
423 self._eval_line('0;')
424

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
_start(self, alt_message, block_during_init)
467 if block_during_init:
468 for X in self.__init_code:
-- 469 self.eval(X)
470 else:
471 for X in self.__init_code:

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
eval(self, code, strip, synchronize, **kwds)
915 try:
916 with gc_disabled():
-- 917 return '\n'.join([self._eval_line(L, **kwds)
for L in code.split('\n') if L != ''])
918 except KeyboardInterrupt:
919 # DO NOT CATCH KeyboardInterrupt, as it is being
caught

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_eval_line(self, line, allow_use_file, wait_for_prompt, reformat,
error_check)
564 return
565
-- 566 self._expect_expr(self._display_prompt)
567 self._expect_expr()
568 out = self._before()

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
_expect_expr(self, expr, timeout)
455 i = self._expect.expect(expr,timeout=timeout)
456 else:
-- 457 i = self._expect.expect(expr)
458 if i  0:
459 v = self._expect.before

/usr/lib/python2.5/site-packages/pexpect.pyc in expect(self, pattern,
timeout, searchwindowsize)
   1309
   1310 compiled_pattern_list =
self.compile_pattern_list(pattern)
- 1311 return self.expect_list(compiled_pattern_list,

[sage-support] Re: problem with installation ??

2010-08-04 Thread kcrisman
Dear Julien,

Thank you for trying Sage.  You appear to be using a rather old
version, and it is usually very easy to download a newer one.  Can you
give us some more specific information about what version it is, where
you downloaded it, what OS you are on, and so forth?

What seems to be happening is that there is a simplification called
which has done something grotesque, giving an error that usually
happens with unmatched parentheses and the like.  With more info, this
might help us track down why this is happening to you.

Also, if you can do

sage: 2+2
4

that is a good sign!  What happens if you do the following? (It should
bring up a new subprogram, which you can quit with Ctrl+D.)

sage: maxima_console()

Thanks, and hope we can help you!

- kcrisman

On Aug 4, 12:31 pm, julien julien.d...@gmail.com wrote:
 Hello, I am completely new to Sage.. but I am so excited, it looks
 like the ultimate tool !!!
 Unfortunately, I have already big problems from the beginning...

 I cannot just plot x^2 
 here is the kind of error I get 

 any ideas 
 thnaks so much for your help !!
 Julien


-- 
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
URL: http://www.sagemath.org


[sage-support] Re: SageTeX compiling errors in TeXShop

2010-08-04 Thread Katie Johnson
That works!  I had followed the more permanent instructions
previously, but somehow the wrong version still ended up in the right
place.  Anyway, it works now, even the automatic compiling in
TeXShop.  The only thing that is still acting funny is when I compile
the example that came with SageTeX, but that doesn't really matter.
It compiles sometimes, but not others, and when it doesn't, it gives
me a variety of errors in TeXShop (when it's compiling the tex!).
Like I said, oh well.  If I have trouble later on with one of my
personal documents, I'll repost.

Thank you for all of your help! :)

~Katie


On Aug 2, 9:32 pm, Dan Drake dr...@kaist.edu wrote:
 Hi Katie,

 Sorry for the slow replies. I'm traveling and have not been keeping
 super current on email.



 On Mon, 02 Aug 2010 at 09:06AM -0700, Katie Johnson wrote:
  Does anyone know how to fix this?

  On Jul 28, 2:50 pm, Katie Johnson katie.v.johnso...@gmail.com wrote:
   I used Dan's minimal example.  I copied his code into a file, ran it
   in TexShop and got no errors, but did get a warning:

 [...]
   (/usr/local/texlive/2009/texmf-dist/tex/latex/sagetex/sagetex.sty

 I think that is one problem: your TeX installation has one version of
 SageTeX and your Sage or TexShop installation has another. The versions
 need to match in order for things to work, and I've put code into
 SageTeX that will check for that, but you seem to have a slightly older
 version.

 Try this: open a terminal, and move the above file somewhere else, with
 something like:

   cd /usr/local/texlive/2009/texmf-dist/tex/latex/sagetex
   sudo mv sagetex.sty old-sagetex.sty

 That will move the old sagetex.sty file (which is what TeX needs to
 understand SageTeX stuff) out of the way. Now you will need a new
 copy of sagetex.sty, one that matches the SageTeX stuff built into Sage.
 Here's one way to do that: find where you installed Sage; call that
 directory SAGE_ROOT. Then, in a terminal, do this:

   cp SAGE_ROOT/local/share/texmf/tex/generic/sagetex/sagetex.sty YOUR_DOC

 where, of course, you replace SAGE_ROOT as above and YOUR_DOC is the
 directory where your sample document is.

 Then try typesetting your document and running Sage again. Does that
 work?

 (BTW, more permanent installation instructions are available 
 athttp://www.sagemath.org/doc/installation/sagetex.html)

 Dan

 --
 ---  Dan Drake
 -  http://mathsci.kaist.ac.kr/~drake
 ---

  signature.asc
  1KViewDownload

-- 
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
URL: http://www.sagemath.org


[sage-support] Re: problem with installation ??

2010-08-04 Thread julien
Thanks so much for the quick help !!!
I am running sage on ubuntu,
First I downloaded the version from the package installer in ubuntu.
(Synaptic package manager, package sage)
and because I had troubles, i decided to download the lastes version
for ubuntu on the website of sage.
(but I am not so sure which of the two versions I am actually running
now, I guess the second one, if i did the install procedure correctly
[I copied the directory in /opt/ nad then made a symbolic link with
the ln command])

but still the same problem.
it appears to be version 3.0.5, see bellow also the test. (I can do
2+2, and start a maxima console  I can even plot a circle actually)

jul...@harvardo:~$ sage
--
| SAGE Version 3.0.5, Release Date: 2008-07-11   |
| Type notebook() for the GUI, and license() for information.|
--

sage:
sage:
sage: 2+2
4
sage: maxima_console()

Maxima 5.17.1 http://maxima.sourceforge.net
Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1)


On Aug 4, 1:31 pm, kcrisman kcris...@gmail.com wrote:
 Dear Julien,

 Thank you for trying Sage.  You appear to be using a rather old
 version, and it is usually very easy to download a newer one.  Can you
 give us some more specific information about what version it is, where
 you downloaded it, what OS you are on, and so forth?

 What seems to be happening is that there is a simplification called
 which has done something grotesque, giving an error that usually
 happens with unmatched parentheses and the like.  With more info, this
 might help us track down why this is happening to you.

 Also, if you can do

 sage: 2+2
 4

 that is a good sign!  What happens if you do the following? (It should
 bring up a new subprogram, which you can quit with Ctrl+D.)

 sage: maxima_console()

 Thanks, and hope we can help you!

 - kcrisman

 On Aug 4, 12:31 pm, julien julien.d...@gmail.com wrote:

  Hello, I am completely new to Sage.. but I am so excited, it looks
  like the ultimate tool !!!
  Unfortunately, I have already big problems from the beginning...

  I cannot just plot x^2 
  here is the kind of error I get 

  any ideas 
  thnaks so much for your help !!
  Julien

-- 
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
URL: http://www.sagemath.org


[sage-support] Organizing Worksheets in subfolders

2010-08-04 Thread mhs
Hi,

is there a way to creat subfolders in the Notebook environment?

Over the time most SAGE users will (probably) have a lot of worksheets
and I would like to know if you could organize them in any useful way.
I know there is the Archive option, but it seems this just moves
active worksheets to the archive (which again becomes a long list
after a while). Would be nice to have something like subfolders
available, but I have not seen such a thing.

Best
M.

-- 
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
URL: http://www.sagemath.org


Re: [sage-support] Organizing Worksheets in subfolders

2010-08-04 Thread William Stein
On Wednesday, August 4, 2010, mhs schraud...@math.uni-heidelberg.de wrote:
 Hi,

 is there a way to creat subfolders in the Notebook environment?


No.  I implemented this once, bit it wasn't good enough to include.
It'll get implemented eventually.



 Over the time most SAGE users will (probably) have a lot of worksheets
 and I would like to know if you could organize them in any useful way.
 I know there is the Archive option, but it seems this just moves
 active worksheets to the archive (which again becomes a long list
 after a while). Would be nice to have something like subfolders
 available, but I have not seen such a thing.

 Best
 M.

 --
 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
 URL: http://www.sagemath.org


-- 
William Stein
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 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Organizing Worksheets in subfolders

2010-08-04 Thread mhs
Thanks for the quick answer.

Too bad this was not implemented yet (would be a nice feature). Hope
to see it some day in the future...

M.



On 4 Aug., 19:01, William Stein wst...@gmail.com wrote:
 On Wednesday, August 4, 2010, mhs schraud...@math.uni-heidelberg.de wrote:
  Hi,

  is there a way to creat subfolders in the Notebook environment?

 No.  I implemented this once, bit it wasn't good enough to include.
 It'll get implemented eventually.



  Over the time most SAGE users will (probably) have a lot of worksheets
  and I would like to know if you could organize them in any useful way.
  I know there is the Archive option, but it seems this just moves
  active worksheets to the archive (which again becomes a long list
  after a while). Would be nice to have something like subfolders
  available, but I have not seen such a thing.

  Best
  M.

  --
  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 
  athttp://groups.google.com/group/sage-support
  URL:http://www.sagemath.org

 --
 William Stein
 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 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Point-set topology in sage?

2010-08-04 Thread Justin C. Walker


On Jul 29, 2010, at 06:12 , Alec Battles wrote:


Not specifically, no, but orms.mfo.de (an excellent list with frequent
updates) lists 9 projects under topology. I will do some digging
later, but feel free to help me search.


The following might be of interest, but I know nothing about it (other  
than the website):

   http://comptop.stanford.edu

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Director
Institute for the Enhancement of the Director's Income

Weaseling out of things is what separates us from the animals.
 Well, except the weasel.
  - Homer J Simpson



--
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
URL: http://www.sagemath.org