Autocomplete Java In Python using Py4J

Py4J provides a way to access Java objects from a Python interpreter. It can now be used to autocomplete Java objects from an interactive environment like PyDev, IPython or IPython Notebook.

DAWN uses Py4J as one of the technologies that provides integration of Java and Python for science. A great new feature of DAWN is the ability to record macros for scripting of plotting operations. Previously, objects in Java could not be auto-completed in the console even though they were accessible using Py4J.  We worked on extending Py4J (thanks to funding from DAWN & Diamond Light Source) to enable that feature and support the following:

  • Autocompletion of Java method and field names of class instances
  • Auto-generated pop-up help,  based on signatures, of Java methods

The changes were recently reviewed and we are happy to report that they are now part of Py4J and available for anyone to use to get autocompletion of Java from Python and make life easier for their users.

 

 

 

 

 

Integrating Python For High Throughput Science

Eclipse has always been a platform that unites different technology and makes it possible for developers to use the tools of their trade such as language editors, debuggers, profilers, version control, all in one environment. Until relatively recently scientists and researchers were at the mercy of fragmented suites of tools or closed-source workbenches. Actually many still are. But now with the increased adoption of Eclipse in the science sector, they too can look forward to the huge benefits of tool integration and interoperability as well as  the resulting speed-up in productivity.

When it comes to tools-of-the-trade for scientists, Python is high on the list. This is in large part thanks to its fast, powerful libraries such as numpy and scipy. Also the dynamic and easy-to-use nature of the language lends itself well to the exploring necessary for experimental work. The accessibility of learning resources also contributes to Python being the language of choice for the scientist embracing programming.

So how do you go about providing a tight integration of Python in Eclipse; one that allows a user to seamlessly move data around and use it both interactively and within views? Continue reading Integrating Python For High Throughput Science

What’s Between You and the Hardware?

This slide is from my EclipseCon Europe talk with Gordon Williams on Espruino.

It aims to show at a high-level what sits between our user software and the hardware itself and why it matters.

Arduino – an Arduino sketch gets compiled directly to object code and this runs directly on the hardware, i.e ‘bare metal’. This is great for directly accessing hardware but bare metal can be a pain, for instance, when it comes to scheduling when different things should run – then you’re on your own.

Raspberry Pi – is a powerful board that runs the Linux operating system, and an interpreter for Python on top of that. While you can do a lot with a Pi,and they are often used for running servers, sometimes it can be overkill for smaller automated tasks, and then you pay the price in power or battery life.

Espruino – Espruino aims to sit in the gap between the two. Its custom javascript interpreter gives some powerful functionality without having to give up tight control over the hardware. In particular, the interpreter includes scheduler methods which means it knows exactly when to go to sleep and for how long giving huge gains in power saving and therefore battery life.

Why Python is not the language for science

I learnt a lot when I attended my very first EuroSciPy conference. Not all of it was practical. For instance, did you know Python is being used to come up with new breeds of chicken? So from animal breeding to cognitive neuroscience to astrophysics, EuroSciPy was indeed the place to be to talk with folks using Python for various forms of science.

Prior to the conference my impression was that science is all about Python, thanks in large part to the ease-of-use of the language and the excellent numpy and scipy libraries which are so widely used for manipulating and processing data. So I guess I was pretty surprised that my biggest takeaway from the Python conference were two other languages.

Continue reading Why Python is not the language for science