Skip to content
Merged
Changes from all 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
16 changes: 13 additions & 3 deletions n3fit/src/evolven3fit/evolve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections import defaultdict
import json
import logging
import pathlib
import sys
Expand All @@ -19,7 +20,7 @@

LOGGING_SETTINGS = {
"formatter": logging.Formatter("%(asctime)s %(name)s/%(levelname)s: %(message)s"),
"level": logging.INFO,
"level": logging.DEBUG,
}


Expand Down Expand Up @@ -61,8 +62,14 @@ def evolve_fit(
log_file = logging.FileHandler(log_file)
stdout_log = logging.StreamHandler(sys.stdout)
for log in [log_file, stdout_log]:
log.setLevel(LOGGING_SETTINGS["level"])
log.setFormatter(LOGGING_SETTINGS["formatter"])

# The log file will get everything
log_file.setLevel(LOGGING_SETTINGS["level"])
# While the terminal only up to info
stdout_log.setLevel(logging.INFO)


for logger in (_logger, *[logging.getLogger("eko")]):
logger.handlers = []
logger.setLevel(LOGGING_SETTINGS["level"])
Expand All @@ -82,7 +89,7 @@ def evolve_fit(
_logger.info(f"Loading eko from theory {theoryID}")
eko_path = (Loader().check_theoryID(theoryID).path) / "eko.tar"
except FileNotFoundError:
_logger.info(f"eko not found in theory {theoryID}, we will construct it")
_logger.warning(f"eko not found in theory {theoryID}, we will construct it")
theory, op = eko_utils.construct_eko_cards(
theoryID, q_fin, q_points, x_grid, op_card_dict, theory_card_dict
)
Expand All @@ -97,6 +104,9 @@ def evolve_fit(
# Read the cards directly from the eko to make sure they are consistent
theory = eko_op.theory_card
op = eko_op.operator_card
# And dump them to the log
_logger.debug(f"Theory card: {json.dumps(theory.raw)}")
_logger.debug(f"Operator card: {json.dumps(op.raw)}")

# Modify the info file with the fit-specific info
info = info_file.build(theory, op, 1, info_update={})
Expand Down