import numpy as np
from h5md_module import File, element

N = 32
DT = 0.1

with File('hop.h5', 'w') as f:
    f.fill_h5md('Pierre', 'run.py', 'N/A')

    f.observables = f.require_group('observables')
    v_e = element(f.observables, 'v', store='linear', data=(1,), step=10, step_offset=10, time=5., time_offset=5.)

    f.all = f.particles_group('all')

    f.all.create_box(dimension=3, boundary=['periodic']*3,
                     store='time', shape=(0,)+(3,), maxshape=(None,3), dtype=np.float64)

    pos = np.zeros((N, 3))
    pos_e = element(f.all, 'position', store='time', data=pos, step_from=f.all.box.edges)

    vel = np.random.random(pos.shape)-0.5
    vel_e = element(f.all, 'velocity', store='time', data=vel, time=5.)

    force = np.random.random(pos.shape)-0.5
    force_e = element(f.all, 'force', store='time', data=force, time=True)

    mass = np.ones((N,))*100.0
    element(f.all, 'mass', store='fixed', data=mass)

    record = frozenset([0, 1, 2, 10])
    for step in range(21):
        force = np.random.random(pos.shape)-0.5
        vel += force*DT*0.5/mass.reshape((-1,1))
        pos += vel*DT
        vel += force*DT*0.5/mass.reshape((-1,1))
        if step in record:
            f.all.box.edges.append((1,1,1), step)
            pos_e.append(pos, step)
            vel_e.append(vel, step, step*DT)
            force_e.append(vel, step, step*DT)
        if step%v_e['step'][()] == 0:
            v_e.append(np.random.randint(10))


@@ -83,120 +83,176 @@
 le('
-hop.h5', 'w') as f:%0A    f.fill_h5md('Pierre', 'run.py', 'N/A')%0A%0A    f.observables = f.require_group('observables
+example_for_1.1.h5', 'w',author='Pierre', creator='run.py') as f:%0A%0A    f.observables = f.require_group('observables')%0A    f.connectivity = f.require_group('connectivity
 ')%0A 
@@ -987,24 +987,406 @@
 data=mass)%0A%0A
+    idx_all = np.arange(N)%0A    idx_list = np.random.choice(idx_all, 5)%0A    idx_e = element(f.observables, 'idx_list', store='linear', step=10, data=idx_list)%0A    idx_e.attrs%5B'particles_group'%5D = f.all.ref%0A%0A    pairs = np.random.randint(0, N, (11, 2))%0A    pairs_e = element(f.connectivity, 'random_pairs', store='fixed', data=pairs)%0A    pairs_e.attrs%5B'particles_group'%5D = f.all.ref%0A%0A
     record =
@@ -1598,32 +1598,80 @@
 reshape((-1,1))%0A
+        idx_list = np.random.choice(idx_all, 5)%0A
         if step 
@@ -1942,10 +1942,91 @@
 int(10))
+%0A        if step%25idx_e%5B'step'%5D%5B()%5D == 0:%0A            idx_e.append(idx_list, step)
 %0A%0A

update for File constructor, time storage and connectivity