Working on Python benchmarking

2011-03-12 Thread tleeuwenb...@gmail.com
Hi there...

I'm working on a package to provide python benchmarking (profiling and
analysis over time). The idea is to provide a decorator which can be
applied to unit tests which will cause the system to be profiled while
running those tests. The idea would be that any existing set of unit
tests could easily be selectively turned into a benchmarking suite by
the simple application of a decorator. An analysis module would
provide an instant picture of system performance while under test.

I have a basic package which provides the decorator, but have not yet
begun work on a module to provide an effective analysis of results.

I was wondering if anyone had already done any work in this space, and
would like to exchange some ideas? If anyone is interested, I have the
code hosted and can share it, but it's embarassingly primitive so I
don't really want to say I've done anything fantastic just yet! I just
wouldn't mind bouncing ideas around...

Cheers,
-T
-- 
http://mail.python.org/mailman/listinfo/python-list


Understanding the Pystone measurement

2011-03-24 Thread tleeuwenb...@gmail.com
Hi there,

Is there a good writeup of what the pystone measurement actually
means? I'm working on benchmarking of some Python code at work, and
I'm interested in how Pystone might be relevant to me. I've tried
googling, but I can't find any introductory / definitional
descriptions of what this module/measurement means.

Any pointers much appreciated!

Regards,
-Tennessee
-- 
http://mail.python.org/mailman/listinfo/python-list


Unit tests / build tools

2008-12-14 Thread tleeuwenb...@gmail.com
Hi all,

I don't know if there is an equivalent to Maven for Python, or whether
Maven could be used for Python projects. However, it would be great if
there were something available that would let me produce unit test and
code coverage statistics, then have those presented through an
attractive web system.

I am looking to integrate more testing, profiling and analysis into a
significant codebase, and would like to automate as much of this as
possible to make my workload lighter.

Thanks,
-Tennessee
--
http://mail.python.org/mailman/listinfo/python-list


People working in AI using Python

2009-03-02 Thread tleeuwenb...@gmail.com
Hi all,

I work on a natural language generation system for weather
forecasting, using Python. I would like to find out if there is an
active Python AI SIG or whether there is sufficient interest in
forming one.

Please email me offline (tleeuwenb...@gmail.com) if you're interested
in touching base on this topic.

Regards,
-Tennessee
--
http://mail.python.org/mailman/listinfo/python-list


TypeError: object cannot be interpreted as an index

2009-04-08 Thread tleeuwenb...@gmail.com
It started with this error message... "TypeError: object cannot be
used as an index"

foo = {}
someObject = someClass()
foo[someObject] = "hello"

Obviously, there are some known reasons why objects may not be
indexes, such as if they are not hashable (as in the case of lists).
However, I'm not getting that error message. I tested this out with
some minimal Python code, and the error did not occur. It only occurs
in my big codebase, not in a neat minimal example using a very small
class.

The type of this object is listed as 'instance'. My interpreter is
2.5.1

So I tried looking for more information inside types, and found
types.InstanceType.

Running help(types.InstanceType) gave me:
>>> help(types.InstanceType)
hello
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/python-2.5.1/lib/python2.5/site.py", line 345, in
__call__
import pydoc
  File "/usr/local/python-2.5.1/lib/python2.5/pydoc.py", line 56, in

from repr import Repr
ImportError: cannot import name Repr

There is a good chance that this object is build from C code,
instantiated through Swig. I'll have to do a bit more work to trace
back where the problem object is being created...

What, exactly, needs to be in place for an object to be a valid
dictionary key?
--
--
Tennessee Leeuwenburg
http://myownhat.blogspot.com/
"Don't believe everything you think"
--
http://mail.python.org/mailman/listinfo/python-list


Multithreading / multiprocess

2009-04-11 Thread tleeuwenb...@gmail.com
Is there anyway to begin a thread and execute a finite number of lines
of code, or a finite amount of time within it?

For example, say I create three child threads and I want to guarantee
equal timeshare between them, can I specify a quanta (say 400 LOC
although I know that is pretty small) to execute in each one in turn?

-T
--
http://mail.python.org/mailman/listinfo/python-list


Question regarding multiprocessing and error: Can't pickle : attribute lookup __builtin__.instancemethod failed

2009-10-13 Thread tleeuwenb...@gmail.com
Hi all,

Thanks in advance for any suggestions. I'm getting the following:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/work/tjl/apps/lib/python2.6/threading.py", line 525, in
__bootstrap_inner
self.run()
  File "/work/tjl/apps/lib/python2.6/threading.py", line 477, in run
self.__target(*self.__args, **self.__kwargs)
  File "/work/tjl/apps/lib/python2.6/multiprocessing/pool.py", line
225, in _handle_tasks
put(task)
PicklingError: Can't pickle : attribute lookup
__builtin__.instancemethod failed


The code block which calls this is:


def processGrids(self, grids):
'''
Get each grid within the time range and initiate processing
for each grid
'''

numberOfGrids = float(len(grids))


import multiprocessing, functools
pool = multiprocessing.Pool(processes=2)

pool.map(self.processSingleGrid, [(grid, index, grids) for
index, grid in enumerate(grids)])

-- 
http://mail.python.org/mailman/listinfo/python-list


Problem with multiprocessing

2009-09-01 Thread tleeuwenb...@gmail.com
I have a problem using multiprocessing in a simple way. I created a
file, testmp.py, with the following contents:

---
import multiprocessing as mp

p = mp.Pool(5)

def f(x):
  return x * x

print map(f, [1,2,3,4,5])
print p.map(f, [1,2,3,4,5])



I'm using 2.6 r26:66713, so not quite bleeding edge.

If I run 'python2.6 testmp.py' I get errors of exactly the kind
mentioned on docs.python.org for when multiprocessing is run using the
interactive interpreter. However, I'm obviously *not* running the
interactive interpreter.

Any suggestions?
-- 
http://mail.python.org/mailman/listinfo/python-list