Skip to content

Commit eea9340

Browse files
committed
Remove Python 3.8 compat in .macro.extrapolate()
- This version of Python is no longer supported. - Satisfy mypy with pandas-stubs 2.3.0.
1 parent 99514bf commit eea9340

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

message_ix/macro.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ def extrapolate(
262262
The index does *not* have a ``year`` dimension; the data are implicitly for
263263
`ym1`.
264264
"""
265-
from sys import version_info
266-
267265
from scipy.optimize import curve_fit
268266

269267
def f(x, b, m):
@@ -278,11 +276,8 @@ def fitted_intercept(df: pd.DataFrame) -> float:
278276

279277
# Apply fitted_intercept to grouped data
280278
groupby_cols = set(model_data.columns) - {"year", "value"}
281-
apply_kwargs = {"include_groups": False} if version_info.minor > 8 else {}
282279
result = (
283-
model_data.groupby(list(groupby_cols))
284-
.apply(fitted_intercept, **apply_kwargs)
285-
.rename("value")
280+
model_data.groupby(list(groupby_cols)).apply(fitted_intercept).rename("value")
286281
)
287282

288283
# Convert "commodity" and "level" to "sector"

0 commit comments

Comments
 (0)