Closed khaeru closed 9 months ago
Thanks @khaeru, but these warnings should have been fixed already by #777 - can you confirm?
Great, thanks! I will try to check against main
in the next day or two.
Note that there seems to be at least one non-trivial bug with the combination of pandas 2.1 and pyam 1.9:
import pandas as pd
import pyam
test_df = (
pd.DataFrame(
dict(
model="any",
scenario="any",
region=["AUS", "USA"],
variable="any",
unit="any",
year=2000,
value=50,
)
)
.set_index(["model", "scenario", "region", "variable", "unit", "year"])
.value.unstack("year")
)
pyam.IamDataFrame(test_df.iloc[[0]]).region
/Users/coroa/repos/pyam/pyam/core.py:2691: FutureWarning: unique with argument that is not not a Series, Index, ExtensionArray, or np.ndarray is deprecated and will raise in a future version.
index = pd.unique(index)
will result in ["AUS", "USA"]
as regions rather than only ["AUS"]
since we only included the first line.
It is fixed on the main branch/the release candidate.
test_df
looks like:
year 2000
model scenario region variable unit
any any AUS any any 50
USA any any 50
Re @coroa, indeed, that was noted and fixed in #763 (and a test added to guard against regression) - but there isn't really anything we can do about past releases...
Closing this issue, please reopen if you encounter any unfixed future-warnings.
Using pyam-iamc v1.9.0 with pandas 2.1.0 appears (initially) to work alright, at least for the subset of functionality used in iiasa/message_data.
However, there are (many) FutureWarnings emitted. Here are the ones I've observed:
Again, AFAICT there's no bug, and we will use
filterwarnings()
for now. This issue is just to track when those filters can be removed.