Python Programming, news on the Voidspace Python Projects and all things techie.

Resolver One 1.7, BioPython and 3D Graphics

emoticon:clock Although I've left Resolver Systems I still follow closely what they're up to. Resolver One, the IronPython powered spreadsheet with the programming model right at its heart, is an innovative and unique product [1] that deserves to flourish. Despite the horrific loss Resolver One seems to still be moving forward at great pace without me.

Major features in this new release, the last one in which I have been involved in the development [2], include:

  • Button-click handlers are now executed without blocking the rest of Resolver One. This means that if you accidentally write a handler that never finishes, or just one that takes longer than you want, you can cancel it while it's running and fix the problem.
  • Added long-awaited dialog for setting wrapping and aligment for cells.
  • External imported modules now shared between documents and RunWorkbook (better performance for RunWorkbook in particular).
  • Faster install time.
  • Improved responsiveness when dragging tabs and switching between tabs.
  • [Shift] while clicking Recalc toolbar button now now forces reload of all imported modules (like Shift-F9 has always done).
  • A few minor bugfixes.

Giles Thomas and team have also produced screencasts of a couple of particularly interesting uses of Resolver One:

Using OpenGL and Resolver One for 3D visualization of stock prices:

This one uses Yahoo! Finance to download the close prices over the last two years for every stock that's currently in the Dow Jones index, then charts them in a 3D window which you can pan and zoom using the mouse. Here's a video showing it in action...

If you're interested in OpenGL Giles has a blog exploring WebGL, OpenGL in the browser: Learning WebGL.

Resolver One includes built-in support for Python C extensions like Numpy through the Resolver Systems sponsored open-source project Ironclad. Ironclad overcomes IronPython's inability to use compiled C-extensions. This video demonstrates the use of one such powerful library, BioPython, from within a Resolver One spreadsheet, to compare the molecular shapes of proteins. (3m12s)

[1]In fact Resolver One is a finalist in the 2009 IET Innovations Award.
[2]Possibly not true. I've done some work on the port to IronPython 2.6, which has mainly been spearheaded by Glenn Jones and will hopefully be 1.8. That's assuming that the IronPython team get 2.6 final released soon.

Like this post? Digg it or Del.icio.us it.

Posted by Fuzzyman on 2009-11-24 15:00:56 | |

Categories: , Tags: , , , ,


IronPython Training in New York, January 21st 2010

emoticon:file1 In association with Holdenweb I'll be taking an IronPython training course on January 21st in New York.

The details of the course:

Michael Foord is an early adopter of IronPython, having used it for (among other things) the creation of the Resolver One Python-driven spreadsheet product. He is the author of Manning's IronPython in Action and a well-known speaker at Python conferences throughout the world.

IronPython is the implementation of Python for the .NET framework and Mono. IronPython combines the power of the .NET framework with the expressiveness and flexibility of the Python programming language. In this workshop you'll get hands on experience with using IronPython: from the basics of integrating with the framework assemblies and classes to embedding IronPython in .NET applications.

This workshop is aimed at .NET developers with an interest in IronPython, and Python developers interested in IronPython. We'll cover how IronPython integrates with the .NET framework, including some of the tricky details that previous experience of Python or C# alone won't have prepared you for. We'll also be covering the IronPython hosting APIs and how to embed IronPython.

Reasons you might want to consider IronPython include:

  • Using Python libraries from .NET
  • Using .NET libraries from Python
  • Writing multi-threaded Python code without a GIL
  • Embedding IronPython in .NET applications for user scripting
  • Exploring new assemblies and classes with the interactive interpreter
  • System administration and scripting
  • Developing for Silverlight (Python in the browser)

Previous programming experience of Python is assumed, but no specific experience with Python or .NET is required. Places are limited, so reserve yours straight away.

Course Outline

The Interactive Interpreter

Getting started with IronPython, basic .NET integration, executing IronPython scripts. Using the interactive interpreter as a tool to explore live assemblies and classes.

IronPython for Python Developers

Why should a Python developer be interested in IronPython? From multithreading without a GIL, to multiple and sandboxed Python engines, to native user interface libraries (plural!) on Windows or even cross platform development with Mono; we'll be looking at some of what the .NET framework and IronPython has to offer Python developers.

Python for .NET Developers

A whirlwind guide to Python syntax and the wonders of dynamic languages for .NET programmers.

Tools and IDEs

A rundown of the options for developing with IronPython and the different IDEs available, including their different capabilities. Application Development with IronPython

Using Python and .NET libraries to build applications with IronPython. From simple scripting system administration tasks, to web applications to desktop applications. Using Ironclad for compatibility with Python C extensions, using the Python standard library and working with the .NET framework.

Advanced .NET Integration

Using a dynamic language on a statically typed framework. Many of the features of the .NET framework require specialised knowledge to use them from IronPython; including making use of new features in IronPython 2.6 like the __clrtype__ metaclass. Embedding IronPython and the IronPython Compliler

Using the IronPython hosting API for embedding in .NET applications. This can be used for creating hybrid applications with parts in C# and user scripting. With Pyc the compiler tool it can also be used for deploying IronPython applications as binary form. We'll also see how .NET 4 makes interacting with IronPython and the Dynamic Language Runtime simpler from C#. Python in the Browser with Silverlight

The basics of creating a Silverlight application with IronPython and the development process. Plus an overview of the APIs available in Silverlight; for building user interfaces, making web requests, and interacting with Javascript and the browser DOM.

There will also be plenty of time for Q&A throughout the session.

Like this post? Digg it or Del.icio.us it.

Posted by Fuzzyman on 2009-11-24 00:52:26 | |

Categories: , Tags: , , ,


ConfigObj 4.7.0 (beta): Faster and New Features for Validation

emoticon:nightmare The implementation of the next version of ConfigObj is now complete. All that is remaining is for me to update the documentation and package the release. It will probably be a few days before I can complete the release, which gives you the ideal opportunity for you to try out the new version and check I haven't broken anything.

ConfigObj is a configuration file reader and writer, using ini-style syntax (key = value pairs divided into sections). ConfigObj is easier to use than the standard library ConfigParser, plus ConfigObj has a host of powerful extra features. These features include:

  • Nested sections (subsections), to any level

  • List values and multi-line values

  • String interpolation (substitution)

  • Integrated with a powerful validation system

    • including automatic and extensible type checking/conversion
    • repeated sections
    • and allowing default values
  • When writing out config files, ConfigObj preserves all comments and the order of members and sections

  • Many useful methods and options for working with configuration files (like the 'reload' and 'merge' methods)

  • Full Unicode support

The new version, 4.7.0, has had a major performance boost (~25%) thanks to a patch supplied by Christian Heimes. It also has a few bugfixes and some new features for validation. If you use ConfigObj please download the new version and give it a try.

It's definitely worth trying out this version as it includes dropping support for Python 2.2, a minor grammar change and deprecating passing a dictionary of options to the ConfigObj constructor. If you use validation, particularly with preserve_errors=True then there are also relevant changes you should be aware of.

The full changelog for this version is:

  • Minimum supported version of Python is now 2.3
  • ~25% performance improvement thanks to Christian Heimes
  • String interpolation now works in list value members
  • After validation any additional entries not in the configspec are listed in the extra_values section member
  • Addition of the get_extra_values function for finding all extra values in a validated ConfigObj instance
  • Deprecated the use of the options dictionary in the ConfigObj constructor and added explicit keyword arguments instead. Use **options if you want to initialise a ConfigObj instance from a dictionary
  • BUGFIX: Checks that failed validation would not populate 'default_values' and 'restore_default_value' wouldn't work for those entries
  • BUGFIX: clear() now clears 'defaults'
  • BUGFIX: empty values in list values were accidentally valid syntax. They now raise a ParseError. e.g. "value = 1, , 2"
  • BUGFIX: Change to the result of a call to validate when preserve_errors is True. Previously sections where all values failed validation would return False for the section rather than preserving the errors. False will now only be returned for a section if it is missing
  • Distribution includes version 1.0.1 of validate.py
  • Removed __revision__ and __docformat__

In this version I also gave up on doctest and started using unittest for new tests. There may be ways round the limitations of doctest (how do you specify a single test to run? easy way of adding print debug statements without breaking every test that hits that code-path?), but I just find unittest so much easier to work with.

Thanks to all who reported bugs or provided patches.

Like this post? Digg it or Del.icio.us it.

Posted by Fuzzyman on 2009-11-24 00:34:54 | |

Categories: , Tags: , ,


Hosted by Webfaction

Counter...