Just Released: PyXLL v 3.0 (Python in Excel). New Real Time Data Stream Capabilities, Excel Ribbon Integration, and More.

Download a free 30 day trial of PyXLL and try it with your own data.

Since PyXLL was first released back in 2010 it has grown hugely in popularity and is used by businesses in many different sectors.

The original motivation for PyXLL was to be able to use all the best bits of Excel combined with a modern programming language for scientific computing, in a way that fits naturally and works seamlessly.

Since the beginning, PyXLL development focused on the things that really matter for creating useful real-world spreadsheets; worksheet functions and macro functions. Without these all you can do is just drive Excel by poking numbers in and reading numbers out. At the time the first version of PyXLL was released, that was already possibly using COM, and so providing yet another API to do the same was seen as little value add. On the other hand, being able to write functions and macros in Python opens up possibilities that previously were only available in VBA or writing complicated Excel Addins in C++ or C#.

With the release of PyXLL 3, integrating your Python code into Excel has become more enjoyable than ever. Many things have been simplified to get you up and running faster, and there are some major new features to explore.

  • If you are new to PyXLL have a look at the Getting Started section of the documentation.
  • All the features of PyXLL, including these new ones, can be found in the Documentation

NEW FEATURES IN PYXLL V. 3.0

1. Ribbon Customization

Screen Shot 2016-02-29 at 15.57.12

Ever wanted to write an add-in that uses the Excel ribbon interface? Previously the only way to do this was to write a COM add-in, which requires a lot of knowledge, skill and perseverance! Now you can do it with PyXLL by defining your ribbon as an XML document and adding it to your PyXLL config. All the callbacks between Excel and your Python code are handled for you.

See the Customizing the Ribbon for more detailed information or try the example included in the download.

2. RTD (Real Time Data) Functions

rtd

PyXLL can stream live data into your spreadsheet without you having to write any extra services or register any COM controls. Any Python function exposed to Excel through PyXLL can return a new RTD type that acts as a ticking data source; Excel updates whenever the returned RTD publishes new data.

See Real Time Data for more detailed information or try the example included in the download.

3. Function Signatures and Type Annotation

xl_func and xl_macro need to know the argument and return types to be
able to tell Excel how they should be called. In previous versions that was always done by passing a ‘signature’ string to these decorators.

Now in PyXLL 3 the signature is entirely optional. If a signature is not supplied PyXLL will inspect the function and determine the signature for you.

If you use Python type annotations when declaring the function, PyXLL will use those when determining the function signature. Otherwise all arguments and the return type will be assumed to be `var`.

4. Default Keyword Arguments

Python functions with default keyword arguments now preserve their default value when called from Excel with missing arguments. This means that a function like the one below
when called from Excel with b or c missing will be invoked with the correct default values for b and c.

@xl_func
 def func_with_kwargs(a, b=1, c=2):
 return a + b + c

 5. Deep Reloading

If you’ve used PyXLL for a while you will have noticed that when you reload PyXLL only the modules listed in your pyxll.cfg file get reloaded. If you are working on a project that has multiple modules and not all of them are added to the config those won’t get reloaded, even if modules that are listed in the config file import them.

PyXLL can now track all the imports made by each module listed in the config file, and when you reload PyXLL all of those modules will be reloaded in the right order.

This feature is enabled in the config file by setting

[PYXLL]
deep_reload = 1

6. Error Caching

Sometimes it’s not convenient to have to pick through the log file to determine why a particular cell is failing to calculate.

The new function get_last_error takes an XLCell or a COM Range and returns the last exception (and traceback) to have occurred in that cell.

This can be used in menu functions or other worksheet functions to give end users better feedback about any errors in the worksheet.

7. Python Functions for Reload and Rebind

PyXLL can now be reloaded or it can rebind its Excel functions using the new Python functions reload and rebind.

8. Better win32com and comtypes Support

PyXLL has always had some integration with the pythoncom module, but it required some user code to make it really useful. It didn’t have any direct integration with the higher level win32com package or the
comtypes package.

The new function xl_app returns the current Excel Application instance either as a pythoncom PyIDispatch instance, a win32com.client.Dispatch instance or a wrapped comtypes POINTER(IUnknown) instance.

You may specify which COM library you want to use with PyXLL in the pyxll.cfg file

[PYXLL]
com_package = <win32com, comtypes or pythoncom>

Download a free 30 day trial of PyXLL and see how PyXLL can help you use the power of Python to make Excel an even more powerful data analysis tool.

Virtual Core: CT, Photo, and Well Log Co-visualization

Enthought is pleased to announce Virtual Core 1.8.  Virtual Core automates aspects of core description for geologists, drastically reducing the time and effort required for core description, and its unified visualization interface displays cleansed whole-core CT data alongside core photographs and well logs.  It provides tools for geoscientists to analyze core data and extract features from sub-millimeter scale to the entire core.  This release introduces multiple new features, including rotational core alignment, import & export of DLIS files and updated classification tools using advanced machine learning algorithms.

NEW VIRTUAL CORE 1.8 FEATURE: Rotational Alignment on Core CT Sections

Virtual Core 1.8 introduces the ability to perform rotational alignment on core CT sections.  Core sections can become misaligned during extraction and data acquisition.   The alignment tool allows manual realignment of the individual core sections.  Wellbore image logs (like FMI) can be imported and used as a reference when aligning core sections.  The Digital Log Interchange Standard (DLIS) is now fully supported, and can be used to import and export data.

 

Whole-core CT scans are routinely performed on extracted well cores.  The data produced from these scans is typically presented as static 2D images of cross sections and video scans.  Images are limited to those provided by the vendor, and the raw data, if supplied, is difficult to analyze.  However, the CT volume is a rich 3D dataset of compositional and textural information that can be incorporated into core description and analysis workflows.

Enthought’s proprietary Clear Core technology is used to process the raw CT data, which is notoriously difficult to analyze.  Raw CT data is stored in 3 foot sections, with each section consisting of many thousands of individual slice images which are approximately .2 mm thick.  This data is first combined to create a contiguous volume of the entire core.  The volume is then analyzed to remove the core barrel and mud as well as correcting for scanning artifacts such as beam hardening.  The image below shows data before and after Clear Core processing.

Clear Core processing prepares CT data for additional analysis.

Automated feature detection is performed during processing to identify bed boundaries, lamination, dip angle and textural features of the core.  A number of advanced machine learning algorithms and image analysis techniques are used during this step.  It is also possible to perform feature detection on core photographs.

Virtual Core provides an integrated environment for the co-visualization of the CT data along with high resolution core photographs (white light and UV) and well logs.  Data can be imported using a variety of industry standard formats, such as LAS and DLIS.  Thin section images, plug data and custom annotations can be added and viewed at specific depths along with the core data.  A CT volume viewer provides a full 3D rendering of the interior of the core to investigate bioturbation and sedimentary structures.

NEW VIRTUAL CORE 1.8 FEATURE:  MACHINE LEARNING AND CLASSIFICATION TOOL

Virtual Core 1.8 also includes an updated machine learning and classification tool.  This feature provides an interface for a user to identify a lithology class of interest, and then automatically determines whether other regions in the entire core belong to the class or not.  This can be used to rapidly identify intervals that have certain features in common, such as bedding structures or density composition.

Stay tuned in the coming weeks for more details on the specific capabilities and features of Virtual Core.  If you would like more information please get in touch with us.  We’d be happy to schedule a demonstration and discuss how Virtual Core can help you unlock your core CT data.

 

Canopy Geoscience: Python-Based Analysis Environment for Geoscience Data

Today we officially release Canopy Geoscience 0.10.0, our Python-based analysis environment for geoscience data.

Canopy Geoscience integrates data I/O, visualization, and programming, in an easy-to-use environment. Canopy Geoscience is tightly integrated with Enthought Canopy’s Python distribution, giving you access to hundreds of high-performance scientific libraries to extract information from your data.


The Canopy Geoscience environment allows easy exploration of your data in 2D or 3D. The data is accessible from the embedded Python environment, and can be analyzed, modified, and immediately visualized with simple Python commands.

Feature and capability highlights for Canopy Geoscience version 0.10.0 include:

  • Read and write common geoscience data formats (LAS, SEG-Y, Eclipse, …)
  • 3D and 2D visualization tools
  • Well log visualization
  • Conversion from depth to time domain is integrated in the visualization tools using flexible depth-time models
  • Integrated IPython shell to programmatically access and analyse the data
  • Integrated with the Canopy editor for scripting
  • Extensible with custom-made plugins to fit your personal workflow

Contact us to learn more about Canopy Geoscience!

The Canopy Geoscience Team


Data can be visualized in 2D using a map view, or along a traverse (inline, crossline, or user-defined). Data defined in time and depth is co-visualized by selecting a depth-time model from the toolbar.


In the 2D map visualization, you can select a seismic volume or horizon to provide the reference grid coordinates.

3D and 3D visualization includes corner-grid volumes.

Plotting in Excel with PyXLL and Matplotlib

Author: Tony Roberts, creator of PyXLL, a Python library that makes it possible to write add-ins for Microsoft Excel in Python. Download a FREE 30 day trial of PyXLL here.


Plotting in Excel with PyXLL and MatplotlibPython has a broad range of tools for data analysis and visualization. While Excel is able to produce various types of plots, sometimes it’s either not quite good enough or it’s just preferable to use matplotlib.

Users already familiar with matplotlib will be aware that when showing a plot as part of a Python script the script stops while a plot is shown and continues once the user has closed it. When doing the same in an IPython console when a plot is shown control returns to the IPython prompt immediately, which is useful for interactive development.

Something that has been asked a couple of times is how to use matplotlib within Excel using PyXLL. As matplotlib is just a Python package like any other it can be imported and used in the same way as from any Python script. The difficulty is that when showing a plot the call to matplotlib blocks and so control isn’t returned to Excel until the user closes the window.

This blog shows how to plot data from Excel using matplotlib and PyXLL so that Excel can continue to be used while a plot window is active, and so that same window can be updated whenever the data in Excel is updated. Continue reading

Enthought’s Prabhu Ramachandran Announced as Winner of Kenneth Gonsalves Award 2014 at PyCon India

From PyCon India: Published / 25 Sep 2014

PSSI [Python Software Society of India] is happy to announce that Prabhu Ramachandran, faculty member of Department of Aerospace Engineering, IIT Bombay [and managing director of Enthought India] is the winner of Kenneth Gonsalves Award, 2014.

Enthought's Prabhu Ramachandran, winner of Kenneth Gonsalves Award 2014

Prabhu has been active in the Open source and Python community for close to 15 years. He co-founded the Chennai LUG in 1998. He is also well known as the author and lead developer of the award winning Mayavi and TVTK Python packages. He also maintains PySPH, an open source framework for Smoothed Particle Hydrodynamics (SPH) simulations.

Prabhu is also Member of Board, Python Software Foundation since 2010 and is closely involved with the activities of FOSSEE and SciPy India. His research interests are primarily in particle methods and applied scientific computing.

Prabhu will be presented the Award on 27th Sep, the opening day of PyCon India 2014. PSSI and Team PyCon India would like to extend their hearty Congratulations to Prabhu for his achievement and wish him the very best for his future endeavours.

————————–

Congratulations Prabu, we’re honored to have you as part of the Enthought team!

Webinar: Work Better, Smarter, and Faster in Python with Enthought Training on Demand

Join Us For a Webinar

Enthought Training on Demand Webinar

We’ll demonstrate how Enthought Training on Demand can help both new Python users and experienced Python developers be better, smarter, and faster at the scientific and analytic computing tasks that directly impact their daily productivity and drive results.

View a recording of the Work Better, Smarter, and Faster in Python with Enthought Training on Demand webinar here.

What You’ll Learn

Continue reading

The Latest and Greatest Pandas Features (since v 0.11)

On May 28, 2014 Phillip Cloud, core contributor for the Pandas data analytics Python library, spoke at a joint meetup of the New York Quantitative Python User’s Group (NY QPUG) and the NY Finance PUG. Enthought hosted and about 60 people joined us to listen to Phillip present some of the less-well-known, but really useful features that have come out since Pandas version 0.11 and some that are coming soon. We all learned more about how to take full advantage of the Pandas Python library, and got a better sense of how excited Phillip was to discover Pandas during his graduate work.

Pandas to MATLAB

After a fairly comprehensive overview of Pandas, Phillip got into the new features. In version 0.11 he covered: Continue reading