Advanced Scientific Programming in Python
=========================================
a Summer School by the G-Node and the Institute of Experimental and
Applied Physics, Christian-Albrechts-Universität zu Kiel
Scientists spend more and more time writing, maintaining, and
debugging software. While techniques for doing this efficiently have
evolved, only few scientists actually use them. As a result, instead
of doing their research, they spend far too much time writing
deficient code and reinventing the wheel. In this course we will
present a selection of advanced programming techniques,
incorporating theoretical lectures and practical exercises tailored
to the needs of a programming scientist. New skills will be tested
in a real programming project: we will team up to develop an
entertaining scientific computer game.
We use the Python programming language for the entire course. Python
works as a simple programming language for beginners, but more
importantly, it also works great in scientific simulations and data
analysis. We show how clean language design, ease of extensibility,
and the great wealth of open source libraries for scientific
computing and data visualization are driving Python to become a
standard tool for the programming scientist.
This school is targeted at Master or PhD students and Post-docs from
all areas of science. Competence in Python or in another language
such as Java, C/C++, MATLAB, or Mathematica is absolutely required.
Basic knowledge of Python is assumed. Participants without any prior
experience with Python should work through the proposed introductory
materials before the course.
Date and Location
=================
September 2—7, 2012. Kiel, Germany.
Preliminary Program
===================
Day 0 (Sun Sept 2) — Best Programming Practices
- Best Practices, Development Methodologies and the Zen of Python
- Version control with git
- Object-oriented programming & design patterns
Day 1 (Mon Sept 3) — Software Carpentry
- Test-driven development, unit testing & quality assurance
- Debugging, profiling and benchmarking techniques
- Best practices in data visualization
- Programming in teams
Day 2 (Tue Sept 4) — Scientific Tools for Python
- Advanced NumPy
- The Quest for Speed (intro): Interfacing to C with Cython
- Advanced Python I: idioms, useful built-in data structures,
generators
Day 3 (Wed Sept 5) — The Quest for Speed
- Writing parallel applications in Python
- Programming project
Day 4 (Thu Sept 6) — Efficient Memory Management
- When parallelization does not help:
the starving CPUs problem
- Advanced Python II: decorators and context managers
- Programming project
Day 5 (Fri Sept 7) — Practical Software Development
- Programming project
- The Pelita Tournament
Every evening we will have the tutors' consultation hour: Tutors
will answer your questions and give suggestions for your own
projects.
Applications
============
You can apply on-line at http://python.g-node.org
Applications must be submitted before 23:59 UTC, May 1, 2012.
Notifications of acceptance will be sent by June 1, 2012.
No fee is charged but participants should take care of travel,
living, and accommodation expenses. Candidates will be selected on
the basis of their profile. Places are limited: acceptance rate last
time was around 20%. Prerequisites: You are supposed to know the
basics of Python to participate in the lectures. You are encouraged
to go through the introductory material available on the website.
Faculty
=======
- Francesc Alted, Continuum Analytics Inc., USA
- Pietro Berkes, Enthought Inc., UK
- Valentin Haenel, Blue Brain Project, École Polytechnique
Fédérale de Lausanne, Switzerland
- Zbigniew Jędrzejewski-Szmek, Faculty of Physics, University of
Warsaw, Poland
- Eilif Muller, Blue Brain Project, École Polytechnique Fédérale
de Lausanne, Switzerland
- Emanuele Olivetti, NeuroInformatics Laboratory, Fondazione Bruno
Kessler and University of Trento, Italy
- Rike-Benjamin Schuppner, Technologit GbR, Germany
- Bartosz Teleńczuk, Unité de Neurosciences Information et
Complexité, Centre National de la Recherche Scientifique, France
- Stéfan van der Walt, Helen Wills Neuroscience Institute,
University of California Berkeley, USA
- Bastian Venthur, Berlin Institute of Technology and Bernstein
Focus Neurotechnology, Germany
- Niko Wilbert, TNG Technology Consulting GmbH, Germany
- Tiziano Zito, Institute for Theoretical Biology,
Humboldt-Universität zu Berlin, Germany
Organized by Christian T. Steigies and Christian Drews of the
Institute of Experimental and Applied Physics,
Christian-Albrechts-Universität zu Kiel , and by Zbigniew
Jędrzejewski-Szmek and Tiziano Zito for the German Neuroinformatics
Node of the INCF.
Website: http://python.g-node.org
Contact: python-info(a)g-node.org
Hello,
I'm releasing pathlib 0.4 for Python 3.2 and later.
* Download: http://pypi.python.org/pypi/pathlib/
(you can probably use "pip install pathlib" or "easy_install pathlib"
instead)
* Documentation: http://readthedocs.org/docs/pathlib/en/latest/
* Issue tracker, repository: https://bitbucket.org/pitrou/pathlib/
What is pathlib
---------------
pathlib offers a set of classes to handle filesystem paths. It offers the
following advantages over using string objects:
* No more cumbersome use of os and os.path functions. Everything can be
done easily through operators, attribute accesses, and method calls.
* Embodies the semantics of different path types. For example, comparing
Windows paths ignores casing.
* Well-defined semantics, eliminating any warts or ambiguities (forward vs.
backward slashes, etc.).
Examples
--------
Importing the module classes::
>>> from pathlib import *
Listing Python source files in a directory::
>>> p = Path('.')
>>> [x for x in p if x.ext == '.py']
[PosixPath('test_pathlib.py'), PosixPath('setup.py'),
PosixPath('pathlib.py')]
Listing subdirectories::
>>> [x for x in p if x.is_dir()]
[PosixPath('.hg'), PosixPath('docs'), PosixPath('dist'),
PosixPath('__pycache__'), PosixPath('build')]
Navigating inside a directory tree::
>>> p = Path('/etc')
>>> q = p['init.d/reboot']
>>> q
PosixPath('/etc/init.d/reboot')
>>> q.resolve()
PosixPath('/etc/rc.d/init.d/halt')
Querying path properties::
>>> q.exists()
True
>>> q.is_dir()
False
>>> q.st_mode
33261
Opening a file::
>>> with q.open() as f: f.readline()
...
'#!/bin/bash\n'
Regards
Antoine Pitrou.
What is virtualenvwrapper
=========================
virtualenvwrapper is a set of extensions to Ian Bicking's virtualenv
tool. The extensions include wrappers for creating and deleting
virtual environments and otherwise managing your development workflow,
making it easier to work on more than one project at a time without
introducing conflicts in their dependencies.
What's New in 3.0
=================
This release adds Python 3 support, thanks in large part to the efforts of
Daniel Kraus. Tested under Python 2.6, 2.7, and 3.2.
Installing
==========
Visit the virtualenvwrapper project page (http://www.doughellmann.com/projects/virtualenvwrapper/)
for download links and installation instructions.
I'm pleased to announce the release of pyNVML 2.285: Python Bindings for the NVIDIA Management Library.
pyNVML provides programmatic access to static information and monitoring data for NVIDIA GPUs, as well as management capabilities. It exposes the functionality of the NVML library. See http://developer.nvidia.com/nvidia-management-library-nvml for more information about NVML.
The pyNVML download package and its documentation can be found at:
http://pypi.python.org/pypi/nvidia-ml-py/http://packages.python.org/nvidia-ml-py/
pyNVML is currently used to report GPU information in Ganglia. Check it out at http://developer.nvidia.com/ganglia-monitoring-system
Requires Python 2.5, or an earlier version with the ctypes module. Released under the BSD license.
Robert Alexander
NVIDIA Tesla Software Engineer
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
PyPi name: constraintslib (you'll be dissapointed if you get
constraints by accident)
Docs: http://packages.python.org/constraintslib/
Github: https://github.com/nathan-rice/Constraints
>From the docs:
Constraints - Sleek contract-style validation tools
===================================================
Constraints provides flexible validation tools for a variety of circumstances.
All validation in constraints is done by type checking. Constraints provides
a special abstract base class (Constraints) which facilitates on the fly
construction of validation types. Constraints also provides a special class
(Symbol) which can be used to generate natural, easy to read
constraint expressions.
for example::
>>> from constraints.proxy import Symbol
>>> from constraints.constraints import Constraints
>>> X = Symbol()
>>> SizeConstraint = Constraints(X * 2 + 1 >= 5)
>>> ModuloConstraint = Constraints(X % 2 != 0, X != 3)
>>> CharacterConstraint = Constraints(X[-1] == "h")
# My apologies for the lambda spam. I provide some functions in
# constraints.util for this purpose...
>>> callable_expr = lambda x: all(lambda x: isinstance(x, SizeConstraint), x)
>>> CollectionConstraint = Constraint(callable_expr)
>>> isinstance(1, SizeConstraint)
False
>>> isinstance(2, SizeConstraint)
True
>>> isinstance(1, ModuloConstraint)
True
>>> isinstance("blah", CharacterConstraint)
True
>>> isinstance([2, 3, 4, 5], CollectionConstraint)
True
Constraint instances also provide descriptors which will verify values at set
time. For example::
>>> class Foo(object):
... x = Constraints(X > 2)
...
>>> bar = Foo()
>>> bar.x = 1
Traceback (most recent call last):
...
AssertionError: Specified value (1) does not satisfy this constraint
Design by contract style preconditions, postconditions and invariants are also
supported, and can be used either as context managers or function decorators::
>>> x_pre = SizeConstraint.precondition("x")
>>> x_post = SizeConstraint.postcondition("x")
>>> x = 1
>>> with x_pre:
... do_stuff()
...
Traceback (most recent call last):
...
AssertionError: The value (1) did not meet the specified pre-condition
>>> x = 5
>>> with x_post:
... x -= 4
...
Traceback (most recent call last):
...
AssertionError: The value (1) did not meet the specified post-condition
>>> @x_pre
... def foo(x):
... return x
...
>>> foo(1)
Traceback (most recent call last):
...
AssertionError: The value (1) did not meet the specified pre-condition
>>> @x_post
... def foo(x):
... return x - 5
...
>>> foo(6)
Traceback (most recent call last):
...
AssertionError: The value (1) did not meet the specified post-condition
Symbol objects are very flexible, and provide a nice
way to specify your constraints without resorting to a domain specific language.
Symbol objects are fairly simple; whenever an operation is performed on them,
they capture it and return a new Symbol object wrapping the operation so that
it can be performed with concrete input at a later time. There are exceptions
to this, for example isinstance, which uses the metaclass method, and the type
constructors (str, int, bool, etc) which throw an error if the correct type is
not returned.
We're pleased to announce the release of Python Tools for Visual Studio 1.1 RC. Python Tools for Visual Studio (PTVS) is an open-source plug-in for Visual Studio which supports programming with the Python programming language. This release includes new core IDE features, a couple of new sample libraries for interacting with Kinect and Excel, and many bug fixes for issues reported since the release of 1.0. The 1.1 release altogether contains over 150 bug fixes and new features since 1.0.
For the core IDE features we've added many new features which improve the basic editing experience. This includes a smart tag feature for automatically adding imports, a command for cleaning up unused imports, support for recognizing isinstance() calls and using them for providing improved completions. We've also updated goto definition to go to members defined in the standard library.
We've also made several improvements to the project system. Some improvements which should help just about everyone include support for linked files that live outside of the project directory. This makes it easy to keep your project file separate from your code files. For IronPython users you can now add references to .NET projects or .NET assemblies and we'll automatically reload and re-analyze the references when they're rebuilt. For CPython users you can now add a reference to a .pyd extension module and we'll analyze the extension module and provide completions. We've also improved intellisense across multiple Python projects in the same solution.
This release also includes some improvements to the interactive REPL window. This includes improvements to IPython REPL support including support for inline graphs and proper support for IPython's numbered prompts. We've added support for using IPython mode w/o PyLab - this enables out-of-line graphs and improves the startup time of the interactive window.
The debugger has also seen several small improvements in this release. There's a new option to step into the Python standard library while debugging, another option to not break on SystemExit exception with exit codes of zero. Finally we've added support for displaying Python thread name in the threads window. We've also improved the Debug->Attach support and made it easier to attach to a process which is not actively running Python code.
Another major addition to 1.1 includes the addition of two additional sample libraries available as separate downloads: PyKinect for working with the Kinect Beta SDK and Pyvot for working with Excel spreadsheets. Once downloaded and installed these plug-in to Visual Studio and provide templates; and they provide built-in support for installing into one of the recognized Python interpreters via Tools->Python Tools->Samples.
The PyKinect sample is a wrapper around the Kinect SDK and enables development with the Kinect SDK directly from Python. The sample includes a new template for quickly getting started creating games using PyGame with PyKinect. PyKinect is licensed under a license similar to the existing Kinect SDK.
Pyvot (pronounced Pivot) connects familiar data-exploration and visualization tools in Excel with the powerful data analysis and transformation capabilities of Python, with an emphasis on tabular data. It provides a simple and Pythonic interface to Excel, smoothing over the pain points in using the existing Excel object model as exposed via COM.
We'd like to thank all of the users who took the time to report issues and feedback for this release: 445363200, adv12, Andrew, AphexSA, benpmorgan, chadbr, dgkbny, drgn, holmboe, hyh, jimpeak, juanalumni, kingnaoufal, lblanchon, liuzhenhai, mahpour, MichaelBaker, po6856, pztrick44, RobertMcGinley, salerio, slide_o_mix, somini, SoonStudios, stakemura, stephenkennedy, sumitbasu, swift_dev, synergetic, teebot, tiphon, timeisaparallax, tonyandrewmeyer, xavier_grundus, and Zooba.
Thanks,
The Python Tools for Visual Studio Team
Hi,
I'm pleased to announce release 0.7.0 of Python FTP Server library (pyftpdlib).
http://code.google.com/p/pyftpdlib/
=== About ===
Python FTP server library provides an high-level portable interface to
easily write asynchronous FTP/S servers with Python. pyftpdlib is
currently the most complete RFC-959 FTP server implementation
available for Python programming language.
=== sendfile() ===
sendfile(2) system call usage has finally been introduced. sendfile(2)
provides a "zero-copy" way of copying data from one file descriptor to
another (a socket). The phrase "zero-copy" refers to the fact that all
of the copying of data between the two descriptors is done entirely by
the kernel, with no copying of data into userspace buffers, resuting
in file transfers (RETR, hence from server to client) being from 2x to
3x faster.
A simple benchmark:
pyftpdlib 0.6.0: 693.41 MB/sec
pyftpdlib 0.7.0: 1694.14 MB/sec
proftpd 1.3.4rc2: 1313.77 MB/sec
vsftpd 2.3.2: 1505.18 MB/sec
In order to use sendfile(2) you'll have to install pysendfile module
first (UNIX only):
http://code.google.com/p/pysendfile/
=== Faster scheduler ===
The internal scheduler, governed by CallLater and CallEvery classes,
has been rewritten from scratch and it is an order of magnitue faster,
especially for operations like cancel() which are involved when
clients are disconnected (hence invoked very often). Some benchmarks:
schedule: +0.5x
reschedule: +1.7x
cancel: +477x (with 1 milion scheduled functions)
run: +8x
Also, a single scheduled function now consumes 1/3 of the memory
thanks to __slots__ usage.
For further details see: http://code.google.com/p/pyftpdlib/issues/detail?id=189
=== SITE CHMOD ===
This new version supports SITE CHMOD command, meaning the client is
now able to change file mode bits by issuing "SITE CHMOD path mode"
command. The authorizer now accepts a new "M" permission bit, which,
when specified, enables SITE CHMOD usage:
>>> authorizer = DummyAuthorizer()
>>> authorizer.add_user('user', 'password', '/home/user', perm='elradfmwM')
=== Other improvements ===
* on_failed_login() callback: this is called when user provides wrong
credentials.
* CallEvery class: same as CallLater, but keeps calling a function
every X seconds.
* A benchmark script:
http://code.google.com/p/pyftpdlib/source/browse/trunk/test/bench.py
* Anti flood demo script:
http://pyftpdlib.googlecode.com/svn/trunk/demo/anti_flood_ftpd.py
A complete list of changes including enhancements and bug fixes is
available here:
http://code.google.com/p/pyftpdlib/wiki/ReleaseNotes07
=== More links ===
* Source tarball: http://pyftpdlib.googlecode.com/files/pyftpdlib-0.7.0.tar.gz
* Online docs: http://code.google.com/p/pyftpdlib/wiki/Tutorial
* FAQs: http://code.google.com/p/pyftpdlib/wiki/FAQ
* RFCs compliance paper: http://code.google.com/p/pyftpdlib/wiki/RFCsCompliance
* Issue tracker: http://code.google.com/p/pyftpdlib/issues/list
If you think pyftpdlib is worth a donation you can do so by going here:
http://code.google.com/p/pyftpdlib/wiki/Donate
Thanks,
--- Giampaolo Rodola'
http://code.google.com/p/pyftpdlib/http://code.google.com/p/psutil/http://code.google.com/p/pysendfile/
Hi,
I will be giving a matplotlib and a optimization tutorial
at PyCon in March.
The first tutorial is a compact introduction to matplotlib.
The optimization tutorial gives an overview over this topic.
BTW, the early bird deadline is today.
Mike
Plotting with matplotlib
------------------------
Instructor: Mike Müller
Type:Tutorial
Audience level:Novice
Category:Useful libraries
March 8th 9 a.m. – 12:20 p.m.
https://us.pycon.org/2012/schedule/presentation/238/
When it comes to plotting with Python many people think about matplotlib. It is
widely used and provides a simple interface for creating a wide variety of
plots from very simple diagrams to sophisticated animations. This tutorial is a
hands-on introduction that teaches the basics of matplotlib. Students will
learn how to create publication-ready plots with just a few lines of Python.
Faster Python Programs through Optimization
-------------------------------------------
Instructor: Mike Müller
Type:Tutorial
Audience level:Experienced
Category:Best Practices/Patterns
March 7th 9 a.m. – 12:20 p.m.
https://us.pycon.org/2012/schedule/presentation/245/
This tutorial provides an overview of techniques to improve the performance of
Python programs. The focus is on concepts such as profiling, difference of data
structures and algorithms as well as a selection of tools and libraries that
help to speed up Python.
Course "Python for Scientists and Engineers" in Chicago
=======================================================
There will be a comprehensive Python course for scientists and engineers
in Chicago end of February / beginning of March 2012. It consists of a 3-day
intro and a 2-day advanced section. Both sections can be taken separately
or combined.
More details below and here: http://www.dabeaz.com/chicago/science.html
Please let friends or colleagues who might be interested in such a
course know about it.
3-Day Intro Section
-------------------
- Overview of Scientific and Technical Libraries for Python.
- Numerical Calculations with NumPy
- Storage and Processing of Large Amounts of Data
- Graphical Presentation of Scientific Data with matplotlib
- Object Oriented Programming for Scientific and Technical Projects
- Open Time for Problem Solving
2-Day Advanced Section
----------------------
- Extending Python with Other Languages
- Unit Testing
- Version Control with Mercurial
The Details
-----------
The course is hosted by David Beazley (http://www.dabeaz.com).
Date: Feb 27 - Mar 2, 2012
Location: Chicago, IL, USA
Trainer: Mike Müller
Course Language: English
Link: http://www.dabeaz.com/chicago/science.html
A new RedNotebook version has been released.
You can get the tarball, the Windows installer and links to distribution
packages at
http://rednotebook.sourceforge.net/downloads.html
What is RedNotebook?
--------------------
RedNotebook is a **graphical journal** and diary helping you keep track
of notes and thoughts. It includes a calendar navigation, customizable
templates, export functionality and word clouds. You can also format,
tag and search your entries. RedNotebook is available in the
repositories of most common Linux distributions and a Windows installer
is available. It is written in Python and uses GTK+ for its interface.
What's new?
-----------
* Let tags be categories without entries. This greatly simplifies and in
fact unifies tags and categories.
* Unify clouds and search -> Show the search bar above the clouds
When a search is made, substitute the word cloud with the search results.
* Apply styling for thick horizontal lines
- Thin line: --------------------
- Thick line: ====================
* Apply formatting only once if a format button is clicked multiple times
* Allow "Close to tray" only on Windows as most modern Linux distros
don't have a tray anymore (lp:902228)
If you still want the tray icon, set closeToTray=1 in the
configuration file.
* Make journal saving more than twice as fast by using libyaml.
* Change Ctrl-PageUp(Down) directions to be more intuitive
* Update and revise help text
* Fix: utf-8 special chars not displayed correctly in html export for
firefox (LP:910094)
* Fix: Do not abort if a wrong regex is entered
* Fix: Correctly highlight all picture formats in edit mode
* Fix: When the format button is clicked and a tag is selected, format
it instead of the editor pane
* Write month only if changes are actually made (LP:871730)
* Call categories tags in more places
* Print PDF export path after export
* Do not warn if second instance is suspected (too many false-positives)
* Updated translations
Cheers,
Jendrik