Skip to content

pkienzle/pyplay

Repository files navigation

PyPlay is a set of small tests, mostly of features of python, but it also includes some math experiments.

Note: use rest2html to check README.rst before checkin.

Math

empirical_ci

Determine how many samples we need to compute 1-sigma.

poisson_peak

Peak fitting with gaussian vs. poisson statistics.

BIC

Test distribution of chisq values for nested models with BIC.

count_by_roi

Counting until time vs counting until count gives different rate estimates.

Python

excutil.py

Annotate a python exception, for example, by adding details of what operation was being performed when the exception occurred.

inline_tests

Does nosetest allow relative imports?

limits

How do I use resource limits on python processes?

mapapply

How do I use multiprocess map with functions that take multiple arguments?

abc

Explore abstract base class support, checking that missing subclass methods get reported and method signatures on the subclass match the base class. It turns out that abc's do not check method signatures, so pyplay/abc contains the module quack which does the work of abc as well as checking method signatures.

module_attr

Show that globals are defined by first assignment to the global, not by a module level global statement.

modpath

Explore ways to find the module path. Currently this uses fn.__module__ where fn is a function defined within the module. This meets my immediate needs, so I didn't explore any other solutions.

byline.py

Implement line buffering on streams that don't have it. Turns out I don't need this code because the problem I was trying to solve (BZ2 files cutting off early because they used a flush each line) is already solved in python 3.2.

lineno.py

Find the file/line for the current python command.

pytest_yield

Use test generators with yield work with pytest.

WxPython

aui

Test of floating notebooks.

mplinteractor

Interactors on matplotlib graphs.

Web

ajax

Play with simple web applications and python cgi.

webkit.py

Use PyQt4 with webkit as an app ui. Demonstrates calling python from javascript and javascript from python.

About

Experiments in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages