def parser_with_cache(): def raise_error(file_location): raise RuntimeError("Cache was not loaded!") mem = memory.Memory(options={"enable cache": True}) mem._read_data = raise_error return mem
def parser_no_cache(): return memory.Memory(enable_cache=False)
def get_interface(self, namespace): return memory.Memory(enable_cache=namespace.disable_cache, clear_cache=namespace.clear_cache)
MONTE_CARLO = os.path.join(os.path.dirname(__file__), "../../../data/shell/data/monte_carlo.csv") # Data with embedded internal names INTERNAL_NAMES = os.path.join(os.path.dirname(__file__), "../../../data/shell/data/internal_names.csv") INTERNAL_NAMES_DICT = { "quality factor": "qf", "binned data": "bn", "event errors": "err", "expected values": "exp" } # Parser PARSER = memory.Memory(False, True) """ Tests with QFactor file """ @pytest.fixture def data_with_qfactor(): loader = loaders.DataLoading(PARSER, DATA, qfactor=QFACTOR, monte_carlo=MONTE_CARLO) return loader def test_qfactor_sum_file(data_with_qfactor):
def __setup_memory_parser(self): self.__parser = memory.Memory( enable_cache=self.__options_object.enable_cache, clear_cache=self.__options_object.clear_cache, user_plugin_dir=self.__options_object.user_plugin)