Skip to content

Commit

Permalink
Python docstring argument fixes (bokeh#14019)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeil authored Aug 11, 2024
1 parent e263b86 commit 9b83ee5
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
.sw[nop]
*.tmp
.vscode
.idea

# compressed / binary files
*.bz2
Expand Down
3 changes: 1 addition & 2 deletions src/bokeh/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,10 @@ def enumeration(*values: Any, case_sensitive: bool = True, quote: bool = False)
first element will be considered the default value when used
to create |Enum| properties.
Keyword Args:
case_sensitive (bool, optional) :
Whether validation should consider case or not (default: True)
quote (bool, optional):
quote (bool, optional) :
Whether values should be quoted in the string representations
(default: False)
Expand Down
10 changes: 2 additions & 8 deletions src/bokeh/core/has_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,9 @@ def set_from_json(self, name: str, value: Any, *, setter: Setter | None = None)
''' Set a property value on this object from JSON.
Args:
name: (str) : name of the attribute to set
name (str) : name of the attribute to set
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :
Mapping of model ids to models (default: None)
This is needed in cases where the attributes to update also
have values that have references.
value (JSON-value) : value to set to the attribute to
setter(ClientSession or ServerSession or None, optional) :
This is used to prevent "boomerang" updates to Bokeh apps.
Expand Down
2 changes: 1 addition & 1 deletion src/bokeh/core/property/dataspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def make_descriptors(self, base_name: str):
property as well as the associated units property are returned.
Args:
name (str) : the name of the property these descriptors are for
base_name (str) : the name of the property these descriptors are for
Returns:
list[PropertyDescriptor]
Expand Down
12 changes: 2 additions & 10 deletions src/bokeh/core/property/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,7 @@ def set_from_json(self, obj: HasProps, value: Any, *, setter: Setter | None = No
Args:
obj: (HasProps) : instance to set the property value on
json: (JSON-value) : value to set to the attribute to
models (dict or None, optional) :
Mapping of model ids to models (default: None)
This is needed in cases where the attributes to update also
have values that have references.
value: (JSON-value) : value to set to the attribute to
setter (ClientSession or ServerSession or None, optional) :
This is used to prevent "boomerang" updates to Bokeh apps.
Expand Down Expand Up @@ -786,9 +780,7 @@ def set_from_json(self, obj: HasProps, value: Any, *, setter: Setter | None = No
Args:
obj (HasProps) :
json (JSON-dict) :
models(seq[Model], optional) :
value (JSON-dict) :
setter (ClientSession or ServerSession or None, optional) :
This is used to prevent "boomerang" updates to Bokeh apps.
Expand Down
6 changes: 3 additions & 3 deletions src/bokeh/core/property/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class PropertyValueList(PropertyValueContainer, list[T]):
"""

def __init__(self, *args, **kwargs) -> None:
return super().__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

def _saved_copy(self) -> list[T]:
return list(self)
Expand Down Expand Up @@ -274,7 +274,7 @@ class PropertyValueSet(PropertyValueContainer, set[T]):
"""

def __init__(self, *args, **kwargs) -> None:
return super().__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

def _saved_copy(self) -> set[T]:
return set(self)
Expand Down Expand Up @@ -348,7 +348,7 @@ class PropertyValueDict(PropertyValueContainer, dict[str, T_Val]):
"""
def __init__(self, *args, **kwargs) -> None:
return super().__init__(*args, **kwargs)
super().__init__(*args, **kwargs)

def _saved_copy(self):
return dict(self)
Expand Down
2 changes: 1 addition & 1 deletion src/bokeh/core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def find(objs: Iterable[Model], selector: SelectorType) -> Iterable[Model]:
a selector.
Args:
obj (Model) : object to test
objs (Iterable[Model]) : model objects to test
selector (JSON-like) : query selector
Yields:
Expand Down
6 changes: 3 additions & 3 deletions src/bokeh/document/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def apply_json_patch(self, patch_json: PatchJson | Serialized[PatchJson], *, set
''' Apply a JSON patch object and process any resulting events.
Args:
patch (JSON-data) :
patch_json (JSON-data) :
The JSON-object containing the patch to apply.
setter (ClientSession or ServerSession or None, optional) :
Expand Down Expand Up @@ -496,7 +496,7 @@ def hold(self, policy: HoldPolicyType = "combine") -> None:
hold will be applied according to the hold policy.
Args:
hold ('combine' or 'collect', optional)
policy ('combine' or 'collect', optional)
Whether events collected during a hold should attempt to be
combined (default: 'combine')
Expand Down Expand Up @@ -716,7 +716,7 @@ def set_select(self, selector: SelectorType | type[Model], updates: dict[str, An
Args:
selector (JSON-like query dictionary) : you can query by type or by
name,i e.g. ``{"type": HoverTool}``, ``{"name": "mycircle"}``
updates (dict) :
updates (dict) :
Returns:
None
Expand Down
2 changes: 1 addition & 1 deletion src/bokeh/driving.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def linear(m: float = 1, b: float = 0) -> partial[Callable[[], None]]:
Args:
m (float) : a slope for the linear driver
x (float) : an offset for the linear driver
b (float) : an offset for the linear driver
'''
def f(i: float) -> float:
Expand Down
2 changes: 1 addition & 1 deletion src/bokeh/plotting/_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def process_active_tools(toolbar: Toolbar, tool_map: dict[str, Tool],
Args:
toolbar (Toolbar): instance of a Toolbar object
tools_map (dict[str]): tool_map from _process_tools_arg
tool_map (dict[str]): tool_map from _process_tools_arg
active_drag (str, None, "auto" or Tool): the tool to set active for drag
active_inspect (str, None, "auto", Tool or Tool[]): the tool to set active for inspect
active_scroll (str, None, "auto" or Tool): the tool to set active for scroll
Expand Down
3 changes: 1 addition & 2 deletions src/bokeh/protocol/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ def add_buffer(self, buffer: Buffer) -> None:
''' Associate a buffer header and payload with this message.
Args:
buf_header (``JSON``) : a buffer header
buf_payload (``JSON`` or bytes) : a buffer payload
buffer (Buffer) : a buffer
Returns:
None
Expand Down
2 changes: 1 addition & 1 deletion src/bokeh/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def stop(self, wait: bool = True) -> None:
as stops the ``HTTPServer`` that this instance was configured with.
Args:
fast (bool):
wait (bool):
Whether to wait for orderly cleanup (default: True)
Returns:
Expand Down
9 changes: 0 additions & 9 deletions src/bokeh/util/callback_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,6 @@ def remove_on_change(self, attr: str, *callbacks: PropertyCallback) -> None:
def trigger(self, attr: str, old: Any, new: Any,
hint: DocumentPatchedEvent | None = None, setter: Setter | None = None) -> None:
''' Trigger callbacks for ``attr`` on this object.
Args:
attr (str) :
old (object) :
new (object) :
Returns:
None
'''
def invoke() -> None:
callbacks = self._callbacks.get(attr)
Expand Down

0 comments on commit 9b83ee5

Please sign in to comment.