HOTFIX: enable r_start, r_sto, r_step params for t0 and t1
This commit is contained in:
parent
18845b0998
commit
50fb204cb1
2 changed files with 18 additions and 4 deletions
|
|
@ -164,7 +164,8 @@ def read_rwms(path: Path, project: str, dir_in_project: str, param: dict[str, An
|
|||
return rw_dict
|
||||
|
||||
|
||||
def extract_t0(path: Path, project: str, dir_in_project: str, param: dict[str, Any], prefix: str, dtr_read: int, xmin: int, spatial_extent: int, fit_range: int = 5, postfix: str="", names: Optional[list[str]]=None, files: Optional[list[str]]=None) -> dict[str, Any]:
|
||||
def extract_t0(path: Path, project: str, dir_in_project: str, param: dict[str, Any], prefix: str, dtr_read: int, xmin: int, spatial_extent: int, fit_range: int = 5, postfix: str="", names: Optional[list[str]]=None, files: Optional[list[str]]=None,
|
||||
r_start: list[int]=[], r_stop: list[int]=[], r_step:int=1) -> dict[str, Any]:
|
||||
"""
|
||||
Extract t0 measurements from the project.
|
||||
|
||||
|
|
@ -218,6 +219,11 @@ def extract_t0(path: Path, project: str, dir_in_project: str, param: dict[str, A
|
|||
if postfix is not None:
|
||||
kwargs['postfix'] = postfix
|
||||
kwargs['plot_fit'] = False
|
||||
if not r_start == []:
|
||||
kwargs['r_start'] = r_start
|
||||
if not r_stop == []:
|
||||
kwargs['r_stop'] = r_stop
|
||||
kwargs['r_step'] = r_step
|
||||
|
||||
t0 = input.extract_t0(directory,
|
||||
prefix,
|
||||
|
|
@ -238,7 +244,8 @@ def extract_t0(path: Path, project: str, dir_in_project: str, param: dict[str, A
|
|||
return t0_dict
|
||||
|
||||
|
||||
def extract_t1(path: Path, project: str, dir_in_project: str, param: dict[str, Any], prefix: str, dtr_read: int, xmin: int, spatial_extent: int, fit_range: int = 5, postfix: str = "", names: Optional[list[str]]=None, files: Optional[list[str]]=None) -> dict[str, Any]:
|
||||
def extract_t1(path: Path, project: str, dir_in_project: str, param: dict[str, Any], prefix: str, dtr_read: int, xmin: int, spatial_extent: int, fit_range: int = 5, postfix: str = "", names: Optional[list[str]]=None, files: Optional[list[str]]=None,
|
||||
r_start: list[int]=[], r_stop: list[int]=[], r_step:int=1) -> dict[str, Any]:
|
||||
"""
|
||||
Extract t1 measurements from the project.
|
||||
|
||||
|
|
@ -290,6 +297,11 @@ def extract_t1(path: Path, project: str, dir_in_project: str, param: dict[str, A
|
|||
if postfix is not None:
|
||||
kwargs['postfix'] = postfix
|
||||
kwargs['plot_fit'] = False
|
||||
if not r_start == []:
|
||||
kwargs['r_start'] = r_start
|
||||
if not r_stop == []:
|
||||
kwargs['r_stop'] = r_stop
|
||||
kwargs['r_step'] = r_step
|
||||
t0 = input.extract_t0(directory,
|
||||
prefix,
|
||||
dtr_read,
|
||||
|
|
|
|||
|
|
@ -230,13 +230,15 @@ def import_toml(path: Path, file: str, copy_file: bool=True) -> None:
|
|||
param[rwp] = "Unknown"
|
||||
param['type'] = 't0'
|
||||
measurement = openQCD.extract_t0(path, uuid, md['path'], param, str(md["prefix"]), int(md["dtr_read"]), int(md["xmin"]), int(md["spatial_extent"]),
|
||||
fit_range=int(md.get('fit_range', 5)), postfix=str(md.get('postfix', '')), names=md.get('names', []), files=md.get('files', []))
|
||||
fit_range=int(md.get('fit_range', 5)), postfix=str(md.get('postfix', '')), names=md.get('names', []), files=md.get('files', []),
|
||||
r_start=md.get('r_start', []), r_stop=md.get('r_stop', []), r_step=md.get('r_step', 1))
|
||||
elif md['measurement'] == 't1':
|
||||
if 'param_file' in md:
|
||||
param = openQCD.load_ms3_infile(path, uuid, md['param_file'])
|
||||
param['type'] = 't1'
|
||||
measurement = openQCD.extract_t1(path, uuid, md['path'], param, str(md["prefix"]), int(md["dtr_read"]), int(md["xmin"]), int(md["spatial_extent"]),
|
||||
fit_range=int(md.get('fit_range', 5)), postfix=str(md.get('postfix', '')), names=md.get('names', []), files=md.get('files', []))
|
||||
fit_range=int(md.get('fit_range', 5)), postfix=str(md.get('postfix', '')), names=md.get('names', []), files=md.get('files', []),
|
||||
r_start=md.get('r_start', []), r_stop=md.get('r_stop', []), r_step=md.get('r_step', 1))
|
||||
write_measurement(path, ensemble, measurement, uuid, project['code'], (md['param_file'] if 'param_file' in md else None))
|
||||
imeas += 1
|
||||
print(mname + " imported.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue