Skip to content

Commit

Permalink
Use pd.Series.iloc[pos] for forward-compatibility (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
quant12345 authored Oct 7, 2024
1 parent e27e90e commit 735c243
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Next release

- [#880](https://github.com/IAMconsortium/pyam/pull/880) Use `pd.Series.iloc[pos]` for forward-compatibility
- [#877](https://github.com/IAMconsortium/pyam/pull/xxx) Support `engine` and other `pd.ExcelFile` keywords.

# Release v2.2.4
Expand Down
4 changes: 2 additions & 2 deletions tests/test_feature_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_aggregate_region_with_negative_weights(simple_df, caplog):

# dropping negative weights works as expected
neg_weights_df = simple_df.copy()
neg_weights_df._data[18] = -6
neg_weights_df._data.iloc[18] = -6
exp = simple_df.filter(variable=v, region="World", year=2010)
assert_iamframe_equal(neg_weights_df.aggregate_region(v, weight=w), exp)

Expand All @@ -338,7 +338,7 @@ def test_aggregate_region_with_negative_weights(simple_df, caplog):

# *not* dropping negative weights works as expected
exp = simple_df.filter(variable=v, region="World")
exp._data[0] = -8
exp._data.iloc[0] = -8
assert_iamframe_equal(
neg_weights_df.aggregate_region(v, weight=w, drop_negative_weights=False), exp
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_load_meta_exclude(test_pd_df):
"""Initializing from xlsx where 'meta' has an exclude columns (pyam < 2.0)"""
obs = IamDataFrame(TEST_DATA_DIR / "exclude_meta_sheet.xlsx")
exp = IamDataFrame(test_pd_df)
exp.exclude[0] = True
exp.exclude.iloc[0] = True
assert_iamframe_equal(obs, exp)


Expand Down

0 comments on commit 735c243

Please sign in to comment.