add doc strings, no more tuples

This commit is contained in:
Justus Kuhlmann 2025-03-31 20:12:14 +00:00
parent 88662ddabd
commit 567d6f1153

View file

@ -185,13 +185,24 @@ def _map_params(params, spec_list):
"""
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
new_specs = {}
# quarks
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
new_specs['offset'] = (params['wf_offsets'][int(spec_list[1])])
@ -199,7 +210,7 @@ def _map_params(params, spec_list):
contribs = []
for i, coeff in enumerate(params['wf_coeff'][int(spec_list[2])]):
if not coeff == 0:
contrib = (coeff, params['wf_basis'][i])
contrib = [coeff, params['wf_basis'][i]]
contribs.append(contrib)
new_specs['wf1'] = contribs
@ -208,7 +219,7 @@ def _map_params(params, spec_list):
contribs = []
for i, coeff in enumerate(params['wf_coeff'][int(spec_list[3])]):
if not coeff == 0:
contrib = (coeff, params['wf_basis'][i])
contrib = [coeff, params['wf_basis'][i]]
contribs.append(contrib)
new_specs['wf2'] = contribs
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.
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
-------
dict
sorted_data: dict
The data from the sfcf file.
"""