Skip to content

Commit 5e2c4f7

Browse files
committed
Add warning about deprecated parameter
1 parent a1ace2d commit 5e2c4f7

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

docs/user-guide/modify-timing-data.ipynb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"source": [
138138
"For the previous examples, we have run the scenario from 2020 to 2050, in 5 year time steps per benchmark year. However, we may want to run a more detailed scenario, with 2 year time steps, and up until the year 2040.\n",
139139
"\n",
140-
"We will make this change by modifying the current model. Firstly, we need to change the first two lines of the `settings.toml` file, as follows:"
140+
"We will make this change by modifying the current model. Firstly, we need to change the time framework defined in `settings.toml` file, as follows:"
141141
]
142142
},
143143
{
@@ -146,16 +146,13 @@
146146
"source": [
147147
"```toml\n",
148148
"time_framework = [2020, 2022, 2024, 2026, 2028, 2030, 2032, 2034, 2036, 2038, 2040]\n",
149-
"foresight = 2\n",
150149
"```"
151150
]
152151
},
153152
{
154153
"cell_type": "markdown",
155154
"metadata": {},
156155
"source": [
157-
"The `time_framework` details each benchmark year in which we run the simulation. The ```foresight``` variable details how much foresight an agent has when making investments. \n",
158-
"\n",
159156
"We also have to modity the `forecast` value for each sector. For example, for the power sector the `sectors.power.subsectors.all` section should now look as follows:\n",
160157
"\n",
161158
"```toml\n",

src/muse/mca.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def factory(cls, settings: str | Path | Mapping | Any) -> MCA:
7676
)
7777

7878
extras = {
79-
"foresight", # legacy
8079
"regions",
8180
"interest_rate",
8281
"log_level",
@@ -92,8 +91,16 @@ def factory(cls, settings: str | Path | Mapping | Any) -> MCA:
9291
for k, v in settings._asdict().items()
9392
if not hasattr(v, "_asdict") and k not in extras
9493
}
95-
if "equilibrium" in global_kw:
96-
global_kw["equilibrium"] = global_kw.pop("equilibrium")
94+
95+
# Legacy: warn user about deprecation of "foresight" parameter (#641)
96+
if "foresight" in global_kw:
97+
msg = (
98+
"The `foresight` parameter has been deprecated. "
99+
"Please remove from your settings file."
100+
)
101+
getLogger(__name__).warning(msg)
102+
global_kw.pop("foresight")
103+
97104
carbon_kw = {
98105
k: v._asdict() if hasattr(v, "_asdict") else v
99106
for k, v in settings.carbon_budget_control._asdict().items()

0 commit comments

Comments
 (0)