Commits

Anonymous committed 69b7456

fix readme

  • Participants
  • Parent commits 9be894a

Comments (0)

Files changed (1)

 Example
 -------
 
-#. Hello world example::
+#. Hello world example: https://bitbucket.org/binet/go-hdf5/src/tip/cmd/test-go-hdf5/test-go-hdf5.go
 
-   package main
-   
-   import (
-   	// stdlib
-   	"fmt"
-   
-   	// local
-   	"bitbucket.org/binet/go-hdf5/pkg/hdf5"
-   )
-   
-   func main() {
-   	fmt.Println("=== go-hdf5 ===")
-   	m,n,r,err := hdf5.GetLibVersion()
-   	if err != nil {
-   		fmt.Printf("** error ** %s\n", err)
-   		return
-   	}
-   	fmt.Printf("=== version: %d.%d.%d\n", m, n, r)
-   	fmt.Println("=== bye.")
-   }
+#. Writing/reading an ``hdf5`` with compound data: https://bitbucket.org/binet/go-hdf5/src/tip/cmd/test-go-cpxcmpd/test-go-cpxcmpd.go
 
 
-#. Writing/reading an ``hdf5`` with compound data::
+Known problems
+--------------
 
-   package main
-
-   import (
-	"fmt"
-   
-	"bitbucket.org/binet/go-hdf5/pkg/hdf5"
-   )
-
-   const (
-   	FNAME string = "SDScompound.h5"
-	DATASET string = "ArrayOfStructures"
-	MEMBER1 string = "A_name"
-	MEMBER2 string = "B_name"
-	MEMBER3 string = "C_name"
-	LENGTH int = 10
-	RANK int = 1
-   )
-
-   type s1_t struct {
-   	a int
-   	b float32
-   	c float64
-	d [3]int
-	e string
-   }
-
-   type s2_t struct {
-   	c float64
-   	a int
-   }
-
-   func main() {
-
-	// initialize data
-	// s1 := make([]s1_t, LENGTH)
-	// for i:=0; i<LENGTH; i++ {
-	// 	s1[i] = s1_t{a:i, b:float32(i*i), c:1./(float64(i)+1)}
-	// }
-	// fmt.Printf(":: data: %v\n", s1)
-	s1 := [LENGTH]s1_t{}
-	for i:=0; i<LENGTH; i++ {
-		s1[i] = s1_t{
-		a:i, 
-		b:float32(i*i), 
-		c:1./(float64(i)+1), 
-		d:[...]int{i,i*2,i*3},
-		e:fmt.Sprintf("--%d--", i),
-		}
-		//s1[i].d = []float64{float64(i), float64(2*i), 3.*i}}
-	}
-	fmt.Printf(":: data: %v\n", s1)
-	
-	// create data space
-	dims := []int{LENGTH}
-	space,err := hdf5.CreateSimpleDataSpace(dims, nil)
-	if err != nil {
-		panic(err)
-	}
-
-	// create the file
-	f,err := hdf5.CreateFile(FNAME, hdf5.F_ACC_TRUNC)
-	if err != nil {
-		panic(err)
-	}
-	defer f.Close()
-	fmt.Printf(":: file [%s] created (id=%d)\n", FNAME, f.Id())
-
-
-	// create the memory data type
-	var dtype *hdf5.DataType = hdf5.NewDataTypeFromValue(s1[0])
-	if dtype == nil {
-		panic("could not create a dtype")
-	}
-
-	// create the dataset
-	dset,err := f.CreateDataSet(DATASET, dtype, space, hdf5.P_DEFAULT)
-	if err != nil {
-		panic(err)
-	}
-	fmt.Printf(":: dset (id=%d)\n", dset.Id())
-
-	// write data to the dataset
-	fmt.Printf(":: dset.Write...\n")
-	err = dset.Write(s1[:], dtype)
-	if err != nil {
-		panic(err)
-	}
-	fmt.Printf(":: dset.Write... [ok]\n")
-
-	// release resources
-	dset.Close()
-	f.Close()
-
-	// open the file and the dataset
-	f, err = hdf5.OpenFile(FNAME, hdf5.F_ACC_RDONLY)
-	if err != nil {
-		panic(err)
-	}
-	dset,err = f.OpenDataSet(DATASET)
-	if err != nil {
-		panic(err)
-	}
-	
-	// read it back into a new slice
-	s2 := make([]s1_t, LENGTH)
-	dset.Read(s2, dtype)
-
-	// display the fields
-	fmt.Printf(":: data: %v\n", s2)
-
-	// release resources
-	dset.Close()
-	f.Close()
-   }
-
+- the ``h5pt`` packet table interface is broken.