From 463ef3aa77d17f49a05e4ddfa0662bbd4faf33ca Mon Sep 17 00:00:00 2001 From: lumbric Date: Wed, 8 May 2024 17:57:24 +0200 Subject: [PATCH] More fixes for documentation --- doc/conf.py | 1 + syfop/node.py | 7 ++++--- syfop/util.py | 13 +++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 54373b0..a00d9a8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -64,6 +64,7 @@ "python": ("https://docs.python.org/3", None), # 'numpy': ('http://docs.scipy.org/doc/numpy/', None), "pandas": ("http://pandas.pydata.org/pandas-docs/dev", None), + "xarray": ("https://docs.xarray.dev/en/latest/", None), } diff --git a/syfop/node.py b/syfop/node.py index a4dfa5e..21cf6ac 100644 --- a/syfop/node.py +++ b/syfop/node.py @@ -329,7 +329,10 @@ class Storage: but it is not forbidden in any way. However, such a case will not be optimal if ``charging_loss>0``. - **Note:** The units of the variables ``size``, ``level``, ``charge`` and ``discharge`` are + Note + ---- + + The units of the variables ``size``, ``level``, ``charge`` and ``discharge`` are given by the unit of the commodity times hours (independently of the interval size between time stamps). This means for a battery, the variables will be given in `MWh` if the unit for 'electricity' is set to `MW`. This means that the values in ``charge`` and ``discharge`` depend @@ -337,8 +340,6 @@ class Storage: """ - # Note: atm this is not implemented as node class. Probably could be done, but might be more - # complicated to be implemented def __init__(self, costs, max_charging_speed, storage_loss, charging_loss): """ Parameters diff --git a/syfop/util.py b/syfop/util.py index f33c84d..47b14b8 100644 --- a/syfop/util.py +++ b/syfop/util.py @@ -12,8 +12,8 @@ def const_time_series( time_coords_num=DEFAULT_NUM_TIME_STEPS, time_coords_year=2020, ): - """Creates a constant time series as DataArray. The time coordinates will be created from - parameters if not given. + """Creates a constant time series as :py:class:`xarray.DataArray`. The time coordinates will be + created from parameters if not given. Parameters ---------- @@ -33,7 +33,7 @@ def const_time_series( Returns ------- - xr.DataArray + xarray.DataArray """ if time_coords is None: @@ -51,7 +51,7 @@ def const_time_series( def timeseries_variable(model, time_coords, name): - """Create a non-negative variable for a ``linopy.Model`` with time coordinates. + """Create a non-negative variable for a :py:class:`linopy.model.Model` with time coordinates. Parameters ---------- @@ -64,8 +64,9 @@ def timeseries_variable(model, time_coords, name): Returns ------- - linopy.Variable + linopy.variables.Variable The created variable. + """ return model.add_variables( name=name, @@ -92,7 +93,7 @@ def random_time_series( Returns ------- - xr.DataArray + xarray.DataArray A random time series between 0 and 1 with given time coordinates. """ # let's make it deterministic, way better for debugging test cases!