3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-27 06:43:40 +01:00
dft_tools/test/pytriqs/parameters/test.py
Olivier Parcollet f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00

40 lines
518 B
Python

import pytriqs.parameters.parameters as P
p = P.Parameters()
p['i'] = 10
p['d'] = 2.3
p['s'] = "my string"
print p
print p['i']
print p['d']
print p['s']
d = { 'a' : 10, 'b' : "good", 'c' : -9.2}
p.update(d)
print p
import numpy as np
a = np.array([[1,2],[3,4]])
p['A'] = a
p['Ad'] = 2.5*a
print " p['A'] = ", p['A']
p['A'][0,0] *=10
print " p['A'] = ", p['A']
print p
p2 = P.Parameters()
p2.update2( a = 4, b= "u")
p['sub'] = p2
p['sub2'] = { 'r' : 1, 'rrr' : 3}
print p['sub']
print p['sub2']
print p