Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
crdanielbusch committed Nov 5, 2024
1 parent dae7ab3 commit 898491b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion primap2/_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _fill_category(
# if there is more than one category on the target side
if len(output_selection[new_dim]) > 1:
new_category = create_category_name(rule)
new_categories = list(da.indexes["category (IPCC2006)"]) + [new_category]
new_categories = [*da.indexes["category (IPCC2006)"], new_category]
da = da.reindex({"category (IPCC2006)": new_categories}, fill_value=np.nan)
new_output_selection = output_selection.copy()
new_output_selection[new_dim] = new_category
Expand Down
2 changes: 1 addition & 1 deletion primap2/tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_convert_BURDI(empty_ds: xr.Dataset):
(result.pr.loc[{"category": "3.C.7"}] == 1.0 * primap2.ureg("Gg CO2 / year")).all().item()
)
# rule 2.E + 2.B -> 2.B
# 2.B is part of PRIMAP categories, but cannot be retrieved from conversion
# 2.E is part of PRIMAP categories, but cannot be retrieved from conversion
assert np.isnan(result.pr.loc[{"category": "2.E"}].values).all()
# cat 14638 in BURDI equals cat M.BIO in IPCC2006_PRIMAP
assert (
Expand Down

0 comments on commit 898491b

Please sign in to comment.