typing
This commit is contained in:
parent
590988c526
commit
dccce894b9
1 changed files with 10 additions and 9 deletions
|
@ -2,9 +2,10 @@ import pyerrors as pe
|
|||
import datalad.api as dl
|
||||
import json
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
|
||||
bi_corrs = ["f_P", "fP", "f_p",
|
||||
bi_corrs: list = ["f_P", "fP", "f_p",
|
||||
"g_P", "gP", "g_p",
|
||||
"fA0", "f_A", "f_a",
|
||||
"gA0", "g_A", "g_a",
|
||||
|
@ -42,7 +43,7 @@ bi_corrs = ["f_P", "fP", "f_p",
|
|||
"l3A2", "l3_A2", "g_av23",
|
||||
]
|
||||
|
||||
bb_corrs = [
|
||||
bb_corrs: list = [
|
||||
'F1',
|
||||
'F_1',
|
||||
'f_1',
|
||||
|
@ -62,11 +63,11 @@ bb_corrs = [
|
|||
'F_sPdP_d',
|
||||
]
|
||||
|
||||
bib_corrs = [
|
||||
bib_corrs: list = [
|
||||
'F_V0',
|
||||
]
|
||||
|
||||
corr_types = {}
|
||||
corr_types: dict[str, str] = {}
|
||||
|
||||
for c in bi_corrs:
|
||||
corr_types[c] = 'bi'
|
||||
|
@ -76,7 +77,7 @@ for c in bib_corrs:
|
|||
corr_types[c] = 'bib'
|
||||
|
||||
|
||||
def read_param(path, project, file_in_project):
|
||||
def read_param(path: str, project: str, file_in_project: str) -> dict[str, Any]:
|
||||
"""
|
||||
Read the parameters from the sfcf file.
|
||||
|
||||
|
@ -97,7 +98,7 @@ def read_param(path, project, file_in_project):
|
|||
with open(file, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
params = {}
|
||||
params: dict[str, Any] = {}
|
||||
params['wf_offsets'] = []
|
||||
params['wf_basis'] = []
|
||||
params['wf_coeff'] = []
|
||||
|
@ -181,7 +182,7 @@ def read_param(path, project, file_in_project):
|
|||
return params
|
||||
|
||||
|
||||
def _map_params(params, spec_list):
|
||||
def _map_params(params: dict, spec_list: list) -> dict[str, Any]:
|
||||
"""
|
||||
Map the extracted parameters to the extracted data.
|
||||
|
||||
|
@ -236,7 +237,7 @@ def get_specs(key, parameters, sep='/'):
|
|||
return s
|
||||
|
||||
|
||||
def read_data(path, project, dir_in_project, prefix, param, version='1.0c', cfg_seperator='n', sep='/', **kwargs):
|
||||
def read_data(path, project, dir_in_project, prefix, param, version='1.0c', cfg_seperator='n', sep='/', **kwargs) -> dict:
|
||||
"""
|
||||
Extract the data from the sfcf file.
|
||||
|
||||
|
@ -293,7 +294,7 @@ def read_data(path, project, dir_in_project, prefix, param, version='1.0c', cfg_
|
|||
data[key] = data_crs[key]
|
||||
|
||||
# sort data by correlator
|
||||
sorted_data = {}
|
||||
sorted_data: dict[str, dict[str, Any]] = {}
|
||||
for key in data.keys():
|
||||
key_parts = key.split(sep)
|
||||
corr = key_parts[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue