diff --git a/.readthedocs.yml b/.readthedocs.yml index d89fbf96f0796e6234c1d360a6dbecdfe86bbbc5..86b9b426e27b0592022c86b9a2c31b7edf803b09 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,7 +9,8 @@ version: 2 sphinx: builder: html configuration: doc/conf.py - # intersphinx is broken for some dependencies like devlib + # Deploy and build the doc no matter what, we are supposed to catch warnings + # in other CIs. fail_on_warning: false @@ -17,9 +18,9 @@ sphinx: formats: [] build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: - python: "3.10" + python: "3.11" apt_packages: - graphviz - plantuml diff --git a/doc/conf.py b/doc/conf.py index c6c000a25248b4584fb772664dbeefff7b72f8ee..c0651371febf0ec530810f51bdccd3f1a3798485 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -430,6 +430,12 @@ ignored_refs = { # that cannot be fixed because of Sphinx limitations and external # constraints on names. r'ITEM_CLS', + + # Python <= 3.8 has a formatting issue in typing.Union[..., None] that + # makes it appear as typing.Union[..., NoneType], leading to a broken + # reference since the intersphinx inventory of the stdlib does not provide + # any link for NoneType. + r'NoneType', } ignored_refs.update( re.escape(f'{x.__module__}.{x.__qualname__}') diff --git a/lisa/notebook.py b/lisa/notebook.py index 396d3a2d2432e3f5a3ccdb779667574d75755eb7..b513bcded61970c46006832e0dfe33fdb2ce28fd 100644 --- a/lisa/notebook.py +++ b/lisa/notebook.py @@ -395,7 +395,7 @@ def plot_signal(series, name=None, interpolation=None, add_markers=True, vdim=No :type add_markers: bool :param vdim: Value axis dimension. - :type vdim: holoviews.Dimension + :type vdim: holoviews.core.dimension.Dimension """ if isinstance(series, pd.DataFrame): try: diff --git a/lisa/stats.py b/lisa/stats.py index 2cdb8d05e12e77573511efd5f223fc1071d1896f..18644863e108c6f4d989381ab94d151cee576ecc 100644 --- a/lisa/stats.py +++ b/lisa/stats.py @@ -211,7 +211,7 @@ class Stats(Loggable): :param stats: Dictionnary of statistical functions to summarize each value group formed by tag columns along the aggregation columns. If ``None`` is given as value, the name will be passed to - :meth:`pandas.core.groupby.GroupBy.agg`. Otherwise, the provided + :meth:`pandas.core.groupby.SeriesGroupBy.agg`. Otherwise, the provided function will be run. .. note:: One set of keys is special: ``'mean'``, ``'std'`` and diff --git a/lisa/utils.py b/lisa/utils.py index 7853e02ffc78288fd67e319b9bf88fdc02ad2b91..96e7f1bfc571b46bf64705469a30b08ff1b0aa3a 100644 --- a/lisa/utils.py +++ b/lisa/utils.py @@ -1857,32 +1857,33 @@ def optional_kwargs(func): above ``@classmethod`` so it can handle it properly. """ - is_cls_method = False + prepare = lambda args: (args, func) + rewrap = functools.wraps(func) + if isinstance(func, classmethod): - f = func.__func__ - is_cls_method = True - if isinstance(func, staticmethod): - f = func.__func__ - else: - f = func + rewrap = lambda f: classmethod( + functools.wraps(func.__func__)(f) + ) + def prepare(args): + cls, *args = args + return (args, func.__get__(None, cls)) - @functools.wraps(f) + elif isinstance(func, staticmethod): + rewrap = lambda f: staticmethod( + functools.wraps(func.__func__)(f) + ) + prepare = lambda args: (args, func.__func__) + + @rewrap def wrapper(*args, **kwargs): - if is_cls_method: - cls, *args = args - _f = f.__get__(None, cls) - else: - _f = f + args, f = prepare(args) if not kwargs and len(args) == 1 and callable(args[0]): - return _f(args[0]) + return f(args[0]) else: if args: raise TypeError(f'Positional parameters are not allowed when applying {f.__qualname__} decorator, please use keyword arguments') - return functools.partial(_f, **kwargs) - - if is_cls_method: - wrapper = classmethod(wrapper) + return functools.partial(f, **kwargs) return wrapper @@ -3935,7 +3936,7 @@ class LazyMapping(Mapping): def mp_spawn_pool(import_main=False, **kwargs): """ - Create a context manager wrapping :class:`multiprocessing.Pool` using the + Create a context manager wrapping :class:`multiprocessing.pool.Pool` using the ``spawn`` method, which is safe even in multithreaded applications. :param import_main: If ``True``, let the spawned process import the @@ -3944,7 +3945,7 @@ def mp_spawn_pool(import_main=False, **kwargs): *lot* of time (actually, unbounded amount of time). :type import_main: bool - :Variable keyword arguments: Forwarded to :meth:`multiprocessing.Pool`. + :Variable keyword arguments: Forwarded to :class:`multiprocessing.pool.Pool`. """ ctx = multiprocessing.get_context(method='spawn') empty_main = nullcontext if import_main else _empty_main diff --git a/lisa/wa.py b/lisa/wa.py index c7d4336a75fc4741d4bdc064319e978a20a9d8cf..ac00e7708ef6713b128064dced08ce2e9510033f 100644 --- a/lisa/wa.py +++ b/lisa/wa.py @@ -284,7 +284,7 @@ class WAOutput(StatsProp, Mapping, Loggable): def outputs(self): """ Dict containing a mapping of 'wa run' names to - :class:`wa.framework.RunOutput` objects. + :class:`RunOutput` objects. """ wa_outputs = list(discover_wa_outputs(self.path)) diff --git a/tools/lisa-doc-build b/tools/lisa-doc-build index 271caa55f105cc3cdfeba22939bde37f4c951d7d..ba795aa6717e97a448f061c514e8fd41181c66c4 100755 --- a/tools/lisa-doc-build +++ b/tools/lisa-doc-build @@ -24,7 +24,7 @@ cd "$LISA_HOME/doc" || exit 1 # Build the main documentation ############################## -make SPHINXOPTS='-n --no-color --keep-going -T -j auto' html || ret=1 +make SPHINXOPTS='-n --no-color -W --keep-going -T -j auto' html || ret=1 echo echo "Building man pages"