Skip to content

Commit

Permalink
Ensure consistent dtypes in tests of yv_ya
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed May 24, 2022
1 parent 921ea78 commit d90a27d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion message_ix/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)

Expand Down
4 changes: 1 addition & 3 deletions message_ix/tests/test_feature_vintage_and_active_years.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit d90a27d

Please sign in to comment.