From 62c969d6ad0923de8ee3687471de06c8b1babadd Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 4 May 2021 11:01:41 +0200 Subject: [PATCH] Allow .ccl files in param study Fix #28 --- pyzebra/app/panel_ccl_integrate.py | 6 +++--- pyzebra/app/panel_param_study.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pyzebra/app/panel_ccl_integrate.py b/pyzebra/app/panel_ccl_integrate.py index 3fe0841..0bd548f 100644 --- a/pyzebra/app/panel_ccl_integrate.py +++ b/pyzebra/app/panel_ccl_integrate.py @@ -72,11 +72,11 @@ def create(): proposal = new.strip() year = new[:4] proposal_path = f"/afs/psi.ch/project/sinqdata/{year}/zebra/{proposal}" - ccl_file_list = [] + file_list = [] for file in os.listdir(proposal_path): if file.endswith((".ccl", ".dat")): - ccl_file_list.append((os.path.join(proposal_path, file), file)) - file_select.options = ccl_file_list + file_list.append((os.path.join(proposal_path, file), file)) + file_select.options = file_list proposal_textinput = TextInput(title="Proposal number:", width=210) proposal_textinput.on_change("value", proposal_textinput_callback) diff --git a/pyzebra/app/panel_param_study.py b/pyzebra/app/panel_param_study.py index fbe9737..2826735 100644 --- a/pyzebra/app/panel_param_study.py +++ b/pyzebra/app/panel_param_study.py @@ -81,11 +81,11 @@ def create(): proposal = new.strip() year = new[:4] proposal_path = f"/afs/psi.ch/project/sinqdata/{year}/zebra/{proposal}" - dat_file_list = [] + file_list = [] for file in os.listdir(proposal_path): - if file.endswith(".dat"): - dat_file_list.append((os.path.join(proposal_path, file), file)) - file_select.options = dat_file_list + if file.endswith((".ccl", ".dat")): + file_list.append((os.path.join(proposal_path, file), file)) + file_select.options = file_list proposal_textinput = TextInput(title="Proposal number:", width=210) proposal_textinput.on_change("value", proposal_textinput_callback) @@ -108,7 +108,7 @@ def create(): param_select.value = "user defined" - file_select = MultiSelect(title="Available .dat files:", width=210, height=250) + file_select = MultiSelect(title="Available .ccl/.dat files:", width=210, height=250) def file_open_button_callback(): nonlocal det_data @@ -163,8 +163,8 @@ def create(): _init_datatable() _update_preview() - upload_div = Div(text="or upload new .dat files:", margin=(5, 5, 0, 5)) - upload_button = FileInput(accept=".dat", multiple=True, width=200) + upload_div = Div(text="or upload new .ccl/.dat files:", margin=(5, 5, 0, 5)) + upload_button = FileInput(accept=".ccl,.dat", multiple=True, width=200) upload_button.on_change("value", upload_button_callback) def append_upload_button_callback(_attr, _old, new): @@ -179,7 +179,7 @@ def create(): _init_datatable() append_upload_div = Div(text="append extra files:", margin=(5, 5, 0, 5)) - append_upload_button = FileInput(accept=".dat", multiple=True, width=200) + append_upload_button = FileInput(accept=".ccl,.dat", multiple=True, width=200) append_upload_button.on_change("value", append_upload_button_callback) def monitor_spinner_callback(_attr, _old, new):