Skip to content

Commit d0dda7e

Browse files
committed
Fix more future warnings
1 parent 6949d89 commit d0dda7e

4 files changed

Lines changed: 27 additions & 6 deletions

File tree

src/muse/readers/csv.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ def process_technologies(
679679
)
680680

681681
# Merge inputs/outputs with technodata
682-
technodata = technodata.merge(outs).merge(ins)
682+
technodata = technodata.merge(outs, join="outer").merge(ins, join="outer")
683683

684684
# Merge technodata_timeslices if provided. This will prioritise values defined in
685685
# technodata_timeslices, and fallback to the non-timesliced technodata for any
@@ -700,7 +700,9 @@ def process_technologies(
700700
technodata = check_commodities(technodata, fill_missing=False)
701701

702702
# Add info about commodities
703-
technodata = technodata.merge(COMMODITIES.sel(commodity=technodata.commodity))
703+
technodata = technodata.merge(
704+
COMMODITIES.sel(commodity=technodata.commodity), join="outer"
705+
)
704706

705707
# Add commodity usage flags
706708
technodata["comm_usage"] = (

src/muse/readers/toml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ def read_technodata(
624624
# Drop duplicate data vars before merging
625625
common_vars = set(technologies.data_vars) & set(trade_data.data_vars)
626626
technologies = technologies.drop_vars(common_vars)
627-
technologies = technologies.merge(trade_data)
627+
technologies = technologies.merge(trade_data, join="outer")
628628

629629
technologies = technologies.set_index(commodity="commodity") # See PR #638
630630
return technologies

src/muse/utilities.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,12 @@ def operation(x):
151151
# Concatenate assets if a sequence is given
152152
if not isinstance(assets, (xr.Dataset, xr.DataArray)):
153153
assets = xr.concat(
154-
assets, dim=dim, join="outer", coords="different", compat="equals"
154+
assets,
155+
dim=dim,
156+
join="outer",
157+
coords="different",
158+
compat="equals",
159+
data_vars="all",
155160
)
156161
assert isinstance(assets, (xr.Dataset, xr.DataArray))
157162

@@ -372,7 +377,14 @@ def merge_assets(
372377
capa_b_interp = interpolate_capacity(capa_b, year=years)
373378

374379
# Concatenate the two capacity arrays
375-
result = xr.concat((capa_a_interp, capa_b_interp), dim=dimension, join="outer")
380+
result = xr.concat(
381+
(capa_a_interp, capa_b_interp),
382+
dim=dimension,
383+
join="outer",
384+
coords="different",
385+
compat="equals",
386+
data_vars="all",
387+
)
376388

377389
#
378390
forgroup = result.pipe(coords_to_multiindex, dimension=dimension)

tests/test_demand_share.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ def create_regional_market(technologies, stock):
9898
usa_market = _matching_market(
9999
broadcast_over_assets(technologies, usa_stock), usa_stock.capacity
100100
)
101-
market = xr.concat((asia_market, usa_market), dim="region", join="outer")
101+
market = xr.concat(
102+
(asia_market, usa_market),
103+
dim="region",
104+
join="outer",
105+
coords="different",
106+
compat="equals",
107+
data_vars="all",
108+
)
102109
return market, asia_stock, usa_stock
103110

104111

0 commit comments

Comments
 (0)