Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bugged raise Error when using multiple covmats #1951

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions n3fit/src/n3fit/backends/keras_backend/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def op_multiply_dim(o_list, **kwargs):
"""
if len(o_list) != 2:
raise ValueError(
"The number of observables is incorrect, operations.py:op_multiply_dim, expected 2, received {0}".format(
"The number of observables is incorrect, operations.py:op_multiply_dim, expected 2, received {}".format(
len(o_list)
)
)
Expand Down Expand Up @@ -309,7 +309,7 @@ def pow(tensor, power):
return tf.pow(tensor, power)


@tf.function(experimental_relax_shapes=True)
@tf.function(reduce_retracing=True)
def op_log(o_tensor, **kwargs):
"""
Computes the logarithm of the input
Expand Down
25 changes: 9 additions & 16 deletions validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 9 15:43:10 2016

@author: Zahari Kassabov
"""
from collections import ChainMap, defaultdict
from collections.abc import Mapping, Sequence
import copy
Expand All @@ -15,6 +9,7 @@
import numbers
import pathlib

from frozendict import frozendict
import pandas as pd

from reportengine import configparser, report
Expand Down Expand Up @@ -45,13 +40,12 @@
)
from validphys.paramfits.config import ParamfitsConfig
from validphys.plotoptions import get_info
from validphys.utils import freeze_args
from frozendict import frozendict
import validphys.scalevariations

from validphys.utils import freeze_args

log = logging.getLogger(__name__)


class Environment(Environment):
"""Container for information to be filled at run time"""

Expand Down Expand Up @@ -717,10 +711,11 @@ def produce_loaded_theory_covmat(
str(output_path / "tables/datacuts_theory_theorycovmatconfig_user_covmat.csv"),
]
paths.remove(str(output_path / "tables" / generic_path))
for f in files:
for path in paths:
if f == path:
raise ValueError("More than one theory_covmat file in folder tables")
if not (use_user_uncertainties and use_scalevar_uncertainties):
for f in files:
for path in paths:
if f == path:
RoyStegeman marked this conversation as resolved.
Show resolved Hide resolved
raise ValueError("More than one theory_covmat file in folder tables")
RoyStegeman marked this conversation as resolved.
Show resolved Hide resolved
theorypath = output_path / "tables" / generic_path
theory_covmat = pd.read_csv(
theorypath, index_col=[0, 1, 2], header=[0, 1, 2], sep="\t|,", engine="python"
Expand Down Expand Up @@ -919,9 +914,7 @@ def produce_combined_shift_and_theory_dataspecs(self, dataspecs):
len_th = len(dataspecs)
for s in matched_datasets:
new_dataspecs.append(ChainMap({"dataspecs": s["dataspecs"][len_th:]}, s))
return {
"dataspecs": {"dataspecs": new_dataspecs, "original": dataspecs },
}
return {"dataspecs": {"dataspecs": new_dataspecs, "original": dataspecs}}

# TODO: Worth it to do some black magic to not pass params explicitly?
# Note that `parse_experiments` doesn't exist yet.
Expand Down