Skip to content

Commit 82168d1

Browse files
committed
Improve docstrings
1 parent 7c2668a commit 82168d1

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/muse/investments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ def cliff_retirement_profile(
201201

202202
# Minimize the number of years needed to represent the profile fully
203203
# This is done by removing the central year of any three repeating years, ensuring
204-
# the removed year can be recovered by linear interpolation.
204+
# the removed year can be recovered by linear interpolation
205+
# (see `interpolate_capacity`).
205206
goodyears = avoid_repetitions(profile.astype(int))
206207
return profile.sel(year=goodyears).astype(bool)
207208

src/muse/utilities.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ def avoid_repetitions(data: xr.DataArray, dim: str = "year") -> xr.DataArray:
393393
It removes the central year of any three consecutive years where all data is
394394
the same. This means the original data can be reobtained via a linear
395395
interpolation or a forward fill.
396+
See :py:func:`muse.utilities.interpolate_capacity`.
396397
397398
The first and last year are always preserved.
398399
"""
@@ -406,8 +407,12 @@ def interpolate_capacity(
406407
) -> xr.DataArray:
407408
"""Interpolates capacity data to the given years.
408409
409-
Capacity between years is interpolated linearly. Capacity beyond the final year is
410-
set to zero.
410+
Capacity between years is interpolated linearly. Capacity outside the range of the
411+
data is set to zero.
412+
413+
Arguments:
414+
data: DataArray containing the capacity data
415+
year: Year or years to interpolate to
411416
"""
412417
return data.interp(
413418
year=year,

0 commit comments

Comments
 (0)