Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
hammannr authored Dec 11, 2024
2 parents 6df3eb0 + abd4a08 commit 708ad43
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 9 additions & 1 deletion alea/models/blueice_extended_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions alea/submitters/htcondor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 708ad43

Please sign in to comment.