From f68c92de7b836a7580d8c610b231fb7eaefb60e7 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 27 Jul 2022 10:28:47 +0100 Subject: [PATCH 1/2] lisa.monad: Fix module docstring FIX Fixes example in module docstring to match the current state of the code. --- lisa/monad.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisa/monad.py b/lisa/monad.py index f84e2d6bd..9b95290b2 100644 --- a/lisa/monad.py +++ b/lisa/monad.py @@ -23,8 +23,9 @@ All monads share the following API:: # for a given monad Monad # Turns a regular function into a function returning an instance of Monad, - # and able to consume monadic values. Similar to liftM in Haskell. - @Monad.lift + # and able to await on monadic values. Similar to the "do notation" in + # Haskell. + @Monad.do async def foo(x, y): # Inside a decorated function, await can be used to "extract" the value # contained in the monad, like ``<-`` in Haskell. @@ -32,7 +33,7 @@ All monads share the following API:: return x # Equivalent to - @Monad.lift + @Monad.do async def foo(x, y): # note: await is used automatically if x is an instance of Monad x_ = await x @@ -40,7 +41,7 @@ All monads share the following API:: # Monad.pure() is called if x_ is not an instance of Monad return Monad.pure(x_) -This allow composing lifted functions easily +This allow composing decorated functions easily .. note:: There currently is no overridable ``bind`` operation, since nothing in Python currently allows getting a proper continuation without explicit -- GitLab From dff03f749bfce13a910cd7dbeb4ce6e429c8e729 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 27 Jul 2022 10:29:49 +0100 Subject: [PATCH 2/2] lisa.datautils: Fix :type ...: in docstrings FIX Apply :type: role on the correct parameter. --- lisa/datautils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisa/datautils.py b/lisa/datautils.py index 808669898..8804109d0 100644 --- a/lisa/datautils.py +++ b/lisa/datautils.py @@ -547,7 +547,7 @@ def series_derivate(y, x=None, order=1): :param x: Series with the `x` data. If ``None``, the index of `y` will be used. Note that `y` and `x` are expected to have the same index. - :type y: pandas.DataFrame or None + :type x: pandas.DataFrame or None :param order: Order of the derivative (1 is speed, 2 is acceleration etc). :type order: int @@ -573,7 +573,7 @@ def series_integrate(y, x=None, sign=None, method='rect', rect_step='post'): :param x: Series with the `x` data. If ``None``, the index of `y` will be used. Note that `y` and `x` are expected to have the same index. - :type y: pandas.DataFrame or None + :type x: pandas.DataFrame or None :param sign: Clip the data for the area in positive or negative regions. Can be any of: @@ -691,7 +691,7 @@ def series_mean(y, x=None, **kwargs): :param x: Series with the `x` data. If ``None``, the index of `y` will be used. Note that `y` and `x` are expected to have the same index. - :type y: pandas.DataFrame or None + :type x: pandas.DataFrame or None :Variable keyword arguments: Forwarded to :func:`series_integrate`. """ -- GitLab