diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3211196..a67f09f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: language_version: python3.9 - repo: https://github.com/pycqa/docformatter - rev: v1.7.5 + rev: master hooks: - id: docformatter additional_dependencies: [tomli] diff --git a/alea/examples/configs/unbinned_wimp_statistical_model_index_fitting.yaml b/alea/examples/configs/unbinned_wimp_statistical_model_index_fitting.yaml index 96a6979..769bdc0 100644 --- a/alea/examples/configs/unbinned_wimp_statistical_model_index_fitting.yaml +++ b/alea/examples/configs/unbinned_wimp_statistical_model_index_fitting.yaml @@ -54,6 +54,7 @@ likelihood_config: - name: science_run default_source_class: alea.template_source.TemplateSource likelihood_type: blueice.likelihood.UnbinnedLogLikelihood + source_wise_interpolation: false likelihood_config: {"morpher": "IndexMorpher"} analysis_space: - cs1: np.arange(0, 102, 2) diff --git a/alea/models/blueice_extended_model.py b/alea/models/blueice_extended_model.py index ff36c03..e550863 100644 --- a/alea/models/blueice_extended_model.py +++ b/alea/models/blueice_extended_model.py @@ -4,6 +4,7 @@ import itertools from copy import deepcopy +from tqdm import tqdm import numpy as np import scipy.stats as stats from blueice.likelihood import LogAncillaryLikelihood, LogLikelihoodSum @@ -295,9 +296,16 @@ def _process_blueice_config(self, config, template_folder_list): # get blueice likelihood_config if it's given likelihood_config = config.get("likelihood_config", None) + source_wise_interpolation = config.get("source_wise_interpolation", True) + + if source_wise_interpolation and likelihood_config: + if likelihood_config.get("morpher") == "IndexMorpher": + raise ValueError("Source-wise interpolation is not yet supported for IndexMorpher.") + blueice_config = { "pdf_base_config": pdf_base_config, "likelihood_config": likelihood_config, + "source_wise_interpolation": source_wise_interpolation, } return blueice_config @@ -399,7 +407,7 @@ def _build_data_generators(self) -> list: """ # last one is AncillaryLikelihood data_generators = [] - for ll_term in self.likelihood_list[:-1]: + for ll_term in tqdm(self.likelihood_list[:-1], desc="building data generators"): methods = [s.config["pdf_interpolation_method"] for s in ll_term.base_model.sources] # make sure that all sources have the same pdf_interpolation_method if len(set(methods)) != 1: diff --git a/alea/submitters/htcondor.py b/alea/submitters/htcondor.py index 68fd816..4511faf 100644 --- a/alea/submitters/htcondor.py +++ b/alea/submitters/htcondor.py @@ -407,8 +407,8 @@ def make_tarballs(self): logger.warning( f"Using tarball of user installed package {package_name} at {tarball_path}." ) - tarballs.append(tarball) - tarball_paths.append(tarball_path) + tarballs.append(tarball) + tarball_paths.append(tarball_path) return tarballs, tarball_paths def _initialize_job( diff --git a/pyproject.toml b/pyproject.toml index 7e7a1e1..9c9407c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ alea_submission = "alea.scripts.alea_submission:main" [tool.poetry.dependencies] python = ">=3.8,<3.13" atomicwrites = "*" -blueice = "*" +blueice = ">=1.2.1" h5py = "*" inference-interface = "*" iminuit = ">=2.21.0"