-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
58 lines (50 loc) · 1.53 KB
/
Copy pathplot.py
File metadata and controls
58 lines (50 loc) · 1.53 KB
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
54
55
56
57
58
"""
Backward-compatible wrapper for plot.py
This module provides backward compatibility for code using the old import pattern:
from plot import plot_timeseries_grouped
DEPRECATED: This import path is deprecated as of v0.2.0.
As of v0.2.2, plotting functions have been migrated to utils_cmip7.plotting.
New import path (recommended):
from utils_cmip7.plotting import plot_timeseries_grouped
This legacy import path will be removed in v1.0.
"""
import warnings
# Issue deprecation warning on first import
warnings.warn(
"Importing from 'plot' is deprecated as of v0.2.0. "
"Use 'from utils_cmip7.plotting import ...' instead. "
"This legacy import path will be removed in v1.0.",
DeprecationWarning,
stacklevel=2
)
# Import from new package locations (v0.2.2+)
try:
from utils_cmip7.plotting import (
group_vars_by_prefix,
plot_timeseries_grouped,
plot_regional_pie,
plot_pft_timeseries,
plot_regional_pies,
plot_pft_grouped_bars,
)
except ImportError:
# Fallback to legacy file if package not installed
import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
from plot_legacy import (
group_vars_by_prefix,
plot_timeseries_grouped,
plot_regional_pie,
plot_pft_timeseries,
plot_regional_pies,
plot_pft_grouped_bars,
)
__all__ = [
'group_vars_by_prefix',
'plot_timeseries_grouped',
'plot_regional_pie',
'plot_pft_timeseries',
'plot_regional_pies',
'plot_pft_grouped_bars',
]