10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-26 15:12:14 +02:00

Input need a default, not output !

This commit is contained in:
Thomas Applencourt 2015-03-27 16:56:35 +01:00
parent 5f84af566c
commit b281ab1248
3 changed files with 26 additions and 18 deletions

View File

@ -16,7 +16,7 @@ Format specification :
- ezfio_name : Will be the name of the file for the ezfio
(optional by default is the name of the provider)
- interface : The provider is a imput or a output
- default : The default value if interface == output:
- default : The default value if interface == input:
- size : Is the string read in ezfio.cgf who containt the size information
(like 1 or =sum(ao_num) or (ao_num,3) )
@ -26,7 +26,7 @@ Example EZFIO.cfg:
doc: Threshold on the convergence of the Hartree Fock energy
type: Threshold
default: 1.e-10
interface: output
interface: input
default: 10000
size : ao_num, 3
@ -34,7 +34,7 @@ size : ao_num, 3
type: logical
doc: If true, compute the PT2 at the end of the selection
default: true
interface: input
interface: output
size : 1
```
@ -237,7 +237,7 @@ def get_dict_config_file(config_file_path, module_lower):
d[pvd][option] = d_default[option]
# If interface is output we need a default value information
if d[pvd]["interface"] == "output":
if d[pvd]["interface"] == "input":
try:
default_raw = config_file.get(section, "default")
except ConfigParser.NoOptionError:
@ -416,9 +416,15 @@ def save_ezfio_config(module_lower, str_ezfio_config):
def create_ocaml_input(dict_ezfio_cfg):
l_provider = [k for k, v in dict_ezfio_cfg.iteritems() if 'default' in v]
l_type = [v["type"] for k, v in dict_ezfio_cfg.iteritems() if 'default' in v]
l_doc = [v["doc"] for k, v in dict_ezfio_cfg.iteritems() if 'default' in v]
l_provider = []
l_type = []
l_doc = []
for k, v in dict_ezfio_cfg.iteritems():
if v['interface'] == "output":
l_provider.append(k)
l_type.append(v["type"])
l_doc.append(v["doc"])
# ~#~#~#~#~#~#~#~# #
# C r e a t i o n #
@ -514,6 +520,7 @@ def save_ocaml_input(module_lower, str_ocaml_input):
with open(path, "w") as f:
f.write(str_ocaml_input)
def main():
"""
Two condition:

View File

@ -148,7 +148,8 @@ class EZFIO_ocaml(object):
"let read() = ",
" Some",
" {"]
l_template += [" {0:<30} = read_{0} ();".format(p) for p in l_provider]
l_template += [" {0:<30} = read_{0} ();".format(p)
for p in l_provider]
l_template += [" }",
";;"]
@ -161,8 +162,8 @@ class EZFIO_ocaml(object):
@staticmethod
def create_write_global(l_provider):
l_template = ["(* Write all *)",
"let write{ "]
l_template = ["(* Write all *)",
"let write{ "]
l_template += [" {0};".format(p) for p in l_provider]
l_template += [" } ="]
l_template += [" write_{0:<30} {0};".format(p) for p in l_provider]
@ -180,7 +181,7 @@ class EZFIO_ocaml(object):
'let to_string b =',
' Printf.sprintf "']
l_template += ["{0} = %s".format(p) for p in l_provider]
l_template += ["{0} = %s".format(p) for p in l_provider]
l_template += ['"']
for p, t in zip(l_provider, l_type):

View File

@ -1,42 +1,42 @@
[N_det_max_fci]
type: Det_number_max
doc: Max number of determinants in the wave function
interface: output
interface: input
default: 10000
[N_det_max_fci_property]
type: Det_number_max
doc: Max number of determinants in the wave function when you select for a given property
interface: output
interface: input
default: 10000
[do_pt2_end]
type: logical
doc: If true, compute the PT2 at the end of the selection
interface: output
interface: input
default: true
[PT2_max]
type: PT2_energy
doc: The selection process stops when the largest PT2 (for all the state) is lower
than pt2_max in absolute value
interface: output
interface: input
default: 0.0001
[var_pt2_ratio]
type: Normalized_float
doc: The selection process stops when the energy ratio variational/(variational+PT2)
is equal to var_pt2_ratio
interface: output
interface: input
default: 0.75
[energy]
type: double precision
doc: "Calculated Full CI energy"
interface: input
interface: output
[energy_pt2]
type: double precision
doc: "Calculated Full CI energy"
interface: input
interface: output