Skip to content

Commit

Permalink
More fixes for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lumbric committed May 8, 2024
1 parent 09351eb commit 463ef3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}


Expand Down
7 changes: 4 additions & 3 deletions syfop/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,17 @@ 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
on the interval of time stamps.
"""

# 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
Expand Down
13 changes: 7 additions & 6 deletions syfop/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -33,7 +33,7 @@ def const_time_series(
Returns
-------
xr.DataArray
xarray.DataArray
"""
if time_coords is None:
Expand All @@ -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
----------
Expand All @@ -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,
Expand All @@ -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!
Expand Down

0 comments on commit 463ef3a

Please sign in to comment.