WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 2d0a9f5

Browse files
authored
Merge pull request #802 from alan-turing-institute/update_hm_tutorials
Set log level in HM tutorials
2 parents fac29c3 + 638512b commit 2d0a9f5

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

autoemulate/core/logging_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def configure_logging(log_to_file=False, level: str = "INFO"):
1414
If True, logs will be written to a file.
1515
If a string, logs will be written to the specified file.
1616
verbose: str, optional
17-
The verbosity level. Can be "error", "warning",
17+
The verbosity level. Can be "critical", "error", "warning",
1818
"info", or "debug". Defaults to "info".
1919
"""
2020
logger = logging.getLogger("autoemulate")
@@ -32,8 +32,10 @@ def configure_logging(log_to_file=False, level: str = "INFO"):
3232
console_log_level = logging.INFO
3333
case "debug":
3434
console_log_level = logging.DEBUG
35+
case "critical":
36+
console_log_level = logging.CRITICAL
3537
case _:
36-
msg = 'verbose must be "error", "warning", "info", or "debug"'
38+
msg = 'verbose must be "critical", "error", "warning", "info", or "debug"'
3739
raise ValueError(msg)
3840

3941
# Create console handler with a higher log level

docs/tutorials/simulator/03_history_matching.ipynb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
"random_seed = 42"
2525
]
2626
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": null,
30+
"metadata": {},
31+
"outputs": [],
32+
"source": [
33+
"import logging\n",
34+
"\n",
35+
"logging.getLogger(\"autoemulate\").setLevel(logging.ERROR)\n",
36+
"logging.getLogger().setLevel(logging.ERROR)"
37+
]
38+
},
2739
{
2840
"cell_type": "markdown",
2941
"metadata": {},

docs/tutorials/tasks/02_history_matching.ipynb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
"from autoemulate.calibration.history_matching import HistoryMatching"
1717
]
1818
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": null,
22+
"metadata": {},
23+
"outputs": [],
24+
"source": [
25+
"import logging\n",
26+
"\n",
27+
"logging.getLogger(\"autoemulate\").setLevel(logging.ERROR)\n",
28+
"logging.getLogger().setLevel(logging.ERROR)"
29+
]
30+
},
1931
{
2032
"cell_type": "markdown",
2133
"metadata": {},

0 commit comments

Comments
 (0)