Skip to content

Commit 34da988

Browse files
committed
Remove more forecast features
1 parent de444b6 commit 34da988

5 files changed

Lines changed: 3 additions & 28 deletions

File tree

src/muse/agents/agent.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def __init__(
122122
decision: Callable | None = None,
123123
year: int = 2010,
124124
maturity_threshold: float = 0,
125-
forecast: int = 5,
126125
housekeeping: Callable | None = None,
127126
merge_transform: Callable | None = None,
128127
demand_threshold: float | None = None,
@@ -147,7 +146,6 @@ def __init__(
147146
year: year the agent is created / current year
148147
maturity_threshold: threshold when filtering replacement
149148
technologies with respect to market share
150-
forecast: Number of years the agent will forecast
151149
housekeeping: transform applied to the assets at the start of
152150
iteration. Defaults to doing nothing.
153151
merge_transform: transform merging current and newly invested assets
@@ -181,9 +179,6 @@ def __init__(
181179
""" Current year. Incremented by one every time next is called."""
182180
self.year = year
183181

184-
"""Number of years to look into the future for forecating purposed."""
185-
self.forecast = forecast
186-
187182
"""Search rule(s) determining potential replacement technologies.
188183
189184
This is a string referring to a filter, or a sequence of strings
@@ -245,11 +240,6 @@ def __init__(
245240
"""Threshold below which assets are not added."""
246241
self.asset_threshold = asset_threshold
247242

248-
@property
249-
def forecast_year(self):
250-
"""Year to consider when forecasting."""
251-
return self.year + self.forecast
252-
253243
def asset_housekeeping(self):
254244
"""Reduces memory footprint of assets.
255245

src/muse/outputs/cache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ def extract_agents_internal(
353353
info[aid]["agent"] = agent.name
354354
info[aid]["category"] = agent.category
355355
info[aid]["sector"] = sector_name
356-
info[aid]["dst_region"] = agent.region
357-
info[aid]["year"] = agent.forecast_year
358-
info[aid]["installed"] = agent.year
356+
# info[aid]["dst_region"] = agent.region
357+
# info[aid]["year"] = agent.forecast_year
358+
# info[aid]["installed"] = agent.year
359359

360360
return info
361361

src/muse/sectors/sector.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,6 @@ def __init__(
170170
"""Full supply, consumption and costs data for the most recent year."""
171171
self.output_data: xr.Dataset
172172

173-
@property
174-
def forecast(self):
175-
"""Maximum forecast horizon across agents.
176-
177-
It cannot be lower than 1 year.
178-
"""
179-
forecasts = [getattr(agent, "forecast") for agent in self.agents]
180-
return max(1, max(forecasts))
181-
182173
def next(
183174
self,
184175
mca_market: xr.Dataset,

src/muse/sectors/subsector.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def __init__(
2424
constraints: Callable | None = None,
2525
investment: Callable | None = None,
2626
name: str = "subsector",
27-
forecast: int = 5,
2827
expand_market_prices: bool = False,
2928
timeslice_level: str | None = None,
3029
):
@@ -37,7 +36,6 @@ def __init__(
3736
self.demand_share = demand_share or ds.factory()
3837
self.constraints = constraints or cs.factory()
3938
self.investment = investment or iv.factory()
40-
self.forecast = forecast
4139
self.name = name
4240
self.expand_market_prices = expand_market_prices
4341
self.timeslice_level = timeslice_level
@@ -142,7 +140,6 @@ def factory(
142140
asset_threshold=getattr(settings, "asset_threshold", 1e-12),
143141
# only used by self-investing agents
144142
investment=getattr(settings, "lpsolver", "scipy"),
145-
forecast=getattr(settings, "forecast", 5),
146143
constraints=getattr(settings, "constraints", ()),
147144
timeslice_level=timeslice_level,
148145
)
@@ -181,7 +178,6 @@ def factory(
181178
constraints = cs.factory(getattr(settings, "constraints", None))
182179
# only used by non-self-investing agents
183180
investment = iv.factory(getattr(settings, "lpsolver", "scipy"))
184-
forecast = getattr(settings, "forecast", 5)
185181

186182
expand_market_prices = getattr(settings, "expand_market_prices", None)
187183
if expand_market_prices is None:
@@ -195,7 +191,6 @@ def factory(
195191
demand_share=demand_share,
196192
constraints=constraints,
197193
investment=investment,
198-
forecast=forecast,
199194
name=name,
200195
expand_market_prices=expand_market_prices,
201196
timeslice_level=timeslice_level,

tests/test_outputs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ def test_consolidate_quantity(newcapa_agent, retro_agent):
554554
(*agents[retro_agent.uuid].keys(), "installed", "year", "technology", quantity)
555555
)
556556
assert set(actual.columns) == cols
557-
assert all(actual.year == newcapa_agent.forecast_year)
558557
assert all(actual.installed == newcapa_agent.year)
559558
assert all(
560559
name in (newcapa_agent.name, retro_agent.name) for name in actual.agent.unique()

0 commit comments

Comments
 (0)