From d90a27db3b309215ddb4b41d2ffeb0de2c1d7f23 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Tue, 24 May 2022 22:10:34 +0200 Subject: [PATCH] Ensure consistent dtypes in tests of yv_ya --- message_ix/core.py | 2 +- message_ix/tests/test_feature_vintage_and_active_years.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/message_ix/core.py b/message_ix/core.py index 9c4a513d5..9d83ad724 100755 --- a/message_ix/core.py +++ b/message_ix/core.py @@ -606,7 +606,7 @@ def years_active(self, node: str, tec: str, yr_vtg: Union[int, str]) -> List[int data.where(data.age.shift(1, fill_value=0) < lt) .where(data.year >= yv)["year"] .dropna() - .astype(int) + .astype(np.int64) .tolist() ) diff --git a/message_ix/tests/test_feature_vintage_and_active_years.py b/message_ix/tests/test_feature_vintage_and_active_years.py index cdf4cfdd4..1a16cf7c7 100644 --- a/message_ix/tests/test_feature_vintage_and_active_years.py +++ b/message_ix/tests/test_feature_vintage_and_active_years.py @@ -130,9 +130,7 @@ def test_vintage_and_active_years1(test_mp): obs = scen.vintage_and_active_years( ya_args=("foo", "bar", years[0]), in_horizon=True ) - assert_frame_equal( - pd.DataFrame(columns=["year_vtg", "year_act"]), obs, check_dtype=False - ) + assert_frame_equal(pd.DataFrame(columns=["year_vtg", "year_act"]), obs) # Exception is raised for incorrect arguments with pytest.raises(ValueError, match=r"got \('foo',\) of length 1"):