Skip to content

Commit

Permalink
Bump ixmp4-dependency to latest version (IAMconsortium#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann authored Jun 14, 2024
1 parent 779767f commit f2af05a
Show file tree
Hide file tree
Showing 7 changed files with 1,380 additions and 882 deletions.
2,199 changes: 1,346 additions & 853 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions pyam/_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# being a bit too dynamic
import warnings

import matplotlib.cm as cm
import matplotlib.colors
import numpy as np
import pandas.core.common as com
Expand All @@ -22,7 +21,7 @@ def _get_standard_colors( # noqa: C901
if color is None and colormap is not None:
if isinstance(colormap, str):
cmap = colormap
colormap = cm.get_cmap(colormap)
colormap = plt.get_cmap(colormap)
if colormap is None:
raise ValueError(f"Colormap {cmap} is not recognized")
colors = [colormap(num) for num in np.linspace(0, 1, num=num_colors)]
Expand Down
2 changes: 1 addition & 1 deletion pyam/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ def downscale_region(
rows = weight.index.isin(subregions, level="region")
else:
rows = ~weight.index.isin([region], level="region")
_proxy = weight[rows].stack()
_proxy = weight[rows].stack(future_stack=True)
else:
raise ValueError("Either a 'proxy' or 'weight' argument is required!")

Expand Down
43 changes: 22 additions & 21 deletions pyam/logging.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"version": 1,
"disable_existing_loggers": false,
"formatters": {
"generic": {
"format": "[%(levelname)s] %(asctime)s - %(name)s: %(message)s",
"datefmt": "%H:%M:%S"
}
},
"loggers": {
"pyam": {
"level": "INFO",
"handlers": ["console"]
}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "NOTSET",
"formatter": "generic"
}
"version": 1,
"disable_existing_loggers": false,
"formatters": {
"generic": {
"format": "[%(levelname)s] %(asctime)s - %(name)s: %(message)s",
"datefmt": "%H:%M:%S"
}
},
"loggers": {
"pyam": {
"level": "INFO",
"handlers": [
"console"
]
}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "NOTSET",
"formatter": "generic"
}
}
}
7 changes: 6 additions & 1 deletion pyam/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,12 @@ def format_data(df, index, **kwargs): # noqa: C901
df = df.set_index(extra_cols_not_in_index, append=True)

if data_cols:
df = df[data_cols].rename_axis(columns=time_col).stack().rename("value")
df = (
df[data_cols]
.rename_axis(columns=time_col)
.stack(future_stack=True)
.rename("value")
)
else:
df = df["value"]

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ classifiers = [
[tool.poetry.dependencies]
python = ">=3.10, <3.13"
iam-units = ">=2020.4.21"
ixmp4 = ">=0.8.0"
ixmp4 = ">=0.9.0"
matplotlib = ">=3.6.0"
numpy = ">=1.26.0"
openpyxl = ">=3.1.2"
Expand Down