-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
53 lines (35 loc) · 934 Bytes
/
Copy pathconfig.py
File metadata and controls
53 lines (35 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""Configurations.
Usage:
>>> from src import config
"""
# ruff: noqa: F401
# %%
# Imports
import logging
import os
from src.constants import CB_PALETTE, CBB_PALETTE, DATA_DIR, PROJ_ROOT, RES_DIR
# %%
# Logging
logging.basicConfig(
format="{asctime} - {levelname} - {name} - {message}",
style="{",
datefmt="%Y-%m-%d %H:%M:%S",
)
# The global config should not be redefine
# The config can still be overridden in custom loggers
logging.captureWarnings(True)
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.info("PROJ_ROOT path is: %s", PROJ_ROOT)
# %%
# Plotting defaults
try:
from plotnine import theme_bw, theme_set # type: ignore
theme_set(theme_bw(base_size=15))
except ModuleNotFoundError:
pass
if os.getenv("MATPLOTLIBRC") is None:
os.environ["MATPLOTLIBRC"] = str(PROJ_ROOT / "matplotlibrc")
# %%
logger.info("All configurations have been set.")
# %%