Skip to content

Commit c6453d7

Browse files
authored
Tidy up the use of interpolation (#642)
* Update settings and documentation * Temporarily suppress test * Revert change to settings * Switch some interp to sel * Interp to sel in factories module * More fixes * Revert some changes * Select technology data for a single year * Update settings and documentation * Revert change to settings * Raise error for unsupported operations with technology and asset * Add doctest to broadcast_techs, make more generic * Fix errors from merge * Fix mistakes from merge * Remove filter_input function * Add back necessary interpolation, update trade model * Reverting change to `examples` * Update interpolation_mode documentation * Add interpolate_capacity function * interpolation_mode parameter for technodata * Add warnign message about Active mode * Improve docstrings * Fix incorrect settings name * Update trade reesults * Update trade results
1 parent bad5a3a commit c6453d7

40 files changed

Lines changed: 207 additions & 236 deletions

File tree

docs/inputs/commodities_io.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,3 @@ The input data has to be provided for the base year. Additional years within the
7979
framework of the overall simulation can be defined. In this case, MUSE would interpolate
8080
the values between the provided periods and assume a constant value afterwards. The additional
8181
years at which input data for input/output commodities, are defined needs to equal for :ref:`inputs-technodata` and :ref:`inputs-technodata-ts`.
82-
83-
Interpolation is activated only if the feature *interpolation_mode = 'Active'* is defined in the TOML file.

docs/inputs/technodata.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,3 @@ The input data has to be provided for the base year. Additional years within the
166166
framework of the overall simulation can be defined. In this case, MUSE would interpolate
167167
the values between the provided periods and assume a constant value afterwards. The additional
168168
years at which input data for techno-data are defined need to equal for :ref:`inputs-iocomms` and :ref:`inputs-technodata-ts`.
169-
170-
Interpolation is activated only if the feature *interpolation_mode = 'Active'* is defined in the TOML file.

docs/inputs/technodata_timeslices.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,3 @@ The input data has to be provided for the base year. Additional years within the
4444
framework of the overall simulation can be defined. In this case, MUSE would interpolate
4545
the values between the provided periods and assume a constant value afterwards. The additional
4646
years at which input data for techno-data timeslices, need to equal those for :ref:`inputs-iocomms` and :ref:`inputs-technodata`.
47-
48-
Interpolation is activated only if the feature *interpolation_mode = 'Active'* is defined in the TOML file.

docs/inputs/toml.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ a whole.
2626
time_framework = [2020, 2025, 2030, 2035, 2040, 2045, 2050]
2727
regions = ["USA"]
2828
interest_rate = 0.1
29-
interpolation_mode = 'Active'
29+
interpolation_mode = 'linear'
3030
log_level = 'info'
3131
3232
equilibrium_variable = 'demand'
@@ -293,8 +293,9 @@ A sector accepts these attributes:
293293
Defaults to "last".
294294

295295
*interpolation*
296-
Interpolation method user when filling in missing values. Available interpolation
297-
methods depend on the underlying `scipy method's kind attribute`_.
296+
Interpolation method used to fill missing years in the *technodata* (defaults to "linear").
297+
Available interpolation methods depend on the underlying `scipy method's kind attribute`_.
298+
Years outside the data range will always be back/forward filled with the closest available data.
298299

299300
.. _scipy method's kind attribute: https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html
300301

docs/tutorial-code/add-agent/1-single-objective/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
time_framework = [2020, 2025, 2030, 2035, 2040, 2045, 2050]
44
regions = ["R1"]
55
interest_rate = 0.1
6-
interpolation_mode = 'Active'
6+
interpolation_mode = 'linear'
77
log_level = 'info'
88
excluded_commodities = ["wind"]
99
# Convergence parameters

docs/tutorial-code/add-agent/2-multiple-objective/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
time_framework = [2020, 2025, 2030, 2035, 2040, 2045, 2050]
44
regions = ["R1"]
55
interest_rate = 0.1
6-
interpolation_mode = 'Active'
6+
interpolation_mode = 'linear'
77
log_level = 'info'
88
excluded_commodities = ["wind"]
99
# Convergence parameters

docs/tutorial-code/add-correlation-demand/1-correlation/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
time_framework = [2020, 2025, 2030, 2035, 2040, 2045, 2050]
44
regions = ["R1"]
55
interest_rate = 0.1
6-
interpolation_mode = 'Active'
6+
interpolation_mode = 'linear'
77
log_level = 'info'
88
excluded_commodities = ["wind"]
99
# Convergence parameters

docs/tutorial-code/add-new-technology/1-introduction/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
time_framework = [2020, 2025, 2030, 2035, 2040, 2045, 2050]
44
regions = ["R1"]
55
interest_rate = 0.1
6-
interpolation_mode = 'Active'
6+
interpolation_mode = 'linear'
77
log_level = 'info'
88
excluded_commodities = ["wind", "solar"]
99
# Convergence parameters

docs/tutorial-code/add-new-technology/2-scenario/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
time_framework = [2020, 2025, 2030, 2035, 2040, 2045, 2050]
44
regions = ["R1"]
55
interest_rate = 0.1
6-
interpolation_mode = 'Active'
6+
interpolation_mode = 'linear'
77
log_level = 'info'
88
excluded_commodities = ["wind", "solar"]
99
# Convergence parameters

docs/tutorial-code/add-region/1-new-region/settings.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
time_framework = [2020, 2025, 2030, 2035, 2040, 2045, 2050]
44
regions = ["R1", "R2"]
55
interest_rate = 0.1
6-
interpolation_mode = 'Active'
6+
interpolation_mode = 'linear'
77
log_level = 'info'
88
excluded_commodities = ["wind"]
99
# Convergence parameters

0 commit comments

Comments
 (0)