Skip to content
Snippets Groups Projects
Commit a8862713 authored by David Fairbrother's avatar David Fairbrother
Browse files

Re #19574 Resolved caching breaking spline names on PEARL

parent 2db9f665
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,8 @@ class Pearl(AbstractInst):
def _get_run_details(self, run_number_string):
run_number_string_key = self._generate_run_details_fingerprint(run_number_string,
self._inst_settings.file_extension)
self._inst_settings.file_extension,
self._inst_settings.tt_mode)
if run_number_string_key in self._cached_run_details:
return self._cached_run_details[run_number_string_key]
......
......@@ -68,16 +68,16 @@ def generate_vanadium_absorb_corrections(van_ws):
def get_run_details(run_number_string, inst_settings, is_vanadium_run):
splined_name_list = ["_tt-" + inst_settings.tt_mode]
spline_identifier = [inst_settings.tt_mode]
if inst_settings.long_mode:
splined_name_list.append("_long")
spline_identifier.append("_long")
grouping_file_name_callable = CustomFuncForRunDetails().add_to_func_chain(
user_function=_pearl_get_tt_grouping_file_name,
inst_settings=inst_settings)
return create_run_details_object(run_number_string=run_number_string, inst_settings=inst_settings,
is_vanadium_run=is_vanadium_run, splined_name_list=splined_name_list,
is_vanadium_run=is_vanadium_run, splined_name_list=spline_identifier,
grouping_file_name_call=grouping_file_name_callable,
van_abs_file_name=inst_settings.van_absorb_file)
......
......@@ -7,6 +7,19 @@ import os
def create_run_details_object(run_number_string, inst_settings, is_vanadium_run, empty_run_call=None,
grouping_file_name_call=None, vanadium_run_call=None,
splined_name_list=None, van_abs_file_name=None):
"""
Creates and returns a run details object which holds various
properties about the current run.
:param run_number_string: The user string for the current run
:param inst_settings: The current instrument object
:param is_vanadium_run: Boolean of if the current run is a vanadium run
:param empty_run_call: (Optional) Callable to setup custom empty run number(s) from mapping file
:param grouping_file_name_call: (Optional) Callable to setup custom grouping file name
:param vanadium_run_call: (Optional) Callable to setup custom van run number(s) from mapping file
:param splined_name_list: (Optional) List of unique properties to generate a splined vanadium name from
:param van_abs_file_name: (Optional) The name of the vanadium absorption file
:return: RunDetails object with attributes set to applicable values
"""
cal_map_dict = RunDetailsWrappedCommonFuncs.get_cal_mapping_dict(
run_number_string=run_number_string, inst_settings=inst_settings)
run_number = common.get_first_run_number(run_number_string=run_number_string)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment