From 10dfc27ea503d241c626fcbb447382bc9ddd08a5 Mon Sep 17 00:00:00 2001 From: Marc Skov Madsen Date: Sun, 8 Dec 2024 06:17:09 +0100 Subject: [PATCH] ruff D200 rule (#983) --- numbergen/__init__.py | 16 ++----- param/_utils.py | 20 +++------ param/ipython.py | 4 +- param/parameterized.py | 68 ++++++++--------------------- param/parameters.py | 44 +++++-------------- param/reactive.py | 64 +++++++-------------------- param/serializer.py | 12 ++--- param/version.py | 4 +- pyproject.toml | 1 - tests/testbooleanparam.py | 4 +- tests/testbytesparam.py | 4 +- tests/testcalendardateparam.py | 4 +- tests/testcalendardaterangeparam.py | 4 +- tests/testclassselector.py | 4 +- tests/testcolorparameter.py | 4 +- tests/testcustomparam.py | 4 +- tests/testdateparam.py | 4 +- tests/testdaterangeparam.py | 4 +- tests/testdefaults.py | 4 +- tests/testdeprecations.py | 8 +--- tests/testfiledeserialization.py | 4 +- tests/testipythonmagic.py | 4 +- tests/testjsonserialization.py | 8 +--- tests/testnumbergen.py | 4 +- tests/testnumberparameter.py | 4 +- tests/testnumpy.py | 4 +- tests/testpandas.py | 4 +- tests/testparamdepends.py | 4 +- tests/testparameterizedobject.py | 4 +- tests/testparameterizedrepr.py | 4 +- tests/testparamoutput.py | 4 +- tests/testparamunion.py | 4 +- tests/testrangeparameter.py | 4 +- tests/teststringparam.py | 4 +- tests/testwatch.py | 4 +- 35 files changed, 86 insertions(+), 259 deletions(-) diff --git a/numbergen/__init__.py b/numbergen/__init__.py index 3d81ad9f3..975a3e716 100644 --- a/numbergen/__init__.py +++ b/numbergen/__init__.py @@ -1,6 +1,4 @@ -""" -Callable objects that generate numbers according to different distributions. -""" +"""Callable objects that generate numbers according to different distributions.""" import random import operator @@ -241,9 +239,7 @@ def _rational(self, val): def __getstate__(self): - """ - Avoid Hashlib.md5 TypeError in deepcopy (hashlib issue) - """ + """Avoid Hashlib.md5 TypeError in deepcopy (hashlib issue)""" d = self.__dict__.copy() d.pop('_digest') d.pop('_hash_struct') @@ -374,9 +370,7 @@ def _initialize_random_state(self, seed=None, shared=True, name=None): def _verify_constrained_hash(self): - """ - Warn if the object name is not explicitly set. - """ + """Warn if the object name is not explicitly set.""" changed_params = self.param.values(onlychanged=True) if self.time_dependent and ('name' not in changed_params): self.param.log(param.WARNING, "Default object name used to set the seed: " @@ -575,9 +569,7 @@ def __call__(self): class ScaledTime(NumberGenerator, TimeDependent): - """ - The current time multiplied by some conversion factor. - """ + """The current time multiplied by some conversion factor.""" factor = param.Number(default=1.0, doc=""" The factor to be multiplied by the current time value.""") diff --git a/param/_utils.py b/param/_utils.py index 0f5cb2925..56aae1374 100644 --- a/param/_utils.py +++ b/param/_utils.py @@ -62,9 +62,7 @@ class ParamFutureWarning(ParamWarning, FutureWarning): """ class Skip(Exception): - """ - Exception that allows skipping an update when resolving a reference. - """ + """Exception that allows skipping an update when resolving a reference.""" def _deprecated(extra_msg="", warning_cat=ParamDeprecationWarning): def decorator(func): @@ -208,9 +206,7 @@ def _is_mutable_container(value): def full_groupby(l, key=lambda x: x): - """ - Groupby implementation which does not require a prior sort - """ + """Groupby implementation which does not require a prior sort""" d = defaultdict(list) for item in l: d[key(item)].append(item) @@ -218,9 +214,7 @@ def full_groupby(l, key=lambda x: x): def iscoroutinefunction(function): - """ - Whether the function is an asynchronous generator or a coroutine. - """ + """Whether the function is an asynchronous generator or a coroutine.""" # Partial unwrapping not required starting from Python 3.11.0 # See https://github.com/holoviz/param/pull/894#issuecomment-1867084447 while isinstance(function, functools.partial): @@ -231,9 +225,7 @@ def iscoroutinefunction(function): ) async def _to_thread(func, /, *args, **kwargs): - """ - Polyfill for asyncio.to_thread in Python < 3.9 - """ + """Polyfill for asyncio.to_thread in Python < 3.9""" loop = asyncio.get_running_loop() ctx = contextvars.copy_context() func_call = functools.partial(ctx.run, func, *args, **kwargs) @@ -289,9 +281,7 @@ def flatten(line): def accept_arguments( f: Callable[Concatenate[CallableT, P], R] ) -> Callable[P, Callable[[CallableT], R]]: - """ - Decorator for decorators that accept arguments - """ + """Decorator for decorators that accept arguments""" @functools.wraps(f) def _f(*args: P.args, **kwargs: P.kwargs) -> Callable[[CallableT], R]: return lambda actual_f: f(actual_f, *args, **kwargs) diff --git a/param/ipython.py b/param/ipython.py index 1dee4fb0f..13b8b5015 100644 --- a/param/ipython.py +++ b/param/ipython.py @@ -350,9 +350,7 @@ def params(self, parameter_s='', namespaces=None): class IPythonDisplay: - """ - Reactive display handler that updates the output. - """ + """Reactive display handler that updates the output.""" enabled = True diff --git a/param/parameterized.py b/param/parameterized.py index d2374c132..ac0df0343 100644 --- a/param/parameterized.py +++ b/param/parameterized.py @@ -163,9 +163,7 @@ def eval_function_with_deps(function): return function(*args, **kwargs) def resolve_value(value, recursive=True): - """ - Resolves the current value of a dynamic reference. - """ + """Resolves the current value of a dynamic reference.""" if not recursive: pass elif isinstance(value, (list, tuple)): @@ -189,9 +187,7 @@ def resolve_value(value, recursive=True): return value def resolve_ref(reference, recursive=False): - """ - Resolves all parameters a dynamic reference depends on. - """ + """Resolves all parameters a dynamic reference depends on.""" if recursive: if isinstance(reference, (list, tuple, set)): return [r for v in reference for r in resolve_ref(v, recursive)] @@ -250,9 +246,7 @@ def __repr__(self): @contextmanager def logging_level(level): - """ - Temporarily modify param's logging level. - """ + """Temporarily modify param's logging level.""" level = level.upper() levels = [DEBUG, INFO, WARNING, ERROR, CRITICAL, VERBOSE] level_names = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'VERBOSE'] @@ -468,9 +462,7 @@ def _getattr(obj, attr): def no_instance_params(cls): - """ - Disables instance parameters on the class - """ + """Disables instance parameters on the class""" cls._param__private.disable_instance_params = True return cls @@ -527,9 +519,7 @@ def _f(self, obj, val): def get_method_owner(method): - """ - Gets the instance that owns the supplied method - """ + """Gets the instance that owns the supplied method""" if not inspect.ismethod(method): return None if isinstance(method, partial): @@ -738,9 +728,7 @@ def _skip_event(*events, **kwargs): def extract_dependencies(function): - """ - Extract references from a method or function that declares the references. - """ + """Extract references from a method or function that declares the references.""" subparameters = list(function._dinfo['dependencies'])+list(function._dinfo['kw'].values()) params = [] for p in subparameters: @@ -893,9 +881,7 @@ class Watcher(_Watcher): """ def __new__(cls_, *args, **kwargs): - """ - Allows creating Watcher without explicit precedence value. - """ + """Allows creating Watcher without explicit precedence value.""" values = dict(zip(cls_._fields, args)) values.update(kwargs) if 'precedence' not in values: @@ -911,9 +897,7 @@ def __str__(self): class ParameterMetaclass(type): - """ - Metaclass allowing control over creation of Parameter classes. - """ + """Metaclass allowing control over creation of Parameter classes.""" def __new__(mcs, classname, bases, classdict): @@ -1790,9 +1774,7 @@ def compare_mapping(cls, obj1, obj2): class _ParametersRestorer: - """ - Context-manager to handle the reset of parameter values after an update. - """ + """Context-manager to handle the reset of parameter values after an update.""" def __init__(self, *, parameters, restore, refs=None): self._parameters = parameters @@ -1889,9 +1871,7 @@ def __setstate__(self, state): setattr(self, k, v) def __getitem__(self_, key): - """ - Returns the class or instance parameter - """ + """Returns the class or instance parameter""" inst = self_.self if inst is None: return self_._cls_parameters[key] @@ -1899,24 +1879,18 @@ def __getitem__(self_, key): return _instantiated_parameter(inst, p) def __dir__(self_): - """ - Adds parameters to dir - """ + """Adds parameters to dir""" return super().__dir__() + list(self_._cls_parameters) def __iter__(self_): - """ - Iterates over the parameters on this object. - """ + """Iterates over the parameters on this object.""" yield from self_._cls_parameters def __contains__(self_, param): return param in self_._cls_parameters def __getattr__(self_, attr): - """ - Extends attribute access to parameter objects. - """ + """Extends attribute access to parameter objects.""" cls = self_.__dict__.get('cls') if cls is None: # Class not initialized raise AttributeError @@ -2585,9 +2559,7 @@ def trigger(self_, *param_names): self_._state_watchers += watchers def _update_event_type(self_, watcher, event, triggered): - """ - Returns an updated Event object with the type field set appropriately. - """ + """Returns an updated Event object with the type field set appropriately.""" if triggered: event_type = 'triggered' else: @@ -2616,9 +2588,7 @@ def _execute_watcher(self, watcher, events): pass def _call_watcher(self_, watcher, event): - """ - Invoke the given watcher appropriately given an Event object. - """ + """Invoke the given watcher appropriately given an Event object.""" if self_._TRIGGER: pass elif watcher.onlychanged and (not self_._changed(event)): @@ -2795,9 +2765,7 @@ def deserialize_value(self_, pname, value, mode='json'): return serializer.deserialize_parameter_value(self_or_cls, pname, value) def schema(self_, safe=False, subset=None, mode='json'): - """ - Returns a schema for the parameters on this Parameterized object. - """ + """Returns a schema for the parameters on this Parameterized object.""" self_or_cls = self_.self_or_cls if mode not in Parameter._serializers: raise ValueError(f'Mode {mode!r} not in available serialization formats {list(Parameter._serializers.keys())!r}') @@ -3162,9 +3130,7 @@ def _watch(self_, fn, parameter_names, what='value', onlychanged=True, queued=Fa return watcher def unwatch(self_, watcher): - """ - Remove the given Watcher object (from `watch` or `watch_values`) from this object's list. - """ + """Remove the given Watcher object (from `watch` or `watch_values`) from this object's list.""" try: self_._register_watcher('remove', watcher, what=watcher.what) except Exception: diff --git a/param/parameters.py b/param/parameters.py index bdb96740e..0259e2ae0 100644 --- a/param/parameters.py +++ b/param/parameters.py @@ -501,9 +501,7 @@ def __init__(self, default=Undefined, **params): def _initialize_generator(self,gen,obj=None): - """ - Add 'last time' and 'last value' attributes to the generator. - """ + """Add 'last time' and 'last value' attributes to the generator.""" # Could use a dictionary to hold these things. if hasattr(obj,"_Dynamic_time_fn"): gen._Dynamic_time_fn = obj._Dynamic_time_fn @@ -890,9 +888,7 @@ def __init__(self, default=Undefined, *, bounds=Undefined, softbounds=Undefined, class Date(Number): - """ - Date parameter of datetime or date type. - """ + """Date parameter of datetime or date type.""" _slot_defaults = dict(Number._slot_defaults, default=None) @@ -951,9 +947,7 @@ def deserialize(cls, value): class CalendarDate(Number): - """ - Parameter specifically allowing dates (not datetimes). - """ + """Parameter specifically allowing dates (not datetimes).""" _slot_defaults = dict(Number._slot_defaults, default=None) @@ -1240,9 +1234,7 @@ def __init__(self, default=Undefined, **params): class Range(NumericTuple): - """ - A numeric range with optional bounds and softbounds. - """ + """A numeric range with optional bounds and softbounds.""" __slots__ = ['bounds', 'inclusive_bounds', 'softbounds', 'step'] @@ -1427,9 +1419,7 @@ def deserialize(cls, value): class CalendarDateRange(Range): - """ - A date range specified as (start_date, end_date). - """ + """A date range specified as (start_date, end_date).""" def _validate_value(self, val, allow_None): if allow_None and val is None: @@ -1557,9 +1547,7 @@ def __init__(self, *, attribs=Undefined, **kw): self.attribs = attribs def __get__(self, obj, objtype): - """ - Return the values of all the attribs, as a list. - """ + """Return the values of all the attribs, as a list.""" if obj is None: return [getattr(objtype, a) for a in self.attribs] else: @@ -1994,9 +1982,7 @@ def __init__(self, default=Undefined, *, objects=Undefined, **kwargs): class FileSelector(Selector): - """ - Given a path glob, allows one file to be selected from those matching. - """ + """Given a path glob, allows one file to be selected from those matching.""" __slots__ = ['path'] @@ -2105,9 +2091,7 @@ def _update_state(self): class MultiFileSelector(ListSelector): - """ - Given a path glob, allows multiple files to be selected from the list of matches. - """ + """Given a path glob, allows multiple files to be selected from the list of matches.""" __slots__ = ['path'] @@ -2222,9 +2206,7 @@ def get_range(self): class Dict(ClassSelector): - """ - Parameter whose value is a dictionary. - """ + """Parameter whose value is a dictionary.""" @typing.overload def __init__( @@ -2241,9 +2223,7 @@ def __init__(self, default=Undefined, **params): class Array(ClassSelector): - """ - Parameter whose value is a numpy array. - """ + """Parameter whose value is a numpy array.""" @typing.overload def __init__( @@ -2764,9 +2744,7 @@ def _validate(self, val): raise OSError(e.args[0]) from None def __get__(self, obj, objtype): - """ - Return an absolute, normalized path (see resolve_path). - """ + """Return an absolute, normalized path (see resolve_path).""" raw_path = super().__get__(obj,objtype) if raw_path is None: path = None diff --git a/param/reactive.py b/param/reactive.py index 903aede89..deb9171e7 100644 --- a/param/reactive.py +++ b/param/reactive.py @@ -102,25 +102,19 @@ class Wrapper(Parameterized): - """ - Helper class to allow updating literal values easily. - """ + """Helper class to allow updating literal values easily.""" object = Parameter(allow_refs=False) class GenWrapper(Parameterized): - """ - Helper class to allow streaming from generator functions. - """ + """Helper class to allow streaming from generator functions.""" object = Parameter(allow_refs=True) class Trigger(Parameterized): - """ - Helper class to allow triggering an event under some condition. - """ + """Helper class to allow triggering an event under some condition.""" value = Event() @@ -130,9 +124,7 @@ def __init__(self, parameters=None, internal=False, **params): self.parameters = parameters class Resolver(Parameterized): - """ - Helper class to allow (recursively) resolving references. - """ + """Helper class to allow (recursively) resolving references.""" object = Parameter(allow_refs=True) @@ -226,21 +218,15 @@ def __call__(self): return rxi if isinstance(rx, rx) else rx(rxi) def and_(self, other): - """ - Replacement for the ``and`` statement. - """ + """Replacement for the ``and`` statement.""" return self._as_rx()._apply_operator(lambda obj, other: obj and other, other) def bool(self): - """ - __bool__ cannot be implemented so it is provided as a method. - """ + """__bool__ cannot be implemented so it is provided as a method.""" return self._as_rx()._apply_operator(bool) def buffer(self, n): - """ - Collects the last n items that were emitted. - """ + """Collects the last n items that were emitted.""" items = [] def collect(new, n): items.append(new) @@ -250,27 +236,19 @@ def collect(new, n): return self._as_rx()._apply_operator(collect, n) def in_(self, other): - """ - Replacement for the ``in`` statement. - """ + """Replacement for the ``in`` statement.""" return self._as_rx()._apply_operator(operator.contains, other, reverse=True) def is_(self, other): - """ - Replacement for the ``is`` statement. - """ + """Replacement for the ``is`` statement.""" return self._as_rx()._apply_operator(operator.is_, other) def is_not(self, other): - """ - Replacement for the ``is not`` statement. - """ + """Replacement for the ``is not`` statement.""" return self._as_rx()._apply_operator(operator.is_not, other) def len(self): - """ - __len__ cannot be implemented so it is provided as a method. - """ + """__len__ cannot be implemented so it is provided as a method.""" return self._as_rx()._apply_operator(len) def map(self, func, /, *args, **kwargs): @@ -301,15 +279,11 @@ def apply(vs, *args, **kwargs): return self._as_rx()._apply_operator(apply, *args, **kwargs) def not_(self): - """ - __bool__ cannot be implemented so not has to be provided as a method. - """ + """__bool__ cannot be implemented so not has to be provided as a method.""" return self._as_rx()._apply_operator(operator.not_) def or_(self, other): - """ - Replacement for the ``or`` statement. - """ + """Replacement for the ``or`` statement.""" return self._as_rx()._apply_operator(lambda obj, other: obj or other, other) def pipe(self, func, /, *args, **kwargs): @@ -351,9 +325,7 @@ def resolve(self, nested=True, recursive=False): return resolver.param.value.rx() def updating(self): - """ - Returns a new expression that is True while the expression is updating. - """ + """Returns a new expression that is True while the expression is updating.""" wrapper = Wrapper(object=False) self._watch(lambda e: wrapper.param.update(object=True), precedence=-999) self._watch(lambda e: wrapper.param.update(object=False), precedence=999) @@ -439,9 +411,7 @@ def value(self): @value.setter def value(self, new): - """ - Allows overriding the original input to the pipeline. - """ + """Allows overriding the original input to the pipeline.""" if isinstance(self._reactive, Parameter): raise AttributeError( "`Parameter.rx.value = value` is not supported. Cannot override " @@ -1005,9 +975,7 @@ def _resolve(self): return current def _transform_output(self, obj): - """ - Applies custom display handlers before their output. - """ + """Applies custom display handlers before their output.""" applies = False for predicate, (handler, opts) in self._display_handlers.items(): display_opts = { diff --git a/param/serializer.py b/param/serializer.py index af8417886..b72eaf400 100644 --- a/param/serializer.py +++ b/param/serializer.py @@ -19,9 +19,7 @@ def JSONNullable(json_type): class Serialization: - """ - Base class used to implement different types of serialization. - """ + """Base class used to implement different types of serialization.""" @classmethod def schema(cls, pobj, subset=None): @@ -45,16 +43,12 @@ def deserialize_parameters(cls, pobj, serialized, subset=None): @classmethod def serialize_parameter_value(cls, pobj, pname): - """ - Serialize a single parameter value. - """ + """Serialize a single parameter value.""" raise NotImplementedError @classmethod def deserialize_parameter_value(cls, pobj, pname, value): - """ - Deserialize a single parameter value. - """ + """Deserialize a single parameter value.""" raise NotImplementedError diff --git a/param/version.py b/param/version.py index 6635fe1c5..2f3042eaa 100644 --- a/param/version.py +++ b/param/version.py @@ -328,9 +328,7 @@ def __repr__(self): return str(self) def abbrev(self): - """ - Abbreviated string representation of just the release number. - """ + """Abbreviated string representation of just the release number.""" return '.'.join(str(el) for el in self.release) def verify(self, string_version=None): diff --git a/pyproject.toml b/pyproject.toml index daa2b1b3c..4f5371e0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,7 +128,6 @@ ignore = [ "D104", # Missing docstring in public package" "D105", # Missing docstring in magic method" "D107", # Missing docstring in `__init__`" - "D200", # One-line docstring should fit on one line" "D205", # 1 blank line required between summary line and description "D400", # First line should end with a period" "D401", # First line of docstring should be in imperative mood: "Returns the last n lines captured at the given level" diff --git a/tests/testbooleanparam.py b/tests/testbooleanparam.py index 433507160..6bb7ec8c0 100644 --- a/tests/testbooleanparam.py +++ b/tests/testbooleanparam.py @@ -1,6 +1,4 @@ -""" -Unit test for Boolean parameters. -""" +"""Unit test for Boolean parameters.""" import unittest import param diff --git a/tests/testbytesparam.py b/tests/testbytesparam.py index 3da02a481..df7ea8bca 100644 --- a/tests/testbytesparam.py +++ b/tests/testbytesparam.py @@ -1,6 +1,4 @@ -""" -Unit test for Bytes parameters -""" +"""Unit test for Bytes parameters""" import unittest import pytest diff --git a/tests/testcalendardateparam.py b/tests/testcalendardateparam.py index fda82e2e6..bf01bc12e 100644 --- a/tests/testcalendardateparam.py +++ b/tests/testcalendardateparam.py @@ -1,6 +1,4 @@ -""" -Unit test for CalendarDate parameters. -""" +"""Unit test for CalendarDate parameters.""" import datetime as dt import re import unittest diff --git a/tests/testcalendardaterangeparam.py b/tests/testcalendardaterangeparam.py index 9b8b8ba2b..b1c8e3e04 100644 --- a/tests/testcalendardaterangeparam.py +++ b/tests/testcalendardaterangeparam.py @@ -1,6 +1,4 @@ -""" -Unit tests for CalendarDateRange parameter. -""" +"""Unit tests for CalendarDateRange parameter.""" import datetime as dt import re import unittest diff --git a/tests/testclassselector.py b/tests/testclassselector.py index 6b1fe4a36..d5c922897 100644 --- a/tests/testclassselector.py +++ b/tests/testclassselector.py @@ -1,6 +1,4 @@ -""" -Unit test for ClassSelector parameters. -""" +"""Unit test for ClassSelector parameters.""" import unittest from numbers import Number diff --git a/tests/testcolorparameter.py b/tests/testcolorparameter.py index 2393eea00..145a88c53 100644 --- a/tests/testcolorparameter.py +++ b/tests/testcolorparameter.py @@ -1,6 +1,4 @@ -""" -Unit test for Color parameters. -""" +"""Unit test for Color parameters.""" import re import unittest diff --git a/tests/testcustomparam.py b/tests/testcustomparam.py index c0b90572d..3fc1ea5e9 100644 --- a/tests/testcustomparam.py +++ b/tests/testcustomparam.py @@ -1,6 +1,4 @@ -""" -Unit tests for checking the API defended to create custom Parameters. -""" +"""Unit tests for checking the API defended to create custom Parameters.""" import param import pytest diff --git a/tests/testdateparam.py b/tests/testdateparam.py index e0ca5e368..f9182cd88 100644 --- a/tests/testdateparam.py +++ b/tests/testdateparam.py @@ -1,6 +1,4 @@ -""" -Unit test for Date parameters. -""" +"""Unit test for Date parameters.""" import datetime as dt import json import re diff --git a/tests/testdaterangeparam.py b/tests/testdaterangeparam.py index 6fb43a5eb..ff89c74b2 100644 --- a/tests/testdaterangeparam.py +++ b/tests/testdaterangeparam.py @@ -1,6 +1,4 @@ -""" -Unit tests for DateRange parameter. -""" +"""Unit tests for DateRange parameter.""" import datetime as dt import re import unittest diff --git a/tests/testdefaults.py b/tests/testdefaults.py index 8cad01040..e7dc4c737 100644 --- a/tests/testdefaults.py +++ b/tests/testdefaults.py @@ -1,6 +1,4 @@ -""" -Do all subclasses of Parameter supply a valid default? -""" +"""Do all subclasses of Parameter supply a valid default?""" import unittest import pytest diff --git a/tests/testdeprecations.py b/tests/testdeprecations.py index 1f9bf4c80..6cb643c05 100644 --- a/tests/testdeprecations.py +++ b/tests/testdeprecations.py @@ -1,6 +1,4 @@ -""" -Test deprecation warnings. -""" +"""Test deprecation warnings.""" import warnings import param @@ -9,9 +7,7 @@ @pytest.fixture(autouse=True) def specific_filter(): - """ - Used to make sure warnings are set up with the right stacklevel. - """ + """Used to make sure warnings are set up with the right stacklevel.""" with warnings.catch_warnings(): warnings.simplefilter('ignore') warnings.filterwarnings('error', module=__name__) diff --git a/tests/testfiledeserialization.py b/tests/testfiledeserialization.py index 39ededc0f..21724afec 100644 --- a/tests/testfiledeserialization.py +++ b/tests/testfiledeserialization.py @@ -1,6 +1,4 @@ -""" -Test deserialization routines that read from file -""" +"""Test deserialization routines that read from file""" import unittest import param import sys diff --git a/tests/testipythonmagic.py b/tests/testipythonmagic.py index 9c9a2e4fd..230a18844 100644 --- a/tests/testipythonmagic.py +++ b/tests/testipythonmagic.py @@ -1,6 +1,4 @@ -""" -Unit test for the IPython magic -""" +"""Unit test for the IPython magic""" import re import sys import unittest diff --git a/tests/testjsonserialization.py b/tests/testjsonserialization.py index e11dc63c1..48586efb3 100644 --- a/tests/testjsonserialization.py +++ b/tests/testjsonserialization.py @@ -1,6 +1,4 @@ -""" -Testing JSON serialization of parameters and the corresponding schemas. -""" +"""Testing JSON serialization of parameters and the corresponding schemas.""" import datetime import json import unittest @@ -101,9 +99,7 @@ class TestSet(param.Parameterized): class TestSerialization(unittest.TestCase): - """ - Base class for testing serialization of Parameter values - """ + """Base class for testing serialization of Parameter values""" mode = None diff --git a/tests/testnumbergen.py b/tests/testnumbergen.py index af92bbb8b..b1cd9b6b1 100644 --- a/tests/testnumbergen.py +++ b/tests/testnumbergen.py @@ -1,6 +1,4 @@ -""" -Test cases for the numbergen module. -""" +"""Test cases for the numbergen module.""" import unittest import numbergen diff --git a/tests/testnumberparameter.py b/tests/testnumberparameter.py index 56f2d34c8..ea2654cf5 100644 --- a/tests/testnumberparameter.py +++ b/tests/testnumberparameter.py @@ -1,6 +1,4 @@ -""" -Unit test for Number parameters and their subclasses. -""" +"""Unit test for Number parameters and their subclasses.""" import unittest import pytest diff --git a/tests/testnumpy.py b/tests/testnumpy.py index 3bc47d256..42b99d5db 100644 --- a/tests/testnumpy.py +++ b/tests/testnumpy.py @@ -1,6 +1,4 @@ -""" -If numpy's present, is numpy stuff ok? -""" +"""If numpy's present, is numpy stuff ok?""" import os import unittest diff --git a/tests/testpandas.py b/tests/testpandas.py index 6227cded2..462c4571d 100644 --- a/tests/testpandas.py +++ b/tests/testpandas.py @@ -1,6 +1,4 @@ -""" -Test Parameters based on pandas -""" +"""Test Parameters based on pandas""" import os import re import unittest diff --git a/tests/testparamdepends.py b/tests/testparamdepends.py index 6dd14ea8c..be6f32c67 100644 --- a/tests/testparamdepends.py +++ b/tests/testparamdepends.py @@ -1,6 +1,4 @@ -""" -Unit test for param.depends. -""" +"""Unit test for param.depends.""" import asyncio diff --git a/tests/testparameterizedobject.py b/tests/testparameterizedobject.py index 384177204..850582be5 100644 --- a/tests/testparameterizedobject.py +++ b/tests/testparameterizedobject.py @@ -1,6 +1,4 @@ -""" -Unit test for Parameterized. -""" +"""Unit test for Parameterized.""" import inspect import re import unittest diff --git a/tests/testparameterizedrepr.py b/tests/testparameterizedrepr.py index c5c01b528..84acd34b5 100644 --- a/tests/testparameterizedrepr.py +++ b/tests/testparameterizedrepr.py @@ -1,6 +1,4 @@ -""" -Unit test for the repr and pprint of parameterized objects, and for pprint/script_repr. -""" +"""Unit test for the repr and pprint of parameterized objects, and for pprint/script_repr.""" import inspect import unittest diff --git a/tests/testparamoutput.py b/tests/testparamoutput.py index 80aab0023..ffc5590c1 100644 --- a/tests/testparamoutput.py +++ b/tests/testparamoutput.py @@ -1,6 +1,4 @@ -""" -Unit test for param.output. -""" +"""Unit test for param.output.""" import unittest import param diff --git a/tests/testparamunion.py b/tests/testparamunion.py index db168fdc7..4cdff64d4 100644 --- a/tests/testparamunion.py +++ b/tests/testparamunion.py @@ -1,6 +1,4 @@ -""" -UnitTest for param_union helper -""" +"""UnitTest for param_union helper""" import logging import unittest diff --git a/tests/testrangeparameter.py b/tests/testrangeparameter.py index 1f0982f77..3310a7ede 100644 --- a/tests/testrangeparameter.py +++ b/tests/testrangeparameter.py @@ -1,6 +1,4 @@ -""" -Unit test for Range parameters. -""" +"""Unit test for Range parameters.""" import re import unittest diff --git a/tests/teststringparam.py b/tests/teststringparam.py index 4f9ecf8a6..7f6fe158d 100644 --- a/tests/teststringparam.py +++ b/tests/teststringparam.py @@ -1,6 +1,4 @@ -""" -Unit test for String parameters -""" +"""Unit test for String parameters""" import unittest import param diff --git a/tests/testwatch.py b/tests/testwatch.py index 7a41f3bc4..dd53427d6 100644 --- a/tests/testwatch.py +++ b/tests/testwatch.py @@ -1,6 +1,4 @@ -""" -Unit test for watch mechanism -""" +"""Unit test for watch mechanism""" import copy import re import unittest