Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix FutureWarning: ChainedAssignmentError #900

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

The next release must be bumped to v3.0.0.

- [#900](https://github.com/IAMconsortium/pyam/pull/900) fix ChainedAssignmentError, refactoring
- [#896](https://github.com/IAMconsortium/pyam/pull/896) Add `sort_data()` method
- [#896](https://github.com/IAMconsortium/pyam/pull/896) Sort columns of `timeseries()` with mixed time domain
- [#893](https://github.com/IAMconsortium/pyam/pull/893) No sorting of timeseries data on initialization or append
Expand Down
11 changes: 7 additions & 4 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_line_color_fill_between(plot_df):
@pytest.mark.mpl_image_compare(**MPL_KWARGS)
def test_line_color_fill_between_interpolate(plot_df):
# designed to create the sawtooth behavior at a midpoint with missing data
df = pyam.IamDataFrame(plot_df.data.copy())
df = plot_df.data.copy()
fig, ax = plt.subplots(figsize=(8, 8))
newdata = [
"test_model1",
Expand All @@ -150,7 +150,7 @@ def test_line_color_fill_between_interpolate(plot_df):
2010,
3.50,
]
df.data.loc[len(df.data) - 1] = newdata
df.loc[len(df) - 1] = newdata
newdata = [
"test_model1",
"test_scenario1",
Expand All @@ -160,7 +160,7 @@ def test_line_color_fill_between_interpolate(plot_df):
2012,
3.50,
]
df.data.loc[len(df.data)] = newdata
df.loc[len(df)] = newdata
newdata = [
"test_model1",
"test_scenario1",
Expand All @@ -170,7 +170,10 @@ def test_line_color_fill_between_interpolate(plot_df):
2015,
3.50,
]
df.data.loc[len(df.data) + 1] = newdata
df.loc[len(df) + 1] = newdata
columns_ = ['model', 'scenario', 'region', 'variable', 'unit', 'year']
df = df.drop_duplicates(subset=columns_).reset_index(drop=True)
df = pyam.IamDataFrame(df)
df.plot(ax=ax, color="model", fill_between=True, legend=True)
return fig

Expand Down
Loading