[Cython] Interest in contributing to the project

2011-03-29 Thread Arthur de Souza Ribeiro
Hello everybody,

My name is Arthur de Souza Ribeiro and I'm a fourth-year student of Computer
Science in Federal University of Campina Grande, Brazil. I'm a python
programmer and have knowledge of other languages too, like Java, C, C++, Qt,
Grails and ActionScript (used in Flex framework of Adobe).

I saw Cython project and got really interested in contributing to it. By the
way, I saw that the project is trying to participate of GSoC under Python
Software Foundation umbrella. I know the student application period have
already started, but, I'd really enjoy to participate of GSoC 2011 as a
Cython's student. Until day 8 I could work really hard to show you that I
can be selected as a GSoC student for Cython. I looked for an Ideas Page of
the project but didn't find it, Is there any idea that you have to submit a
project in GSoC?

If possible, please tell me things that I can start doing to help the
project.

Best Regards

Arthur
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Rewriting/compiling parts of CPython's stdlib in Cython

2011-03-29 Thread Sturla Molden

Den 29.03.2011 02:09, skrev Robert Bradshaw:

We are very concerned about Python compatibility.


I did not intend to say you are not.

Judging from Guido's answer to Stephan, I think Guido is worried you are 
not.


And that, BTW, is sufficient to prevent the use of Cython in CPython stdlib.

Sturla
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] cygdb gdb script problem

2011-03-29 Thread Vitja Makarov
Running cygdb with Cython installed in the system leads to the
following problem:

vitja@vitja-laptop:~/work/cython-vitek-git/zzz$ python ../cygdb.py
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
.
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named Debugger
/tmp/tmp1ZvOf9:3: Error in sourced command file:
Error while executing Python code.
(gdb)

So may be it's better to explicitly specify correct path to Cython
package in gdb script?

Small example patch is attached.

-- 
vitja.
diff --git a/Cython/Debugger/Cygdb.py b/Cython/Debugger/Cygdb.py
index faa98d7..bbb0de7 100644
--- a/Cython/Debugger/Cygdb.py
+++ b/Cython/Debugger/Cygdb.py
@@ -31,11 +31,15 @@ def make_command_file(path_to_debug_info, prefix_code='', no_import=False):
 sys.exit('%s.\nNo debug files were found in %s. Aborting.' % (
usage, os.path.abspath(path_to_debug_info)))
 
+cython_root = os.path.abspath(
+os.path.join(os.path.dirname(__file__),'../..'))
+
 fd, tempfilename = tempfile.mkstemp()
 f = os.fdopen(fd, 'w')
 f.write(prefix_code)
 f.write('set breakpoint pending on\n')
 f.write("set print pretty on\n")
+f.write("python import sys; sys.path.insert(0, %r)\n" % cython_root)
 f.write('python from Cython.Debugger import libcython, libpython\n')
 
 if no_import:
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] cygdb gdb script problem

2011-03-29 Thread mark florisson
On 29 March 2011 21:11, Vitja Makarov  wrote:
> Running cygdb with Cython installed in the system leads to the
> following problem:
>
> vitja@vitja-laptop:~/work/cython-vitek-git/zzz$ python ../cygdb.py
> GNU gdb (GDB) 7.2-ubuntu
> Copyright (C) 2010 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> .
> Traceback (most recent call last):
>  File "", line 1, in 
> ImportError: No module named Debugger
> /tmp/tmp1ZvOf9:3: Error in sourced command file:
> Error while executing Python code.
> (gdb)
>
> So may be it's better to explicitly specify correct path to Cython
> package in gdb script?
>
> Small example patch is attached.
>
> --
> vitja.
>
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>
>

Hmm, when using cygdb it expects Cython to be in the path. I believe
your traceback means that it can find Cython, but not Cython.Debugger,
right? Are you sure you're using Python 2.6+? It doesn't work with any
version below 2.6 as they don't use the TP_FLAGS_*_SUBCLASS tp_flags.

In your patch you probably want to join() the dirname() with
os.pardir. However, I don't think it would really solve anything,
because if you install Cython, cygdb will be installed in e.g.
/usr/bin, so you'd be adding / to the path. If you want to run cygdb
from the cython/bin directory, then cython should be listed in
PYTHONPATH.
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] cygdb gdb script problem

2011-03-29 Thread Vitja Makarov
2011/3/29 mark florisson :
> On 29 March 2011 21:11, Vitja Makarov  wrote:
>> Running cygdb with Cython installed in the system leads to the
>> following problem:
>>
>> vitja@vitja-laptop:~/work/cython-vitek-git/zzz$ python ../cygdb.py
>> GNU gdb (GDB) 7.2-ubuntu
>> Copyright (C) 2010 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later 
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
>> and "show warranty" for details.
>> This GDB was configured as "x86_64-linux-gnu".
>> For bug reporting instructions, please see:
>> .
>> Traceback (most recent call last):
>>  File "", line 1, in 
>> ImportError: No module named Debugger
>> /tmp/tmp1ZvOf9:3: Error in sourced command file:
>> Error while executing Python code.
>> (gdb)
>>
>> So may be it's better to explicitly specify correct path to Cython
>> package in gdb script?
>>
>> Small example patch is attached.
>>
>> --
>> vitja.
>>
>> ___
>> cython-devel mailing list
>> cython-devel@python.org
>> http://mail.python.org/mailman/listinfo/cython-devel
>>
>>
>
> Hmm, when using cygdb it expects Cython to be in the path. I believe
> your traceback means that it can find Cython, but not Cython.Debugger,
> right? Are you sure you're using Python 2.6+? It doesn't work with any
> version below 2.6 as they don't use the TP_FLAGS_*_SUBCLASS tp_flags.
>

That's correct when cygdb is executed it's executed with right cython version,
and gdb import system version of cython

> In your patch you probably want to join() the dirname() with
> os.pardir. However, I don't think it would really solve anything,
> because if you install Cython, cygdb will be installed in e.g.
> /usr/bin, so you'd be adding / to the path.

No it will add /usr/lib to path, path is taken from Cython.Debugger.Cygdb

> If you want to run cygdb
> from the cython/bin directory, then cython should be listed in
> PYTHONPATH.

Ok. But you may get in trouble importing system version instead of
development one.

-- 
vitja.
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] cygdb gdb script problem

2011-03-29 Thread mark florisson
On 29 March 2011 22:20, Vitja Makarov  wrote:
> 2011/3/29 mark florisson :
>> On 29 March 2011 21:11, Vitja Makarov  wrote:
>>> Running cygdb with Cython installed in the system leads to the
>>> following problem:
>>>
>>> vitja@vitja-laptop:~/work/cython-vitek-git/zzz$ python ../cygdb.py
>>> GNU gdb (GDB) 7.2-ubuntu
>>> Copyright (C) 2010 Free Software Foundation, Inc.
>>> License GPLv3+: GNU GPL version 3 or later 
>>> 
>>> This is free software: you are free to change and redistribute it.
>>> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
>>> and "show warranty" for details.
>>> This GDB was configured as "x86_64-linux-gnu".
>>> For bug reporting instructions, please see:
>>> .
>>> Traceback (most recent call last):
>>>  File "", line 1, in 
>>> ImportError: No module named Debugger
>>> /tmp/tmp1ZvOf9:3: Error in sourced command file:
>>> Error while executing Python code.
>>> (gdb)
>>>
>>> So may be it's better to explicitly specify correct path to Cython
>>> package in gdb script?
>>>
>>> Small example patch is attached.
>>>
>>> --
>>> vitja.
>>>
>>> ___
>>> cython-devel mailing list
>>> cython-devel@python.org
>>> http://mail.python.org/mailman/listinfo/cython-devel
>>>
>>>
>>
>> Hmm, when using cygdb it expects Cython to be in the path. I believe
>> your traceback means that it can find Cython, but not Cython.Debugger,
>> right? Are you sure you're using Python 2.6+? It doesn't work with any
>> version below 2.6 as they don't use the TP_FLAGS_*_SUBCLASS tp_flags.
>>
>
> That's correct when cygdb is executed it's executed with right cython version,
> and gdb import system version of cython
>
>> In your patch you probably want to join() the dirname() with
>> os.pardir. However, I don't think it would really solve anything,
>> because if you install Cython, cygdb will be installed in e.g.
>> /usr/bin, so you'd be adding / to the path.
>
> No it will add /usr/lib to path, path is taken from Cython.Debugger.Cygdb
Ah indeed, that code was moved.

>> If you want to run cygdb
>> from the cython/bin directory, then cython should be listed in
>> PYTHONPATH.
>
> Ok. But you may get in trouble importing system version instead of
> development one.

Hmm, PYTHONPATH should come before the default search path. But it is
true that those eggs can do anything, like insert themselves at the
front of the path by putting python code in those .pth files (a gross
hack). So indeed, it sounds like a good idea to insert that path at
the front of sys.path.

> --
> vitja.
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] Cannot profile nogil function. Error or Warn?

2011-03-29 Thread Lisandro Dalcin
Error compiling Cython file:

...

cdef int PyMPE_Raise(int ierr) except -1 with gil:
__Pyx_Raise(RuntimeError, "MPE logging error [code: %d]" % ierr, NULL)
return 0

cdef inline int CHKERR(int ierr) nogil except -1:
^


/home/dalcinl/Devel/mpi4py-dev/src/MPE/helpers.pxi:22:5: Cannot
profile nogil function.


Do we REALLY want this to be an error? Why not just a warning?

-- 
Lisandro Dalcin
---
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] How to improve the performance when doing string/unicode replace and search?

2011-03-29 Thread Yunfan Jiang
hi, i used to ask some string process question here, and found  a bug, it
seems you guys fix the bug but not use it

and this time , my problem is about the performance,
i need to wrote  a filter which search sorts of keywords in the target
string , and stop if matched,
this act require unicode input/output  , so i wrote a trie like module to
done it, it works ,but i found its too slower than using regex module
so could you guys give some tips on string process performance?

-- 
ME = {
   "name": [ "jyf", "yunfan", "wuxian" ],
   "im": {
"gtalk": "jyf1...@gmail.com",
"msn": "gee...@live.cn"
  },
   "job": "python engineer",
   "site": "http://hi.baidu.com/jyf1987";,
   "interested":  {
   "tech": [ "linux", "python", "lua", "php", "html5", "c", "nosql"],
   "history": ["chinese history", "global history"],
   "SF": [ "hard SF", "Thought experiment" ],
   "music": [ "New Age", "Chinese old theme", "Electronic music",
"Strange Music :}"]
 }
 }
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] How to improve the performance when doing string/unicode replace and search?

2011-03-29 Thread Stefan Behnel

Yunfan Jiang, 30.03.2011 05:33:

hi, i used to ask some string process question here, and found  a bug, it
seems you guys fix the bug but not use it


Not sure what you mean by "not use it".



and this time , my problem is about the performance,
i need to wrote  a filter which search sorts of keywords in the target
string , and stop if matched,
this act require unicode input/output  , so i wrote a trie like module to
done it, it works ,but i found its too slower than using regex module
so could you guys give some tips on string process performance?


Note that the right place to ask usage related questions is the Cython 
users mailing list, not the core developers mailing list. I set a follow-up 
to point you there.


Generally speaking, a trie isn't necessarily fast, and it's certainly not 
the best algorithmic approach for keyword search. You should read up on 
Aho-Corasick and friends. I also wrote a simple Cython module that 
implements a keyword search algorithm ("acora", it's on PyPI), but it's 
unusable for large sets of keywords due to state explosion. It's pretty 
fast for smaller sets though.


Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] How to improve the performance when doing string/unicode replace and search?

2011-03-29 Thread Yunfan Jiang
sorry for ask in the wrong groups, what i mean "not use it" is that, i have
download the
latest cython source and installed it

and i check that the change code is already there, but my bug can still
replay


On Wed, Mar 30, 2011 at 1:02 PM, Stefan Behnel  wrote:

> Yunfan Jiang, 30.03.2011 05:33:
>
>  hi, i used to ask some string process question here, and found  a bug, it
>> seems you guys fix the bug but not use it
>>
>
> Not sure what you mean by "not use it".
>
>
>
>  and this time , my problem is about the performance,
>> i need to wrote  a filter which search sorts of keywords in the target
>> string , and stop if matched,
>> this act require unicode input/output  , so i wrote a trie like module to
>> done it, it works ,but i found its too slower than using regex module
>> so could you guys give some tips on string process performance?
>>
>
> Note that the right place to ask usage related questions is the Cython
> users mailing list, not the core developers mailing list. I set a follow-up
> to point you there.
>
> Generally speaking, a trie isn't necessarily fast, and it's certainly not
> the best algorithmic approach for keyword search. You should read up on
> Aho-Corasick and friends. I also wrote a simple Cython module that
> implements a keyword search algorithm ("acora", it's on PyPI), but it's
> unusable for large sets of keywords due to state explosion. It's pretty fast
> for smaller sets though.
>
> Stefan
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>



-- 
ME = {
   "name": [ "jyf", "yunfan", "wuxian" ],
   "im": {
"gtalk": "jyf1...@gmail.com",
"msn": "gee...@live.cn"
  },
   "job": "python engineer",
   "site": "http://hi.baidu.com/jyf1987";,
   "interested":  {
   "tech": [ "linux", "python", "lua", "php", "html5", "c", "nosql"],
   "history": ["chinese history", "global history"],
   "SF": [ "hard SF", "Thought experiment" ],
   "music": [ "New Age", "Chinese old theme", "Electronic music",
"Strange Music :}"]
 }
 }
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel