add doc strings, no more tuples
This commit is contained in:
parent
88662ddabd
commit
567d6f1153
1 changed files with 32 additions and 4 deletions
|
@ -185,13 +185,24 @@ def _map_params(params, spec_list):
|
||||||
"""
|
"""
|
||||||
Map the extracted parameters to the extracted data.
|
Map the extracted parameters to the extracted data.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
param: dict
|
||||||
|
The parameters extracted from the parameter (input) file. in the dict form given by read_param.
|
||||||
|
spec_list: list
|
||||||
|
The list of specifications that belongs to the dorrelator in question.
|
||||||
|
|
||||||
|
Return
|
||||||
|
------
|
||||||
|
new_specs: dict
|
||||||
|
Dict with keys replaced by parameters.
|
||||||
"""
|
"""
|
||||||
# quarks/offset/wf/wf2
|
# quarks/offset/wf/wf2
|
||||||
new_specs = {}
|
new_specs = {}
|
||||||
# quarks
|
# quarks
|
||||||
quarks = spec_list[0].split(" ")
|
quarks = spec_list[0].split(" ")
|
||||||
|
|
||||||
new_specs['quarks'] = (params['qr'][quarks[0]], params['qr'][quarks[1]])
|
new_specs['quarks'] = [params['qr'][quarks[0]], params['qr'][quarks[1]]]
|
||||||
|
|
||||||
# offset
|
# offset
|
||||||
new_specs['offset'] = (params['wf_offsets'][int(spec_list[1])])
|
new_specs['offset'] = (params['wf_offsets'][int(spec_list[1])])
|
||||||
|
@ -199,7 +210,7 @@ def _map_params(params, spec_list):
|
||||||
contribs = []
|
contribs = []
|
||||||
for i, coeff in enumerate(params['wf_coeff'][int(spec_list[2])]):
|
for i, coeff in enumerate(params['wf_coeff'][int(spec_list[2])]):
|
||||||
if not coeff == 0:
|
if not coeff == 0:
|
||||||
contrib = (coeff, params['wf_basis'][i])
|
contrib = [coeff, params['wf_basis'][i]]
|
||||||
contribs.append(contrib)
|
contribs.append(contrib)
|
||||||
new_specs['wf1'] = contribs
|
new_specs['wf1'] = contribs
|
||||||
|
|
||||||
|
@ -208,7 +219,7 @@ def _map_params(params, spec_list):
|
||||||
contribs = []
|
contribs = []
|
||||||
for i, coeff in enumerate(params['wf_coeff'][int(spec_list[3])]):
|
for i, coeff in enumerate(params['wf_coeff'][int(spec_list[3])]):
|
||||||
if not coeff == 0:
|
if not coeff == 0:
|
||||||
contrib = (coeff, params['wf_basis'][i])
|
contrib = [coeff, params['wf_basis'][i]]
|
||||||
contribs.append(contrib)
|
contribs.append(contrib)
|
||||||
new_specs['wf2'] = contribs
|
new_specs['wf2'] = contribs
|
||||||
return new_specs
|
return new_specs
|
||||||
|
@ -229,9 +240,26 @@ def read_data(path, project, dir_in_project, prefix, param, version='1.0c', cfg_
|
||||||
"""
|
"""
|
||||||
Extract the data from the sfcf file.
|
Extract the data from the sfcf file.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path: str
|
||||||
|
The path of the backlogger.
|
||||||
|
project: str
|
||||||
|
The Projects uuid.
|
||||||
|
dir_in_project:s str
|
||||||
|
The output directory in the project.
|
||||||
|
param: dict
|
||||||
|
The parameter dictionary, as given by read_param.
|
||||||
|
version: str
|
||||||
|
Version of sfcf.
|
||||||
|
cfg_seperator: str
|
||||||
|
Separator of the configuration number. Needed for reading. default: "n"
|
||||||
|
sep: str
|
||||||
|
Seperator for the key in return dict. (default: "/)
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
dict
|
sorted_data: dict
|
||||||
The data from the sfcf file.
|
The data from the sfcf file.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue