File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 44
55import logging
66import os
7+ import warnings
8+ import datetime
9+ from pathlib import Path
710
811from matplotlib .colors import LinearSegmentedColormap
912from matplotlib .pyplot import style
1013import matplotlib as mpl
1114from packaging import version
1215
1316
17+ def _warn_once_per_day ():
18+ warning_dir = Path .home () / "arviz_data"
19+ warning_dir .mkdir (exist_ok = True )
20+
21+ stamp_file = warning_dir / "daily_warning"
22+ today = datetime .date .today ()
23+
24+ if stamp_file .exists ():
25+ last_date = datetime .date .fromisoformat (stamp_file .read_text ().strip ())
26+ else :
27+ last_date = None
28+
29+ if last_date != today :
30+ warnings .warn (
31+ "\n ArviZ is undergoing a major refactor to improve flexibility and extensibility "
32+ "while maintaining a user-friendly interface."
33+ "\n Some upcoming changes may be backward incompatible."
34+ "\n For details and migration guidance, visit: "
35+ "https://python.arviz.org/en/latest/user_guide/migration_guide.html" ,
36+ FutureWarning ,
37+ )
38+
39+ stamp_file .write_text (today .isoformat ())
40+
41+
42+ _warn_once_per_day ()
43+
44+
1445class Logger (logging .Logger ):
1546 """Override Logger to avoid repeated messages."""
1647
You can’t perform that action at this time.
0 commit comments