saddle/saddle — pull request #27 by folone (2013-06-10 12:05:18+00:00)
Title: A very basic heterogeneous data support for saddle-hdf5

I've added a very basic support for writing/reading of `Frame`s with heteroneous column types. After studying some `.h5` files, I came to a conclusion (possibly incorrect) that pandas write doubles to block0 space, integers -- to block1 space, and strings -- to block2 space.
```scala
[saddle-hdf5]$ console
[warn] Credentials file /home/folone/.ivy2/.credentials does not exist
[warn] Credentials file /home/folone/.ivy2/.credentials does not exist
[info] Compiling 1 Scala source to /home/folone/workspace/saddle/saddle-hdf5/target/scala-2.9.2/classes...
[info] Starting scala interpreter...
[info]
import org.joda.time.DateTime
import org.saddle._
import org.saddle.time._
import org.saddle.io._
Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val fid1 = H5Store.createFile("/home/folone/workspace/ad-ngrams/test.h5")
fid1: Int = 16777216

scala> val strVec = Vec("string", "another string", "unrelated")
strVec: org.saddle.Vec[java.lang.String] =
[3 x 1]
string
another string
unrelated

scala> val intVec = vec.randi(3)
intVec: org.saddle.Vec[Int] =
[3 x 1]
-513254264
-1957777871
644849453

scala> val df = Panel(strVec, intVec)
df: org.saddle.Frame[Int,Int,Any] =
[3 x 2]
0 1
-------------- -----------
0 -> string -513254264
1 -> another string -1957777871
2 -> unrelated 644849453

scala> H5Store.writeFrame(fid1, "test", df)

scala> H5Store.readFrame[Int, Int, Any](fid1, "test")
res1: org.saddle.Frame[Int,Int,Any] =
[3 x 2]
0 1
-------------- -----------
0 -> string -513254264
1 -> another string -1957777871
2 -> unrelated 644849453

scala> res1 == df
res2: Boolean = true

scala> H5Store.closeFile(fid1)

scala> :q
```