SlideShare a Scribd company logo
1 of 77
Download to read offline
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

P Y TABLES & Family
Analyzing and Sharing HDF5 Data with Python

Francesc Altet
CƔrabos Coop. V.

HDF Workshop November 30, 2005 - December 2, 2005.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Who are we?
CƔrabos is the company committed to the P Y TABLES suite
development and deployment.
We have years of experience in designing software
solutions for handling extremely large datasets.
What we provide:
Commercial support for the P Y TABLES suite.
P Y TABLES-based applications.
Consulting services for managing complex data
environments.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Who are we?
CƔrabos is the company committed to the P Y TABLES suite
development and deployment.
We have years of experience in designing software
solutions for handling extremely large datasets.
What we provide:
Commercial support for the P Y TABLES suite.
P Y TABLES-based applications.
Consulting services for managing complex data
environments.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Who are we?
CƔrabos is the company committed to the P Y TABLES suite
development and deployment.
We have years of experience in designing software
solutions for handling extremely large datasets.
What we provide:
Commercial support for the P Y TABLES suite.
P Y TABLES-based applications.
Consulting services for managing complex data
environments.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Main Features

Interpreted ā‡’ Allows interactivity
Flexible data structures ā‡’ Malleability
Minimalistic grammar ā‡’ Easy to learn
Very complete library (Batteries included) ā‡’ Boosts
productivity

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Main Features

Interpreted ā‡’ Allows interactivity
Flexible data structures ā‡’ Malleability
Minimalistic grammar ā‡’ Easy to learn
Very complete library (Batteries included) ā‡’ Boosts
productivity

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Main Features

Interpreted ā‡’ Allows interactivity
Flexible data structures ā‡’ Malleability
Minimalistic grammar ā‡’ Easy to learn
Very complete library (Batteries included) ā‡’ Boosts
productivity

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Main Features

Interpreted ā‡’ Allows interactivity
Flexible data structures ā‡’ Malleability
Minimalistic grammar ā‡’ Easy to learn
Very complete library (Batteries included) ā‡’ Boosts
productivity

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Very Suitable for Scientiļ¬c/Engineer Fields
Interactivity has always been very appreciated for
increasing productivity.
Being interpreted does not necessarily mean being
inefļ¬cient. Python has solutions for linking C & Fortran
libraries in an easy way.
Programming is normally considered a necessary evil.
Rich expressivity of Python normally reduces the amount
of code to solve real problems.
Many efļ¬cient scientiļ¬c libraries have been developed for
Python: Numeric, numarray, SciPy, Scientiļ¬c-Python,
matplotlib...

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Very Suitable for Scientiļ¬c/Engineer Fields
Interactivity has always been very appreciated for
increasing productivity.
Being interpreted does not necessarily mean being
inefļ¬cient. Python has solutions for linking C & Fortran
libraries in an easy way.
Programming is normally considered a necessary evil.
Rich expressivity of Python normally reduces the amount
of code to solve real problems.
Many efļ¬cient scientiļ¬c libraries have been developed for
Python: Numeric, numarray, SciPy, Scientiļ¬c-Python,
matplotlib...

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Very Suitable for Scientiļ¬c/Engineer Fields
Interactivity has always been very appreciated for
increasing productivity.
Being interpreted does not necessarily mean being
inefļ¬cient. Python has solutions for linking C & Fortran
libraries in an easy way.
Programming is normally considered a necessary evil.
Rich expressivity of Python normally reduces the amount
of code to solve real problems.
Many efļ¬cient scientiļ¬c libraries have been developed for
Python: Numeric, numarray, SciPy, Scientiļ¬c-Python,
matplotlib...

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Very Suitable for Scientiļ¬c/Engineer Fields
Interactivity has always been very appreciated for
increasing productivity.
Being interpreted does not necessarily mean being
inefļ¬cient. Python has solutions for linking C & Fortran
libraries in an easy way.
Programming is normally considered a necessary evil.
Rich expressivity of Python normally reduces the amount
of code to solve real problems.
Many efļ¬cient scientiļ¬c libraries have been developed for
Python: Numeric, numarray, SciPy, Scientiļ¬c-Python,
matplotlib...

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Basic Matrix Handling
Numeric
Very mature but lacking some features.
Still has a huge user base.
scipy.core
Called to substitute both Numeric & numarray. When
ļ¬nished, it is supposed to have all the advantages of
Numeric & numarray together.
numarray
Created to overcome some of the limitations of Numeric.
Better handling of large arrays, heterogeneous data...
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Basic Matrix Handling
Numeric
Very mature but lacking some features.
Still has a huge user base.
scipy.core
Called to substitute both Numeric & numarray. When
ļ¬nished, it is supposed to have all the advantages of
Numeric & numarray together.
numarray
Created to overcome some of the limitations of Numeric.
Better handling of large arrays, heterogeneous data...
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Basic Matrix Handling
Numeric
Very mature but lacking some features.
Still has a huge user base.
scipy.core
Called to substitute both Numeric & numarray. When
ļ¬nished, it is supposed to have all the advantages of
Numeric & numarray together.
numarray
Created to overcome some of the limitations of Numeric.
Better handling of large arrays, heterogeneous data...
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Numerical Supplements
SciPy
Optimization, integration, special functions
Signal and image processing
Genetic algorithms, ODE solvers...
Scientiļ¬c Python
Quaternions, automatic derivatives, (linear) interpolation,
polinomials, ...
Overlaps somewhat SciPy, but it has...
A nice netCDF module for I/O

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Numerical Supplements
SciPy
Optimization, integration, special functions
Signal and image processing
Genetic algorithms, ODE solvers...
Scientiļ¬c Python
Quaternions, automatic derivatives, (linear) interpolation,
polinomials, ...
Overlaps somewhat SciPy, but it has...
A nice netCDF module for I/O

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Plotting (2D)

matplotlib example
matplotlib
Great interactivity.
Produces
publication quality
ļ¬gures.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Plotting (2D)

PyQwt example
PyQwt
Fast plotting.
Nice to be
embedded in Qt
apps.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Plotting (3D)

MayaVi example
MayaVi
3D-oriented
scientiļ¬c data
visualizer.
Uses the
Visualization
Toolkit (VTK).

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Programming as a Necessary Evil
Evaluate En (x) =

āˆž eāˆ’xt
1
t n dt

for each value of n

from scipy import *
from scipy.integrate import quad, Inf
def integrand(t,n,x):
return exp(-x*t) / t**n
def expint(n,x):
return quad(integrand, 1, Inf, args=(n, x))[0]
v_expint = vectorize(expint)
print v_expint(3,arange(1.0,4.0,0.5))

The output
[ 0.10969197, 0.05673949, 0.03013338, 0.01629537,
0.00893065, 0.00494538,]

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Programming as a Necessary Evil

The output
The plotting code (matplotlib)
xrng = arange(1.0,4.0,0.1)
plot(xrng, v_expint(1, xrng))
plot(xrng, v_expint(2, xrng))
plot(xrng, v_expint(3, xrng))
legend(("n=1", "n=2", "n=3"))
title(ā€™Exponential Integralā€™)

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Facts about Python
Scientiļ¬c Packages
An example

Resources
Introductory material:
docs.python.org/tut/tut.html
www.python.org/doc/Intros.html

Lutz & Ascher, "Learning Python": good introduction.
Martelli, "Python in a Nutshell": useful reference.
Martelli & Ascher, "Python Cookbook": more specialized,
useful recipes for particular problems.
Hans P. Langtangen, "Python Scripting for Computational
Science": teaches computational scientists and engineers
how to write small Python scripts efļ¬ciently.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

What is P Y TABLES?

Simply stated: a database for Python based on HDF5.
Designed to deal with extremely large datasets.
Provides an easy-to-use interface.
Supports many of the features of HDF5 and others that are
not present in it (e.g. indexation).
It is Open Source software (BSD license).

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Why HDF5?
I started looking for different backends for saving large
datasets, but HDF5 was the ļ¬nal winner.
Thought out for managing very large datasets in an
efļ¬cient way.
Let you organize datasets hierchically.
Very ļ¬‚exible and well tested in scientiļ¬c environments.
Good maintenance and improvement rate.
It is Open Source software.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Why HDF5?
I started looking for different backends for saving large
datasets, but HDF5 was the ļ¬nal winner.
Thought out for managing very large datasets in an
efļ¬cient way.
Let you organize datasets hierchically.
Very ļ¬‚exible and well tested in scientiļ¬c environments.
Good maintenance and improvement rate.
It is Open Source software.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

What Does Extremely Large Exactly Mean?
The Hitch Hikerā€™s Guide to the Galaxy offers this deļ¬nition of
the word ā€œInļ¬niteā€:
Inļ¬nite: Bigger than the biggest thing ever and then some.
Much bigger than that in fact, really amazingly immense, a
totally stunning size, real ā€œwow, thatā€™s bigā€. Inļ¬nity is just so big
that, by comparison, bigness looks really titchy. Gigantic
multiplied by colossal multiplied by staggeringly huge is the sort
of concept weā€™re trying to get across here.
Disclaimer
Agreed, ā€™Extremely Largeā€™ may not exactly mean ā€™Inļ¬niteā€™,
although it is pretty close to this deļ¬nition.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

What Does Extremely Large Exactly Mean?
The Hitch Hikerā€™s Guide to the Galaxy offers this deļ¬nition of
the word ā€œInļ¬niteā€:
Inļ¬nite: Bigger than the biggest thing ever and then some.
Much bigger than that in fact, really amazingly immense, a
totally stunning size, real ā€œwow, thatā€™s bigā€. Inļ¬nity is just so big
that, by comparison, bigness looks really titchy. Gigantic
multiplied by colossal multiplied by staggeringly huge is the sort
of concept weā€™re trying to get across here.
Disclaimer
Agreed, ā€™Extremely Largeā€™ may not exactly mean ā€™Inļ¬niteā€™,
although it is pretty close to this deļ¬nition.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

What Does Extremely Large Exactly Mean?
The Hitch Hikerā€™s Guide to the Galaxy offers this deļ¬nition of
the word ā€œInļ¬niteā€:
Inļ¬nite: Bigger than the biggest thing ever and then some.
Much bigger than that in fact, really amazingly immense, a
totally stunning size, real ā€œwow, thatā€™s bigā€. Inļ¬nity is just so big
that, by comparison, bigness looks really titchy. Gigantic
multiplied by colossal multiplied by staggeringly huge is the sort
of concept weā€™re trying to get across here.
Disclaimer
Agreed, ā€™Extremely Largeā€™ may not exactly mean ā€™Inļ¬niteā€™,
although it is pretty close to this deļ¬nition.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Which ELD Features Does P Y TABLES Support?
A good base library (HDF5).
Support for 64-bit in all data addressing.
Need to overcome a Python slicing limitation: only 32-bit
addresses are supported.

Buffered I/O.
A LRU cache system for an efļ¬cient reuse of objects.
Fast indexing and searching capabilities for tables.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Which ELD Features Does P Y TABLES Support?
A good base library (HDF5).
Support for 64-bit in all data addressing.
Need to overcome a Python slicing limitation: only 32-bit
addresses are supported.

Buffered I/O.
A LRU cache system for an efļ¬cient reuse of objects.
Fast indexing and searching capabilities for tables.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Which ELD Features Does P Y TABLES Support?
A good base library (HDF5).
Support for 64-bit in all data addressing.
Need to overcome a Python slicing limitation: only 32-bit
addresses are supported.

Buffered I/O.
A LRU cache system for an efļ¬cient reuse of objects.
Fast indexing and searching capabilities for tables.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Which ELD Features Does P Y TABLES Support?
A good base library (HDF5).
Support for 64-bit in all data addressing.
Need to overcome a Python slicing limitation: only 32-bit
addresses are supported.

Buffered I/O.
A LRU cache system for an efļ¬cient reuse of objects.
Fast indexing and searching capabilities for tables.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Which ELD Features Does P Y TABLES Support?
A good base library (HDF5).
Support for 64-bit in all data addressing.
Need to overcome a Python slicing limitation: only 32-bit
addresses are supported.

Buffered I/O.
A LRU cache system for an efļ¬cient reuse of objects.
Fast indexing and searching capabilities for tables.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Why Buffered I/O?
Because of speed (what else?):

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Why a Cache System?
1.- To achieve better open ļ¬le times:

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Why a Cache System?
2.- To achieve a conservative usage of the memory:

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Why Fast Indexing?
It is not triļ¬‚ing in terms of time when you have to index tables
with more than one billion of rows:

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Ease of Use
Natural naming
# access to file:/group1/table
table = file.root.group1.table

Support for generalized slicing
# step means a stride in the slice
table[start:stop:step]

Support for iterators
# get the values in col1 that satisfy the
# (1.3 < col3 <= 2.) condition in table
col3 = table.cols.col3
[r[ā€™col1ā€™] for r in table.where(1.3 < col3 <= 2.)]
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Ease of Use
Natural naming
# access to file:/group1/table
table = file.root.group1.table

Support for generalized slicing
# step means a stride in the slice
table[start:stop:step]

Support for iterators
# get the values in col1 that satisfy the
# (1.3 < col3 <= 2.) condition in table
col3 = table.cols.col3
[r[ā€™col1ā€™] for r in table.where(1.3 < col3 <= 2.)]
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Ease of Use
Natural naming
# access to file:/group1/table
table = file.root.group1.table

Support for generalized slicing
# step means a stride in the slice
table[start:stop:step]

Support for iterators
# get the values in col1 that satisfy the
# (1.3 < col3 <= 2.) condition in table
col3 = table.cols.col3
[r[ā€™col1ā€™] for r in table.where(1.3 < col3 <= 2.)]
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Supported Objects in P Y TABLES
Table: Lets you deal with heterogeneous datasets.
Chunked. Enlargeable. Support for nested types.
Array: Provides quick and dirty array handling. Not
chunked. Non enlargeable.
CArray: Provides compressed array support. Chunked.
Not enlargeable.
EArray: Most general array support. Chunked.
Enlargeable.
VLArray: Collections of homogeneous data with a variable
number of entries. Chunked. Enlargeable.
Group: The structural component.
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Whatā€™s New in P Y TABLES 1.2?
Added a new cache for the object tree.
Allows a contained use of memory (even with huge trees).
Almost instantaneous opening of ļ¬les (good news for
interactive use!).

New NetCDF module (contributed by Jeff Whitaker).
Provides API emulation for Scientific.IO.NetCDF.
netCDF-3 ā‡” HDF5 conversions.
tables.NetCDF datasets can be shared over the internet
with the OPeNDAP protocol.
Plans to write data natively in netCDF-4 format in the future.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Whatā€™s New in P Y TABLES 1.2?
Added a new cache for the object tree.
Allows a contained use of memory (even with huge trees).
Almost instantaneous opening of ļ¬les (good news for
interactive use!).

New NetCDF module (contributed by Jeff Whitaker).
Provides API emulation for Scientific.IO.NetCDF.
netCDF-3 ā‡” HDF5 conversions.
tables.NetCDF datasets can be shared over the internet
with the OPeNDAP protocol.
Plans to write data natively in netCDF-4 format in the future.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Some Metrics on P Y TABLES 1.2
Core Library
~ 7.5 thousand LOC (Python)
~ 2.8 thousand LOC (Pyrex)
~ 4.0 thousand LOC (C)

Test Units
~ 3.1 thousand test units (Python)
~ 23 thousand LOC (Python)

Documentation
~ 5.0 thousand lines of on-line doc strings
~ 160 pages of Usersā€™ Guide in PDF (and HTML)

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

What is P Y TABLES P RO?
Itā€™s just a regular P Y TABLES but with enhanced features:
Improved search speed: Selections in tables with > 1
billion rows will be typically done in less than 1 second.
Complex queries: Supports an unlimited combination of
conditions.
Query optimizer: Queries are analyzed, reordered and
classiļ¬ed to get an optimum response time.
Support for complex indices: Expressions like col1 +
col2*col3 + col4**3 can be indexed and used for selections
afterwards.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Index Selection Speed

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Index Selection Speed: The Goal

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Usage Examples
P Y TABLES Pro

Current Status for P Y TABLES P RO

Improving the query response time.
Remains to be done:
Complex queries.
Query optimizer.

Date of release: 2nd quarter 2006 (tentative).

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

CSTABLES: P Y TABLES Goes Client-Server

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Design Goals
Concurrency: Allows multiple access to the same ļ¬le at the
same time.
Locking system: Avoids corruption of data.

High Throughput: Data is transmitted in large blocks.
High-speed compressor/decompressor used.
Client Cache: Metadata is kept in the client-side when an
object is ļ¬rst accessed.
Full P Y TABLES API compatibility: Existing P Y TABLES
programs can be re-used to access remote ļ¬les
without changing virtually anything.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Concurrency Issues
Question: CSTABLES does not provide threading or
asynchronous features yet. So, how does it deal with
several requests at a time?
Answer: Large data read and write requests are split into
small chunks. This considerably improves server response
time.
In addition, CSTABLES provides a lock mechanism that
allows applications to explicitly put a lock on a node or on
an entire subtree.
Different locking access modes:
READ, WRITE and ALL
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Concurrency Issues
Question: CSTABLES does not provide threading or
asynchronous features yet. So, how does it deal with
several requests at a time?
Answer: Large data read and write requests are split into
small chunks. This considerably improves server response
time.
In addition, CSTABLES provides a lock mechanism that
allows applications to explicitly put a lock on a node or on
an entire subtree.
Different locking access modes:
READ, WRITE and ALL
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Concurrency Issues
Question: CSTABLES does not provide threading or
asynchronous features yet. So, how does it deal with
several requests at a time?
Answer: Large data read and write requests are split into
small chunks. This considerably improves server response
time.
In addition, CSTABLES provides a lock mechanism that
allows applications to explicitly put a lock on a node or on
an entire subtree.
Different locking access modes:
READ, WRITE and ALL
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Client Cache More in Depth
CSTABLES caches some of the metadata of the P Y TABLES
object tree.
When a client makes a change to the metadata, this
change is pushed to the other clientsā€™ caches.
Easy to control which attributes should be cached and
which should not.
You should try to cache primarily read-only attributes.

Caveat emptor:
Caching attributes that are updated very often might generate
more trafļ¬c than attributes that are not cached at all!
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Client Cache More in Depth
CSTABLES caches some of the metadata of the P Y TABLES
object tree.
When a client makes a change to the metadata, this
change is pushed to the other clientsā€™ caches.
Easy to control which attributes should be cached and
which should not.
You should try to cache primarily read-only attributes.

Caveat emptor:
Caching attributes that are updated very often might generate
more trafļ¬c than attributes that are not cached at all!
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Client Cache More in Depth
CSTABLES caches some of the metadata of the P Y TABLES
object tree.
When a client makes a change to the metadata, this
change is pushed to the other clientsā€™ caches.
Easy to control which attributes should be cached and
which should not.
You should try to cache primarily read-only attributes.

Caveat emptor:
Caching attributes that are updated very often might generate
more trafļ¬c than attributes that are not cached at all!
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Client Cache More in Depth
CSTABLES caches some of the metadata of the P Y TABLES
object tree.
When a client makes a change to the metadata, this
change is pushed to the other clientsā€™ caches.
Easy to control which attributes should be cached and
which should not.
You should try to cache primarily read-only attributes.

Caveat emptor:
Caching attributes that are updated very often might generate
more trafļ¬c than attributes that are not cached at all!
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Outline
1

An Introduction to the Python Language
Facts about Python
Scientiļ¬c Packages
An example

2

P Y TABLES
Overview
Usage Examples
P Y TABLES Pro

3

CSTABLES
Overview
Design goals
Examples of Use
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Two Different APIs
P Y TABLES API (preļ¬x with csclient -ip=server_IP)
import tables
fileh = tables.openFile("file.h5")
print fileh.root.table.cols.col1[:]
fileh.close()
CSTABLES API (no need to be preļ¬xed)
from cstables.client import client
c=client.Session()
app=c.connect("your_FQDN_server")
fileh=app.openFile("file.h5")
print fileh.root.table.cols.col1[:]
fileh.close()
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

Two Different APIs
P Y TABLES API (preļ¬x with csclient -ip=server_IP)
import tables
fileh = tables.openFile("file.h5")
print fileh.root.table.cols.col1[:]
fileh.close()
CSTABLES API (no need to be preļ¬xed)
from cstables.client import client
c=client.Session()
app=c.connect("your_FQDN_server")
fileh=app.openFile("file.h5")
print fileh.root.table.cols.col1[:]
fileh.close()
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

CSTABLES Status & Availability

The main design features are already implemented and
working.
Beta available (caveat: only works against P Y TABLES 1.0).
Focus now is on checking & debugging possible errors,
improving the throughput and bettering the Usersā€™ Guide.
Future directions: threading, asynchronous
communications.

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

The P Y TABLES Suite Is Getting Shape
P Y TABLES
The basic layer for the other components.
P Y TABLES Pro
P Y TABLES with a twist: Complex searches and ultra-fast
selections in tables.
CSTABLES
The client-server P Y TABLES. It supports as well generic HDF5
ļ¬les.
V I TABLES
A data viewer for P Y TABLES (and HDF5) ļ¬les.
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

The P Y TABLES Suite Is Getting Shape
P Y TABLES
The basic layer for the other components.
P Y TABLES Pro
P Y TABLES with a twist: Complex searches and ultra-fast
selections in tables.
CSTABLES
The client-server P Y TABLES. It supports as well generic HDF5
ļ¬les.
V I TABLES
A data viewer for P Y TABLES (and HDF5) ļ¬les.
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

The P Y TABLES Suite Is Getting Shape
P Y TABLES
The basic layer for the other components.
P Y TABLES Pro
P Y TABLES with a twist: Complex searches and ultra-fast
selections in tables.
CSTABLES
The client-server P Y TABLES. It supports as well generic HDF5
ļ¬les.
V I TABLES
A data viewer for P Y TABLES (and HDF5) ļ¬les.
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Overview
Design goals
Examples of Use

The P Y TABLES Suite Is Getting Shape
P Y TABLES
The basic layer for the other components.
P Y TABLES Pro
P Y TABLES with a twist: Complex searches and ultra-fast
selections in tables.
CSTABLES
The client-server P Y TABLES. It supports as well generic HDF5
ļ¬les.
V I TABLES
A data viewer for P Y TABLES (and HDF5) ļ¬les.
Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Summary
Python is a joy for scientiļ¬c computing. Start using it now!
The P Y TABLES suite is designed to work with HDF5 ļ¬les in
an interactive, efļ¬cient and, most importantly, easy way.
Outlook
Working hard to release CSTABLES in the ļ¬rst quarter of
2006. P Y TABLES P RO will come later on (~ 2nd quarter of
2006).
It would be nice to produce a parallel version of P Y TABLES
(long term goal).

Francesc Altet

P Y TABLES & Family
An Introduction to the Python Language
P Y TABLES
CSTABLES
Summary

Thank You!

Thanks also to:
Elena Pourmal, for inviting us to the Workshop.
Frank Baker, for being kind.
The HDF Group for pushing forward P Y TABLES.

Francesc Altet

P Y TABLES & Family

More Related Content

What's hot

Why Python?
Why Python?Why Python?
Why Python?Adam Pah
Ā 
Lexical Resources for Portuguese
Lexical Resources  for PortugueseLexical Resources  for Portuguese
Lexical Resources for PortugueseValeria de Paiva
Ā 
From Python to Kotlin - TalkingKT 2019
From Python to Kotlin - TalkingKT 2019From Python to Kotlin - TalkingKT 2019
From Python to Kotlin - TalkingKT 2019Horgix
Ā 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its ApplicationsAbhijeet Singh
Ā 
Logics and Ontologies for Portuguese Understanding
Logics and Ontologies for Portuguese UnderstandingLogics and Ontologies for Portuguese Understanding
Logics and Ontologies for Portuguese UnderstandingValeria de Paiva
Ā 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)wesley chun
Ā 
What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)wesley chun
Ā 
Python: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaPython: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaActiveState
Ā 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming LanguageLaxman Puri
Ā 

What's hot (11)

Why Python?
Why Python?Why Python?
Why Python?
Ā 
Lexical Resources for Portuguese
Lexical Resources  for PortugueseLexical Resources  for Portuguese
Lexical Resources for Portuguese
Ā 
From Python to Kotlin - TalkingKT 2019
From Python to Kotlin - TalkingKT 2019From Python to Kotlin - TalkingKT 2019
From Python to Kotlin - TalkingKT 2019
Ā 
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
Ā 
Logics and Ontologies for Portuguese Understanding
Logics and Ontologies for Portuguese UnderstandingLogics and Ontologies for Portuguese Understanding
Logics and Ontologies for Portuguese Understanding
Ā 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)
Ā 
What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)
Ā 
Python unit1
Python unit1Python unit1
Python unit1
Ā 
Python - the basics
Python - the basicsPython - the basics
Python - the basics
Ā 
Python: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaPython: The Programmer's Lingua Franca
Python: The Programmer's Lingua Franca
Ā 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
Ā 

Similar to Analyzing and Sharing HDF5 Data with Python

Five python libraries should know for machine learning
Five python libraries should know for machine learningFive python libraries should know for machine learning
Five python libraries should know for machine learningNaveen Davis
Ā 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptxVinay Chowdary
Ā 
A Whirlwind Tour Of Python
A Whirlwind Tour Of PythonA Whirlwind Tour Of Python
A Whirlwind Tour Of PythonAsia Smith
Ā 
Python A Comprehensive Guide for Beginners.pdf
Python A Comprehensive Guide for Beginners.pdfPython A Comprehensive Guide for Beginners.pdf
Python A Comprehensive Guide for Beginners.pdfKajal Digital
Ā 
Python libraries for data science
Python libraries for data sciencePython libraries for data science
Python libraries for data sciencenilashri2
Ā 
Python standard library &amp; list of important libraries
Python standard library &amp; list of important librariesPython standard library &amp; list of important libraries
Python standard library &amp; list of important librariesgrinu
Ā 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on pythonShubham Yadav
Ā 
R vs python
R vs pythonR vs python
R vs pythonPrwaTech
Ā 
Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python Chariza Pladin
Ā 
Python Mastery Made Easy.pdf
Python Mastery Made Easy.pdfPython Mastery Made Easy.pdf
Python Mastery Made Easy.pdfSathishKumar235656
Ā 
Guide to Learn Python Programming.pdf
Guide to Learn Python Programming.pdfGuide to Learn Python Programming.pdf
Guide to Learn Python Programming.pdfNikhilSharma142682
Ā 
Introduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and PythonIntroduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and PythonJen Stirrup
Ā 
Python basics
Python basicsPython basics
Python basicsssuser4e32df
Ā 
Why Python Should Be Your First Programming Language
Why Python Should Be Your First Programming LanguageWhy Python Should Be Your First Programming Language
Why Python Should Be Your First Programming LanguageEdureka!
Ā 
The Great Debate.pdf
The Great Debate.pdfThe Great Debate.pdf
The Great Debate.pdfSudhanshiBakre1
Ā 
Python ā€“ The Fastest Growing Programming Language
Python ā€“ The Fastest Growing Programming LanguagePython ā€“ The Fastest Growing Programming Language
Python ā€“ The Fastest Growing Programming LanguageIRJET Journal
Ā 
Which programming language to learn R or Python - MeasureCamp XII
Which programming language to learn R or Python - MeasureCamp XIIWhich programming language to learn R or Python - MeasureCamp XII
Which programming language to learn R or Python - MeasureCamp XIIMaggie Petrova
Ā 
Untitled document (12).pdf
Untitled document (12).pdfUntitled document (12).pdf
Untitled document (12).pdfcollinscafe
Ā 

Similar to Analyzing and Sharing HDF5 Data with Python (20)

Five python libraries should know for machine learning
Five python libraries should know for machine learningFive python libraries should know for machine learning
Five python libraries should know for machine learning
Ā 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
Ā 
A Whirlwind Tour Of Python
A Whirlwind Tour Of PythonA Whirlwind Tour Of Python
A Whirlwind Tour Of Python
Ā 
Python A Comprehensive Guide for Beginners.pdf
Python A Comprehensive Guide for Beginners.pdfPython A Comprehensive Guide for Beginners.pdf
Python A Comprehensive Guide for Beginners.pdf
Ā 
Python libraries for data science
Python libraries for data sciencePython libraries for data science
Python libraries for data science
Ā 
what is python ?
what is python ? what is python ?
what is python ?
Ā 
Python standard library &amp; list of important libraries
Python standard library &amp; list of important librariesPython standard library &amp; list of important libraries
Python standard library &amp; list of important libraries
Ā 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
Ā 
R vs python
R vs pythonR vs python
R vs python
Ā 
Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python Top Libraries for Machine Learning with Python
Top Libraries for Machine Learning with Python
Ā 
Python Mastery Made Easy.pdf
Python Mastery Made Easy.pdfPython Mastery Made Easy.pdf
Python Mastery Made Easy.pdf
Ā 
Guide to Learn Python Programming.pdf
Guide to Learn Python Programming.pdfGuide to Learn Python Programming.pdf
Guide to Learn Python Programming.pdf
Ā 
Introduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and PythonIntroduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and Python
Ā 
Python basics
Python basicsPython basics
Python basics
Ā 
Why Python Should Be Your First Programming Language
Why Python Should Be Your First Programming LanguageWhy Python Should Be Your First Programming Language
Why Python Should Be Your First Programming Language
Ā 
The Great Debate.pdf
The Great Debate.pdfThe Great Debate.pdf
The Great Debate.pdf
Ā 
Introduction of Python
Introduction of PythonIntroduction of Python
Introduction of Python
Ā 
Python ā€“ The Fastest Growing Programming Language
Python ā€“ The Fastest Growing Programming LanguagePython ā€“ The Fastest Growing Programming Language
Python ā€“ The Fastest Growing Programming Language
Ā 
Which programming language to learn R or Python - MeasureCamp XII
Which programming language to learn R or Python - MeasureCamp XIIWhich programming language to learn R or Python - MeasureCamp XII
Which programming language to learn R or Python - MeasureCamp XII
Ā 
Untitled document (12).pdf
Untitled document (12).pdfUntitled document (12).pdf
Untitled document (12).pdf
Ā 

More from The HDF-EOS Tools and Information Center

STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...The HDF-EOS Tools and Information Center
Ā 

More from The HDF-EOS Tools and Information Center (20)

Cloud-Optimized HDF5 Files
Cloud-Optimized HDF5 FilesCloud-Optimized HDF5 Files
Cloud-Optimized HDF5 Files
Ā 
Accessing HDF5 data in the cloud with HSDS
Accessing HDF5 data in the cloud with HSDSAccessing HDF5 data in the cloud with HSDS
Accessing HDF5 data in the cloud with HSDS
Ā 
The State of HDF
The State of HDFThe State of HDF
The State of HDF
Ā 
Highly Scalable Data Service (HSDS) Performance Features
Highly Scalable Data Service (HSDS) Performance FeaturesHighly Scalable Data Service (HSDS) Performance Features
Highly Scalable Data Service (HSDS) Performance Features
Ā 
Creating Cloud-Optimized HDF5 Files
Creating Cloud-Optimized HDF5 FilesCreating Cloud-Optimized HDF5 Files
Creating Cloud-Optimized HDF5 Files
Ā 
HDF5 OPeNDAP Handler Updates, and Performance Discussion
HDF5 OPeNDAP Handler Updates, and Performance DiscussionHDF5 OPeNDAP Handler Updates, and Performance Discussion
HDF5 OPeNDAP Handler Updates, and Performance Discussion
Ā 
Hyrax: Serving Data from S3
Hyrax: Serving Data from S3Hyrax: Serving Data from S3
Hyrax: Serving Data from S3
Ā 
Accessing Cloud Data and Services Using EDL, Pydap, MATLAB
Accessing Cloud Data and Services Using EDL, Pydap, MATLABAccessing Cloud Data and Services Using EDL, Pydap, MATLAB
Accessing Cloud Data and Services Using EDL, Pydap, MATLAB
Ā 
HDF - Current status and Future Directions
HDF - Current status and Future DirectionsHDF - Current status and Future Directions
HDF - Current status and Future Directions
Ā 
HDFEOS.org User Analsys, Updates, and Future
HDFEOS.org User Analsys, Updates, and FutureHDFEOS.org User Analsys, Updates, and Future
HDFEOS.org User Analsys, Updates, and Future
Ā 
HDF - Current status and Future Directions
HDF - Current status and Future Directions HDF - Current status and Future Directions
HDF - Current status and Future Directions
Ā 
H5Coro: The Cloud-Optimized Read-Only Library
H5Coro: The Cloud-Optimized Read-Only LibraryH5Coro: The Cloud-Optimized Read-Only Library
H5Coro: The Cloud-Optimized Read-Only Library
Ā 
MATLAB Modernization on HDF5 1.10
MATLAB Modernization on HDF5 1.10MATLAB Modernization on HDF5 1.10
MATLAB Modernization on HDF5 1.10
Ā 
HDF for the Cloud - Serverless HDF
HDF for the Cloud - Serverless HDFHDF for the Cloud - Serverless HDF
HDF for the Cloud - Serverless HDF
Ā 
HDF5 <-> Zarr
HDF5 <-> ZarrHDF5 <-> Zarr
HDF5 <-> Zarr
Ā 
HDF for the Cloud - New HDF Server Features
HDF for the Cloud - New HDF Server FeaturesHDF for the Cloud - New HDF Server Features
HDF for the Cloud - New HDF Server Features
Ā 
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
Apache Drill and Unidata THREDDS Data Server for NASA HDF-EOS on S3
Ā 
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
STARE-PODS: A Versatile Data Store Leveraging the HDF Virtual Object Layer fo...
Ā 
HDF5 and Ecosystem: What Is New?
HDF5 and Ecosystem: What Is New?HDF5 and Ecosystem: What Is New?
HDF5 and Ecosystem: What Is New?
Ā 
HDF5 Roadmap 2019-2020
HDF5 Roadmap 2019-2020HDF5 Roadmap 2019-2020
HDF5 Roadmap 2019-2020
Ā 

Recently uploaded

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
Ā 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĆŗjo
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
Ā 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
Ā 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
Ā 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Ā 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
Ā 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Ā 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Ā 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Ā 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Ā 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
Ā 

Analyzing and Sharing HDF5 Data with Python

  • 1. An Introduction to the Python Language P Y TABLES CSTABLES Summary P Y TABLES & Family Analyzing and Sharing HDF5 Data with Python Francesc Altet CĆ”rabos Coop. V. HDF Workshop November 30, 2005 - December 2, 2005. Francesc Altet P Y TABLES & Family
  • 2. An Introduction to the Python Language P Y TABLES CSTABLES Summary Who are we? CĆ”rabos is the company committed to the P Y TABLES suite development and deployment. We have years of experience in designing software solutions for handling extremely large datasets. What we provide: Commercial support for the P Y TABLES suite. P Y TABLES-based applications. Consulting services for managing complex data environments. Francesc Altet P Y TABLES & Family
  • 3. An Introduction to the Python Language P Y TABLES CSTABLES Summary Who are we? CĆ”rabos is the company committed to the P Y TABLES suite development and deployment. We have years of experience in designing software solutions for handling extremely large datasets. What we provide: Commercial support for the P Y TABLES suite. P Y TABLES-based applications. Consulting services for managing complex data environments. Francesc Altet P Y TABLES & Family
  • 4. An Introduction to the Python Language P Y TABLES CSTABLES Summary Who are we? CĆ”rabos is the company committed to the P Y TABLES suite development and deployment. We have years of experience in designing software solutions for handling extremely large datasets. What we provide: Commercial support for the P Y TABLES suite. P Y TABLES-based applications. Consulting services for managing complex data environments. Francesc Altet P Y TABLES & Family
  • 5. An Introduction to the Python Language P Y TABLES CSTABLES Summary Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 6. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 7. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Main Features Interpreted ā‡’ Allows interactivity Flexible data structures ā‡’ Malleability Minimalistic grammar ā‡’ Easy to learn Very complete library (Batteries included) ā‡’ Boosts productivity Francesc Altet P Y TABLES & Family
  • 8. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Main Features Interpreted ā‡’ Allows interactivity Flexible data structures ā‡’ Malleability Minimalistic grammar ā‡’ Easy to learn Very complete library (Batteries included) ā‡’ Boosts productivity Francesc Altet P Y TABLES & Family
  • 9. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Main Features Interpreted ā‡’ Allows interactivity Flexible data structures ā‡’ Malleability Minimalistic grammar ā‡’ Easy to learn Very complete library (Batteries included) ā‡’ Boosts productivity Francesc Altet P Y TABLES & Family
  • 10. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Main Features Interpreted ā‡’ Allows interactivity Flexible data structures ā‡’ Malleability Minimalistic grammar ā‡’ Easy to learn Very complete library (Batteries included) ā‡’ Boosts productivity Francesc Altet P Y TABLES & Family
  • 11. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Very Suitable for Scientiļ¬c/Engineer Fields Interactivity has always been very appreciated for increasing productivity. Being interpreted does not necessarily mean being inefļ¬cient. Python has solutions for linking C & Fortran libraries in an easy way. Programming is normally considered a necessary evil. Rich expressivity of Python normally reduces the amount of code to solve real problems. Many efļ¬cient scientiļ¬c libraries have been developed for Python: Numeric, numarray, SciPy, Scientiļ¬c-Python, matplotlib... Francesc Altet P Y TABLES & Family
  • 12. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Very Suitable for Scientiļ¬c/Engineer Fields Interactivity has always been very appreciated for increasing productivity. Being interpreted does not necessarily mean being inefļ¬cient. Python has solutions for linking C & Fortran libraries in an easy way. Programming is normally considered a necessary evil. Rich expressivity of Python normally reduces the amount of code to solve real problems. Many efļ¬cient scientiļ¬c libraries have been developed for Python: Numeric, numarray, SciPy, Scientiļ¬c-Python, matplotlib... Francesc Altet P Y TABLES & Family
  • 13. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Very Suitable for Scientiļ¬c/Engineer Fields Interactivity has always been very appreciated for increasing productivity. Being interpreted does not necessarily mean being inefļ¬cient. Python has solutions for linking C & Fortran libraries in an easy way. Programming is normally considered a necessary evil. Rich expressivity of Python normally reduces the amount of code to solve real problems. Many efļ¬cient scientiļ¬c libraries have been developed for Python: Numeric, numarray, SciPy, Scientiļ¬c-Python, matplotlib... Francesc Altet P Y TABLES & Family
  • 14. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Very Suitable for Scientiļ¬c/Engineer Fields Interactivity has always been very appreciated for increasing productivity. Being interpreted does not necessarily mean being inefļ¬cient. Python has solutions for linking C & Fortran libraries in an easy way. Programming is normally considered a necessary evil. Rich expressivity of Python normally reduces the amount of code to solve real problems. Many efļ¬cient scientiļ¬c libraries have been developed for Python: Numeric, numarray, SciPy, Scientiļ¬c-Python, matplotlib... Francesc Altet P Y TABLES & Family
  • 15. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 16. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Basic Matrix Handling Numeric Very mature but lacking some features. Still has a huge user base. scipy.core Called to substitute both Numeric & numarray. When ļ¬nished, it is supposed to have all the advantages of Numeric & numarray together. numarray Created to overcome some of the limitations of Numeric. Better handling of large arrays, heterogeneous data... Francesc Altet P Y TABLES & Family
  • 17. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Basic Matrix Handling Numeric Very mature but lacking some features. Still has a huge user base. scipy.core Called to substitute both Numeric & numarray. When ļ¬nished, it is supposed to have all the advantages of Numeric & numarray together. numarray Created to overcome some of the limitations of Numeric. Better handling of large arrays, heterogeneous data... Francesc Altet P Y TABLES & Family
  • 18. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Basic Matrix Handling Numeric Very mature but lacking some features. Still has a huge user base. scipy.core Called to substitute both Numeric & numarray. When ļ¬nished, it is supposed to have all the advantages of Numeric & numarray together. numarray Created to overcome some of the limitations of Numeric. Better handling of large arrays, heterogeneous data... Francesc Altet P Y TABLES & Family
  • 19. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Numerical Supplements SciPy Optimization, integration, special functions Signal and image processing Genetic algorithms, ODE solvers... Scientiļ¬c Python Quaternions, automatic derivatives, (linear) interpolation, polinomials, ... Overlaps somewhat SciPy, but it has... A nice netCDF module for I/O Francesc Altet P Y TABLES & Family
  • 20. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Numerical Supplements SciPy Optimization, integration, special functions Signal and image processing Genetic algorithms, ODE solvers... Scientiļ¬c Python Quaternions, automatic derivatives, (linear) interpolation, polinomials, ... Overlaps somewhat SciPy, but it has... A nice netCDF module for I/O Francesc Altet P Y TABLES & Family
  • 21. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Plotting (2D) matplotlib example matplotlib Great interactivity. Produces publication quality ļ¬gures. Francesc Altet P Y TABLES & Family
  • 22. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Plotting (2D) PyQwt example PyQwt Fast plotting. Nice to be embedded in Qt apps. Francesc Altet P Y TABLES & Family
  • 23. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Plotting (3D) MayaVi example MayaVi 3D-oriented scientiļ¬c data visualizer. Uses the Visualization Toolkit (VTK). Francesc Altet P Y TABLES & Family
  • 24. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 25. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Programming as a Necessary Evil Evaluate En (x) = āˆž eāˆ’xt 1 t n dt for each value of n from scipy import * from scipy.integrate import quad, Inf def integrand(t,n,x): return exp(-x*t) / t**n def expint(n,x): return quad(integrand, 1, Inf, args=(n, x))[0] v_expint = vectorize(expint) print v_expint(3,arange(1.0,4.0,0.5)) The output [ 0.10969197, 0.05673949, 0.03013338, 0.01629537, 0.00893065, 0.00494538,] Francesc Altet P Y TABLES & Family
  • 26. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Programming as a Necessary Evil The output The plotting code (matplotlib) xrng = arange(1.0,4.0,0.1) plot(xrng, v_expint(1, xrng)) plot(xrng, v_expint(2, xrng)) plot(xrng, v_expint(3, xrng)) legend(("n=1", "n=2", "n=3")) title(ā€™Exponential Integralā€™) Francesc Altet P Y TABLES & Family
  • 27. An Introduction to the Python Language P Y TABLES CSTABLES Summary Facts about Python Scientiļ¬c Packages An example Resources Introductory material: docs.python.org/tut/tut.html www.python.org/doc/Intros.html Lutz & Ascher, "Learning Python": good introduction. Martelli, "Python in a Nutshell": useful reference. Martelli & Ascher, "Python Cookbook": more specialized, useful recipes for particular problems. Hans P. Langtangen, "Python Scripting for Computational Science": teaches computational scientists and engineers how to write small Python scripts efļ¬ciently. Francesc Altet P Y TABLES & Family
  • 28. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 29. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro What is P Y TABLES? Simply stated: a database for Python based on HDF5. Designed to deal with extremely large datasets. Provides an easy-to-use interface. Supports many of the features of HDF5 and others that are not present in it (e.g. indexation). It is Open Source software (BSD license). Francesc Altet P Y TABLES & Family
  • 30. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Why HDF5? I started looking for different backends for saving large datasets, but HDF5 was the ļ¬nal winner. Thought out for managing very large datasets in an efļ¬cient way. Let you organize datasets hierchically. Very ļ¬‚exible and well tested in scientiļ¬c environments. Good maintenance and improvement rate. It is Open Source software. Francesc Altet P Y TABLES & Family
  • 31. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Why HDF5? I started looking for different backends for saving large datasets, but HDF5 was the ļ¬nal winner. Thought out for managing very large datasets in an efļ¬cient way. Let you organize datasets hierchically. Very ļ¬‚exible and well tested in scientiļ¬c environments. Good maintenance and improvement rate. It is Open Source software. Francesc Altet P Y TABLES & Family
  • 32. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro What Does Extremely Large Exactly Mean? The Hitch Hikerā€™s Guide to the Galaxy offers this deļ¬nition of the word ā€œInļ¬niteā€: Inļ¬nite: Bigger than the biggest thing ever and then some. Much bigger than that in fact, really amazingly immense, a totally stunning size, real ā€œwow, thatā€™s bigā€. Inļ¬nity is just so big that, by comparison, bigness looks really titchy. Gigantic multiplied by colossal multiplied by staggeringly huge is the sort of concept weā€™re trying to get across here. Disclaimer Agreed, ā€™Extremely Largeā€™ may not exactly mean ā€™Inļ¬niteā€™, although it is pretty close to this deļ¬nition. Francesc Altet P Y TABLES & Family
  • 33. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro What Does Extremely Large Exactly Mean? The Hitch Hikerā€™s Guide to the Galaxy offers this deļ¬nition of the word ā€œInļ¬niteā€: Inļ¬nite: Bigger than the biggest thing ever and then some. Much bigger than that in fact, really amazingly immense, a totally stunning size, real ā€œwow, thatā€™s bigā€. Inļ¬nity is just so big that, by comparison, bigness looks really titchy. Gigantic multiplied by colossal multiplied by staggeringly huge is the sort of concept weā€™re trying to get across here. Disclaimer Agreed, ā€™Extremely Largeā€™ may not exactly mean ā€™Inļ¬niteā€™, although it is pretty close to this deļ¬nition. Francesc Altet P Y TABLES & Family
  • 34. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro What Does Extremely Large Exactly Mean? The Hitch Hikerā€™s Guide to the Galaxy offers this deļ¬nition of the word ā€œInļ¬niteā€: Inļ¬nite: Bigger than the biggest thing ever and then some. Much bigger than that in fact, really amazingly immense, a totally stunning size, real ā€œwow, thatā€™s bigā€. Inļ¬nity is just so big that, by comparison, bigness looks really titchy. Gigantic multiplied by colossal multiplied by staggeringly huge is the sort of concept weā€™re trying to get across here. Disclaimer Agreed, ā€™Extremely Largeā€™ may not exactly mean ā€™Inļ¬niteā€™, although it is pretty close to this deļ¬nition. Francesc Altet P Y TABLES & Family
  • 35. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Which ELD Features Does P Y TABLES Support? A good base library (HDF5). Support for 64-bit in all data addressing. Need to overcome a Python slicing limitation: only 32-bit addresses are supported. Buffered I/O. A LRU cache system for an efļ¬cient reuse of objects. Fast indexing and searching capabilities for tables. Francesc Altet P Y TABLES & Family
  • 36. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Which ELD Features Does P Y TABLES Support? A good base library (HDF5). Support for 64-bit in all data addressing. Need to overcome a Python slicing limitation: only 32-bit addresses are supported. Buffered I/O. A LRU cache system for an efļ¬cient reuse of objects. Fast indexing and searching capabilities for tables. Francesc Altet P Y TABLES & Family
  • 37. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Which ELD Features Does P Y TABLES Support? A good base library (HDF5). Support for 64-bit in all data addressing. Need to overcome a Python slicing limitation: only 32-bit addresses are supported. Buffered I/O. A LRU cache system for an efļ¬cient reuse of objects. Fast indexing and searching capabilities for tables. Francesc Altet P Y TABLES & Family
  • 38. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Which ELD Features Does P Y TABLES Support? A good base library (HDF5). Support for 64-bit in all data addressing. Need to overcome a Python slicing limitation: only 32-bit addresses are supported. Buffered I/O. A LRU cache system for an efļ¬cient reuse of objects. Fast indexing and searching capabilities for tables. Francesc Altet P Y TABLES & Family
  • 39. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Which ELD Features Does P Y TABLES Support? A good base library (HDF5). Support for 64-bit in all data addressing. Need to overcome a Python slicing limitation: only 32-bit addresses are supported. Buffered I/O. A LRU cache system for an efļ¬cient reuse of objects. Fast indexing and searching capabilities for tables. Francesc Altet P Y TABLES & Family
  • 40. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Why Buffered I/O? Because of speed (what else?): Francesc Altet P Y TABLES & Family
  • 41. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Why a Cache System? 1.- To achieve better open ļ¬le times: Francesc Altet P Y TABLES & Family
  • 42. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Why a Cache System? 2.- To achieve a conservative usage of the memory: Francesc Altet P Y TABLES & Family
  • 43. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Why Fast Indexing? It is not triļ¬‚ing in terms of time when you have to index tables with more than one billion of rows: Francesc Altet P Y TABLES & Family
  • 44. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Ease of Use Natural naming # access to file:/group1/table table = file.root.group1.table Support for generalized slicing # step means a stride in the slice table[start:stop:step] Support for iterators # get the values in col1 that satisfy the # (1.3 < col3 <= 2.) condition in table col3 = table.cols.col3 [r[ā€™col1ā€™] for r in table.where(1.3 < col3 <= 2.)] Francesc Altet P Y TABLES & Family
  • 45. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Ease of Use Natural naming # access to file:/group1/table table = file.root.group1.table Support for generalized slicing # step means a stride in the slice table[start:stop:step] Support for iterators # get the values in col1 that satisfy the # (1.3 < col3 <= 2.) condition in table col3 = table.cols.col3 [r[ā€™col1ā€™] for r in table.where(1.3 < col3 <= 2.)] Francesc Altet P Y TABLES & Family
  • 46. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Ease of Use Natural naming # access to file:/group1/table table = file.root.group1.table Support for generalized slicing # step means a stride in the slice table[start:stop:step] Support for iterators # get the values in col1 that satisfy the # (1.3 < col3 <= 2.) condition in table col3 = table.cols.col3 [r[ā€™col1ā€™] for r in table.where(1.3 < col3 <= 2.)] Francesc Altet P Y TABLES & Family
  • 47. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 48. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Supported Objects in P Y TABLES Table: Lets you deal with heterogeneous datasets. Chunked. Enlargeable. Support for nested types. Array: Provides quick and dirty array handling. Not chunked. Non enlargeable. CArray: Provides compressed array support. Chunked. Not enlargeable. EArray: Most general array support. Chunked. Enlargeable. VLArray: Collections of homogeneous data with a variable number of entries. Chunked. Enlargeable. Group: The structural component. Francesc Altet P Y TABLES & Family
  • 49. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Whatā€™s New in P Y TABLES 1.2? Added a new cache for the object tree. Allows a contained use of memory (even with huge trees). Almost instantaneous opening of ļ¬les (good news for interactive use!). New NetCDF module (contributed by Jeff Whitaker). Provides API emulation for Scientific.IO.NetCDF. netCDF-3 ā‡” HDF5 conversions. tables.NetCDF datasets can be shared over the internet with the OPeNDAP protocol. Plans to write data natively in netCDF-4 format in the future. Francesc Altet P Y TABLES & Family
  • 50. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Whatā€™s New in P Y TABLES 1.2? Added a new cache for the object tree. Allows a contained use of memory (even with huge trees). Almost instantaneous opening of ļ¬les (good news for interactive use!). New NetCDF module (contributed by Jeff Whitaker). Provides API emulation for Scientific.IO.NetCDF. netCDF-3 ā‡” HDF5 conversions. tables.NetCDF datasets can be shared over the internet with the OPeNDAP protocol. Plans to write data natively in netCDF-4 format in the future. Francesc Altet P Y TABLES & Family
  • 51. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Some Metrics on P Y TABLES 1.2 Core Library ~ 7.5 thousand LOC (Python) ~ 2.8 thousand LOC (Pyrex) ~ 4.0 thousand LOC (C) Test Units ~ 3.1 thousand test units (Python) ~ 23 thousand LOC (Python) Documentation ~ 5.0 thousand lines of on-line doc strings ~ 160 pages of Usersā€™ Guide in PDF (and HTML) Francesc Altet P Y TABLES & Family
  • 52. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 53. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro What is P Y TABLES P RO? Itā€™s just a regular P Y TABLES but with enhanced features: Improved search speed: Selections in tables with > 1 billion rows will be typically done in less than 1 second. Complex queries: Supports an unlimited combination of conditions. Query optimizer: Queries are analyzed, reordered and classiļ¬ed to get an optimum response time. Support for complex indices: Expressions like col1 + col2*col3 + col4**3 can be indexed and used for selections afterwards. Francesc Altet P Y TABLES & Family
  • 54. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Index Selection Speed Francesc Altet P Y TABLES & Family
  • 55. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Index Selection Speed: The Goal Francesc Altet P Y TABLES & Family
  • 56. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Usage Examples P Y TABLES Pro Current Status for P Y TABLES P RO Improving the query response time. Remains to be done: Complex queries. Query optimizer. Date of release: 2nd quarter 2006 (tentative). Francesc Altet P Y TABLES & Family
  • 57. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 58. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use CSTABLES: P Y TABLES Goes Client-Server Francesc Altet P Y TABLES & Family
  • 59. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 60. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Design Goals Concurrency: Allows multiple access to the same ļ¬le at the same time. Locking system: Avoids corruption of data. High Throughput: Data is transmitted in large blocks. High-speed compressor/decompressor used. Client Cache: Metadata is kept in the client-side when an object is ļ¬rst accessed. Full P Y TABLES API compatibility: Existing P Y TABLES programs can be re-used to access remote ļ¬les without changing virtually anything. Francesc Altet P Y TABLES & Family
  • 61. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Concurrency Issues Question: CSTABLES does not provide threading or asynchronous features yet. So, how does it deal with several requests at a time? Answer: Large data read and write requests are split into small chunks. This considerably improves server response time. In addition, CSTABLES provides a lock mechanism that allows applications to explicitly put a lock on a node or on an entire subtree. Different locking access modes: READ, WRITE and ALL Francesc Altet P Y TABLES & Family
  • 62. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Concurrency Issues Question: CSTABLES does not provide threading or asynchronous features yet. So, how does it deal with several requests at a time? Answer: Large data read and write requests are split into small chunks. This considerably improves server response time. In addition, CSTABLES provides a lock mechanism that allows applications to explicitly put a lock on a node or on an entire subtree. Different locking access modes: READ, WRITE and ALL Francesc Altet P Y TABLES & Family
  • 63. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Concurrency Issues Question: CSTABLES does not provide threading or asynchronous features yet. So, how does it deal with several requests at a time? Answer: Large data read and write requests are split into small chunks. This considerably improves server response time. In addition, CSTABLES provides a lock mechanism that allows applications to explicitly put a lock on a node or on an entire subtree. Different locking access modes: READ, WRITE and ALL Francesc Altet P Y TABLES & Family
  • 64. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Client Cache More in Depth CSTABLES caches some of the metadata of the P Y TABLES object tree. When a client makes a change to the metadata, this change is pushed to the other clientsā€™ caches. Easy to control which attributes should be cached and which should not. You should try to cache primarily read-only attributes. Caveat emptor: Caching attributes that are updated very often might generate more trafļ¬c than attributes that are not cached at all! Francesc Altet P Y TABLES & Family
  • 65. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Client Cache More in Depth CSTABLES caches some of the metadata of the P Y TABLES object tree. When a client makes a change to the metadata, this change is pushed to the other clientsā€™ caches. Easy to control which attributes should be cached and which should not. You should try to cache primarily read-only attributes. Caveat emptor: Caching attributes that are updated very often might generate more trafļ¬c than attributes that are not cached at all! Francesc Altet P Y TABLES & Family
  • 66. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Client Cache More in Depth CSTABLES caches some of the metadata of the P Y TABLES object tree. When a client makes a change to the metadata, this change is pushed to the other clientsā€™ caches. Easy to control which attributes should be cached and which should not. You should try to cache primarily read-only attributes. Caveat emptor: Caching attributes that are updated very often might generate more trafļ¬c than attributes that are not cached at all! Francesc Altet P Y TABLES & Family
  • 67. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Client Cache More in Depth CSTABLES caches some of the metadata of the P Y TABLES object tree. When a client makes a change to the metadata, this change is pushed to the other clientsā€™ caches. Easy to control which attributes should be cached and which should not. You should try to cache primarily read-only attributes. Caveat emptor: Caching attributes that are updated very often might generate more trafļ¬c than attributes that are not cached at all! Francesc Altet P Y TABLES & Family
  • 68. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Outline 1 An Introduction to the Python Language Facts about Python Scientiļ¬c Packages An example 2 P Y TABLES Overview Usage Examples P Y TABLES Pro 3 CSTABLES Overview Design goals Examples of Use Francesc Altet P Y TABLES & Family
  • 69. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Two Different APIs P Y TABLES API (preļ¬x with csclient -ip=server_IP) import tables fileh = tables.openFile("file.h5") print fileh.root.table.cols.col1[:] fileh.close() CSTABLES API (no need to be preļ¬xed) from cstables.client import client c=client.Session() app=c.connect("your_FQDN_server") fileh=app.openFile("file.h5") print fileh.root.table.cols.col1[:] fileh.close() Francesc Altet P Y TABLES & Family
  • 70. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use Two Different APIs P Y TABLES API (preļ¬x with csclient -ip=server_IP) import tables fileh = tables.openFile("file.h5") print fileh.root.table.cols.col1[:] fileh.close() CSTABLES API (no need to be preļ¬xed) from cstables.client import client c=client.Session() app=c.connect("your_FQDN_server") fileh=app.openFile("file.h5") print fileh.root.table.cols.col1[:] fileh.close() Francesc Altet P Y TABLES & Family
  • 71. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use CSTABLES Status & Availability The main design features are already implemented and working. Beta available (caveat: only works against P Y TABLES 1.0). Focus now is on checking & debugging possible errors, improving the throughput and bettering the Usersā€™ Guide. Future directions: threading, asynchronous communications. Francesc Altet P Y TABLES & Family
  • 72. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use The P Y TABLES Suite Is Getting Shape P Y TABLES The basic layer for the other components. P Y TABLES Pro P Y TABLES with a twist: Complex searches and ultra-fast selections in tables. CSTABLES The client-server P Y TABLES. It supports as well generic HDF5 ļ¬les. V I TABLES A data viewer for P Y TABLES (and HDF5) ļ¬les. Francesc Altet P Y TABLES & Family
  • 73. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use The P Y TABLES Suite Is Getting Shape P Y TABLES The basic layer for the other components. P Y TABLES Pro P Y TABLES with a twist: Complex searches and ultra-fast selections in tables. CSTABLES The client-server P Y TABLES. It supports as well generic HDF5 ļ¬les. V I TABLES A data viewer for P Y TABLES (and HDF5) ļ¬les. Francesc Altet P Y TABLES & Family
  • 74. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use The P Y TABLES Suite Is Getting Shape P Y TABLES The basic layer for the other components. P Y TABLES Pro P Y TABLES with a twist: Complex searches and ultra-fast selections in tables. CSTABLES The client-server P Y TABLES. It supports as well generic HDF5 ļ¬les. V I TABLES A data viewer for P Y TABLES (and HDF5) ļ¬les. Francesc Altet P Y TABLES & Family
  • 75. An Introduction to the Python Language P Y TABLES CSTABLES Summary Overview Design goals Examples of Use The P Y TABLES Suite Is Getting Shape P Y TABLES The basic layer for the other components. P Y TABLES Pro P Y TABLES with a twist: Complex searches and ultra-fast selections in tables. CSTABLES The client-server P Y TABLES. It supports as well generic HDF5 ļ¬les. V I TABLES A data viewer for P Y TABLES (and HDF5) ļ¬les. Francesc Altet P Y TABLES & Family
  • 76. An Introduction to the Python Language P Y TABLES CSTABLES Summary Summary Python is a joy for scientiļ¬c computing. Start using it now! The P Y TABLES suite is designed to work with HDF5 ļ¬les in an interactive, efļ¬cient and, most importantly, easy way. Outlook Working hard to release CSTABLES in the ļ¬rst quarter of 2006. P Y TABLES P RO will come later on (~ 2nd quarter of 2006). It would be nice to produce a parallel version of P Y TABLES (long term goal). Francesc Altet P Y TABLES & Family
  • 77. An Introduction to the Python Language P Y TABLES CSTABLES Summary Thank You! Thanks also to: Elena Pourmal, for inviting us to the Workshop. Frank Baker, for being kind. The HDF Group for pushing forward P Y TABLES. Francesc Altet P Y TABLES & Family