diff --git a/doc/conf.py b/doc/conf.py index fd4d64dbcf..8c85ff29cb 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -86,6 +86,7 @@ extensions = [ + 'numpydoc', 'bokeh.sphinxext.bokeh_plot', 'myst_parser', 'sphinx_design', diff --git a/panel/auth.py b/panel/auth.py index 53bbdbb67d..e47759dd57 100644 --- a/panel/auth.py +++ b/panel/auth.py @@ -124,8 +124,8 @@ async def get_authenticated_user(self, redirect_uri, client_id, state, """ Fetches the authenticated user - Arguments - --------- + Parameters + ---------- redirect_uri: (str) The OAuth redirect URI client_id: (str) @@ -172,8 +172,8 @@ async def _fetch_access_token( """ Fetches the access token. - Arguments - --------- + Parameters + ---------- client_id: The client ID redirect_uri: diff --git a/panel/chat/feed.py b/panel/chat/feed.py index cd6a50a23c..e985c6031b 100644 --- a/panel/chat/feed.py +++ b/panel/chat/feed.py @@ -659,8 +659,8 @@ def send( If `respond` is `True`, additionally executes the callback, if provided. - Arguments - --------- + Parameters + ---------- value : ChatMessage | dict | Any The message contents to send. user : str | None @@ -711,8 +711,8 @@ def stream( This method is primarily for outputs that are not generators-- notably LangChain. For most cases, use the send method instead. - Arguments - --------- + Parameters + ---------- value : str | dict | ChatMessage The new token value to stream. user : str | None @@ -781,8 +781,8 @@ def add_step( Adds a ChatStep component either by appending it to an existing ChatMessage or creating a new ChatMessage. - Arguments - --------- + Parameters + ---------- step : str | list(str) | ChatStep | None The objects to stream to the step. append : bool @@ -889,8 +889,8 @@ def prompt_user( """ Prompts the user to interact with a form component. - Arguments - --------- + Parameters + ---------- component : Widget | ListPanel The component to prompt the user with. callback : Callable @@ -1092,8 +1092,8 @@ def serialize( """ Exports the chat log. - Arguments - --------- + Parameters + ---------- format : str The format to export the chat log as; currently only supports "transformers". @@ -1155,8 +1155,8 @@ def select(self, selector=None): Iterates over the ChatInterface and any potential children in the applying the selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. diff --git a/panel/chat/interface.py b/panel/chat/interface.py index dfd4f0c7ac..76271718d3 100644 --- a/panel/chat/interface.py +++ b/panel/chat/interface.py @@ -583,8 +583,8 @@ def active(self, index: int) -> None: """ Set the active input widget tab index. - Arguments - --------- + Parameters + ---------- index : int The active index to set. """ @@ -602,8 +602,8 @@ def _serialize_for_transformers( """ Exports the chat log for use with transformers. - Arguments - --------- + Parameters + ---------- messages : list(ChatMessage) A list of ChatMessage objects to serialize. role_names : dict(str, str | list(str)) | None @@ -668,8 +668,8 @@ def send( If `respond` is `True`, additionally executes the callback, if provided. - Arguments - --------- + Parameters + ---------- value : ChatMessage | dict | Any The message contents to send. user : str | None @@ -714,8 +714,8 @@ def stream( This method is primarily for outputs that are not generators-- notably LangChain. For most cases, use the send method instead. - Arguments - --------- + Parameters + ---------- value : str | dict | ChatMessage The new token value to stream. user : str | None diff --git a/panel/chat/message.py b/panel/chat/message.py index 9a94cb841a..a9671725f2 100644 --- a/panel/chat/message.py +++ b/panel/chat/message.py @@ -684,8 +684,8 @@ def stream(self, token: str, replace: bool = False): in a layout of `Column(Markdown(...), Image(...))` the Markdown pane is updated. - Arguments - --------- + Parameters + ---------- token: str The token to stream to the text pane. replace: bool (default=False) @@ -702,8 +702,8 @@ def update( """ Updates the message with a new value, user and avatar. - Arguments - --------- + Parameters + ---------- value : ChatMessage | dict | Any The message contents to send. user : str | None @@ -747,8 +747,8 @@ def serialize( """ Format the object to a string. - Arguments - --------- + Parameters + ---------- prefix_with_viewable_label : bool Whether to include the name of the Viewable, or type of the viewable if no name is specified. diff --git a/panel/chat/step.py b/panel/chat/step.py index bbdbd1e146..f6893caf67 100644 --- a/panel/chat/step.py +++ b/panel/chat/step.py @@ -242,8 +242,8 @@ def stream(self, token: str | None, replace: bool = False): """ Stream a token to the last available string-like object. - Arguments - --------- + Parameters + ---------- token : str The token to stream. replace : bool @@ -276,8 +276,8 @@ def serialize( """ Format the object to a string. - Arguments - --------- + Parameters + ---------- prefix_with_viewable_label : bool Whether to include the name of the Viewable, or type of the viewable if no name is specified. diff --git a/panel/custom.py b/panel/custom.py index 8c4769c595..242603f077 100644 --- a/panel/custom.py +++ b/panel/custom.py @@ -538,8 +538,8 @@ def _handle_msg(self, data: Any) -> None: Message handler for messages sent from the frontend using the `model.send_msg` API. - Arguments - --------- + Parameters + ---------- data: any Data received from the frontend. """ @@ -549,8 +549,8 @@ def _send_msg(self, data: Any) -> None: Sends data to the frontend which can be observed on the frontend with the `model.on_msg("msg:custom", callback)` API. - Arguments - --------- + Parameters + ---------- data: any Data to send to the frontend. """ @@ -561,8 +561,8 @@ def on_msg(self, callback: Callable) -> None: Registers a callback to be executed when a message event containing arbitrary data is received. - Arguments - --------- + Parameters + ---------- event: str Name of the DOM event to add an event listener to. callback: callable @@ -575,8 +575,8 @@ def on_event(self, event: str, callback: Callable) -> None: Registers a callback to be executed when the specified DOM event is triggered. - Arguments - --------- + Parameters + ---------- event: str Name of the DOM event to add an event listener to. callback: callable @@ -780,8 +780,8 @@ def send(self, msg: dict): """ Sends a custom event containing the provided message to the frontend. - Arguments - --------- + Parameters + ---------- msg: dict """ self._send_msg(msg) diff --git a/panel/io/handlers.py b/panel/io/handlers.py index fbe5dd6842..3293b1dea5 100644 --- a/panel/io/handlers.py +++ b/panel/io/handlers.py @@ -598,8 +598,8 @@ def _render_template(self, doc, path): found in the notebook and lays them out according to the cell metadata (if present). - Arguments - ---------- + Parameters + ----------- doc (Document) A ``Document`` to render the template into path (str): @@ -676,8 +676,8 @@ def unset_reset(): def modify_document(self, doc: Document) -> None: """Run Bokeh application code to update a ``Document`` - Arguments - ---------- + Parameters + ----------- doc (Document) : a ``Document`` to update """ path = self._runner._path diff --git a/panel/io/location.py b/panel/io/location.py index 946463f555..0a54a1df5c 100644 --- a/panel/io/location.py +++ b/panel/io/location.py @@ -233,8 +233,8 @@ def sync( parameters in the URL. If no parameters are supplied all parameters except the name are synced. - Arguments - --------- + Parameters + ---------- parameterized (param.Parameterized): The Parameterized object to sync query parameters with parameters (list or dict): @@ -273,8 +273,8 @@ def unsync(self, parameterized: param.Parameterized, parameters: list[str] | Non params in the URL. If no parameters are supplied all parameters except the name are unsynced. - Arguments - --------- + Parameters + ---------- parameterized (param.Parameterized): The Parameterized object to unsync query parameters with parameters (list): diff --git a/panel/io/resources.py b/panel/io/resources.py index ce9378fe72..9ac9ff344e 100644 --- a/panel/io/resources.py +++ b/panel/io/resources.py @@ -538,8 +538,8 @@ def resolve_resources( """ Resolves the resources required for this component. - Arguments - --------- + Parameters + ---------- cdn: bool | Literal['auto'] Whether to load resources from CDN or local server. If set to 'auto' value will be automatically determine based on diff --git a/panel/io/state.py b/panel/io/state.py index c88674fc53..dd4764c378 100644 --- a/panel/io/state.py +++ b/panel/io/state.py @@ -511,8 +511,8 @@ def as_cached(self, key: str, fn: Callable[[], T], ttl: int | None = None, **kwa >>> return dataset >>> penguins = pn.state.as_cached('dataset-penguins', load_dataset, name='penguins') - Arguments - --------- + Parameters + ---------- key: (str) The key to cache the return value under. fn: (callable) @@ -559,8 +559,8 @@ def add_periodic_callback( the period. Returns a PeriodicCallback object with the option to stop and start the callback. - Arguments - --------- + Parameters + ---------- callback: callable Callable function to be executed at periodic interval. period: int @@ -592,8 +592,8 @@ def cancel_task(self, name: str, wait: bool=False): """ Cancel a task scheduled using the `state.schedule_task` method by name. - Arguments - --------- + Parameters + ---------- name: str The name of the scheduled task. wait: boolean @@ -640,8 +640,8 @@ def execute( on the event loop ensuring the Bokeh Document lock is acquired and models can be modified directly. - Arguments - --------- + Parameters + ---------- callback: Callable[[], None] Callback to execute schedule: boolean | Literal['auto', 'thread'] @@ -671,8 +671,8 @@ def get_profile(self, profile: str): """ Returns the requested profiling output. - Arguments - --------- + Parameters + ---------- profile: str The name of the profiling output to return. @@ -703,8 +703,8 @@ def log(self, msg: str, level: str = 'info') -> None: """ Logs user messages to the Panel logger. - Arguments - --------- + Parameters + ---------- msg: str Log message level: str @@ -720,8 +720,8 @@ def onload(self, callback: Callable[[], None | Coroutine[Any, Any, None]], threa """ Callback that is triggered when a session has been served. - Arguments - --------- + Parameters + ---------- callback: Callable[[], None] | Coroutine[Any, Any, None] Callback that is executed when the application is loaded threaded: bool @@ -769,8 +769,8 @@ def publish( """ Publish parameters on a Parameterized object as a REST API. - Arguments - --------- + Parameters + ---------- endpoint: str The endpoint at which to serve the REST API. parameterized: param.Parameterized @@ -851,8 +851,8 @@ def schedule_task( a task from within your application code, the task is only scheduled once. - Arguments - --------- + Parameters + ---------- name: str Name of the scheduled task callback: callable @@ -944,8 +944,8 @@ def sync_busy(self, indicator: BooleanIndicator) -> None: Syncs the busy state with an indicator with a boolean value parameter. - Arguments - --------- + Parameters + ---------- indicator: An BooleanIndicator to sync with the busy property """ if not isinstance(indicator.param.value, param.Boolean): diff --git a/panel/layout/base.py b/panel/layout/base.py index 692315c6db..ea061aeda5 100644 --- a/panel/layout/base.py +++ b/panel/layout/base.py @@ -326,8 +326,8 @@ def select(self, selector=None): Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. @@ -438,8 +438,8 @@ def clone(self, *objects: Any, **params: Any) -> ListLike: """ Makes a copy of the layout sharing the same parameters. - Arguments - --------- + Parameters + ---------- objects: Objects to add to the cloned layout. params: Keyword arguments override the parameters on the clone. @@ -465,8 +465,8 @@ def append(self, obj: Any) -> None: """ Appends an object to the layout. - Arguments - --------- + Parameters + ---------- obj (object): Panel component to add to the layout. """ new_objects = list(self) @@ -489,8 +489,8 @@ def extend(self, objects: Iterable[Any]) -> None: """ Extends the objects on this layout with a list. - Arguments - --------- + Parameters + ---------- objects (list): List of panel components to add to the layout. """ new_objects = list(self) @@ -501,8 +501,8 @@ def index(self, object) -> int: """ Returns the integer index of the supplied object in the list of objects. - Arguments - --------- + Parameters + ---------- obj (object): Panel component to look up the index for. Returns @@ -515,8 +515,8 @@ def insert(self, index: int, obj: Any) -> None: """ Inserts an object in the layout at the specified index. - Arguments - --------- + Parameters + ---------- index (int): Index at which to insert the object. object (object): Panel components to insert in the layout. """ @@ -528,8 +528,8 @@ def pop(self, index: int) -> Viewable: """ Pops an item from the layout by index. - Arguments - --------- + Parameters + ---------- index (int): The index of the item to pop from the layout. """ new_objects = list(self) @@ -541,8 +541,8 @@ def remove(self, obj: Viewable) -> None: """ Removes an object from the layout. - Arguments - --------- + Parameters + ---------- obj (object): The object to remove from the layout. """ new_objects = list(self) @@ -699,8 +699,8 @@ def clone(self, *objects: Any, **params: Any) -> NamedListLike: """ Makes a copy of the Tabs sharing the same parameters. - Arguments - --------- + Parameters + ---------- objects: Objects to add to the cloned Tabs object. params: Keyword arguments override the parameters on the clone. @@ -727,8 +727,8 @@ def append(self, pane: Any) -> None: """ Appends an object to the tabs. - Arguments - --------- + Parameters + ---------- obj (object): Panel component to add as a tab. """ new_object, new_name = self._to_object_and_name(pane) @@ -748,8 +748,8 @@ def extend(self, panes: Iterable[Any]) -> None: """ Extends the the tabs with a list. - Arguments - --------- + Parameters + ---------- objects (list): List of panel components to add as tabs. """ new_objects, new_names = self._to_objects_and_names(panes) @@ -762,8 +762,8 @@ def insert(self, index: int, pane: Any) -> None: """ Inserts an object in the tabs at the specified index. - Arguments - --------- + Parameters + ---------- index (int): Index at which to insert the object. object (object): Panel components to insert as tabs. """ @@ -777,8 +777,8 @@ def pop(self, index: int) -> Viewable: """ Pops an item from the tabs by index. - Arguments - --------- + Parameters + ---------- index (int): The index of the item to pop from the tabs. """ new_objects = list(self) @@ -791,8 +791,8 @@ def remove(self, pane: Viewable) -> None: """ Removes an object from the tabs. - Arguments - --------- + Parameters + ---------- obj (object): The object to remove from the tabs. """ new_objects = list(self) @@ -989,8 +989,8 @@ def scroll_to(self, index: int): """ Scrolls to the child at the provided index. - Arguments - --------- + Parameters + ---------- index: int Index of the child object to scroll to. """ diff --git a/panel/layout/flex.py b/panel/layout/flex.py index 2014e18270..f87ff55889 100644 --- a/panel/layout/flex.py +++ b/panel/layout/flex.py @@ -86,8 +86,8 @@ def select(self, selector=None): Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. diff --git a/panel/layout/float.py b/panel/layout/float.py index 7740b4fe67..0d20981b16 100644 --- a/panel/layout/float.py +++ b/panel/layout/float.py @@ -220,8 +220,8 @@ def select(self, selector=None): Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. diff --git a/panel/layout/grid.py b/panel/layout/grid.py index d4dae9b349..97e4f213cc 100644 --- a/panel/layout/grid.py +++ b/panel/layout/grid.py @@ -435,8 +435,8 @@ def clone(self, **params): """ Makes a copy of the GridSpec sharing the same parameters. - Arguments - --------- + Parameters + ---------- params: Keyword arguments override the parameters on the clone. Returns diff --git a/panel/layout/swipe.py b/panel/layout/swipe.py index a553658f90..3ea5675208 100644 --- a/panel/layout/swipe.py +++ b/panel/layout/swipe.py @@ -131,8 +131,8 @@ def select(self, selector=None): Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. diff --git a/panel/links.py b/panel/links.py index baf9e53f15..329b358f8b 100644 --- a/panel/links.py +++ b/panel/links.py @@ -130,8 +130,8 @@ def __init__( arbitrary Javascript code and will make all objects referenced in the args available in the JS namespace. - Arguments - --------- + Parameters + ---------- source (Reactive): The source object the callback is attached to. target (Reactive | Model, optional): @@ -368,8 +368,8 @@ def _resolve_model( """ Resolves a model given the supplied object and a model_spec. - Arguments - ---------- + Parameters + ----------- root_model: bokeh.model.Model The root bokeh model often used to index models obj: holoviews.plotting.ElementPlot or bokeh.model.Model or panel.Viewable diff --git a/panel/pane/base.py b/panel/pane/base.py index 2ec5b00aca..702435b436 100644 --- a/panel/pane/base.py +++ b/panel/pane/base.py @@ -238,8 +238,8 @@ def get_pane_type(cls, obj: Any, **kwargs) -> type[PaneBase]: the precedence of all types whose applies method declares that the object is supported. - Arguments - --------- + Parameters + ---------- obj (object): The object type to return a Pane type for Returns @@ -467,8 +467,8 @@ def clone(self: T, object: Any | None = None, **params) -> T: """ Makes a copy of the Pane sharing the same parameters. - Arguments - --------- + Parameters + ---------- object: Optional new object to render params: Keyword arguments override the parameters on the clone. @@ -490,8 +490,8 @@ def get_root( """ Returns the root model and applies pre-processing hooks - Arguments - --------- + Parameters + ---------- doc: bokeh.document.Document Optional Bokeh document the bokeh model will be attached to. comm: pyviz_comms.Comm @@ -648,8 +648,8 @@ def _recursive_update(cls, old: Reactive, new: Reactive): contents updating only changed parameters ensuring we don't have to trigger a full re-render of the entire component. - Arguments - --------- + Parameters + ---------- old: Reactive The Reactive component being updated or replaced. new: Reactive @@ -772,8 +772,8 @@ def select(self, selector: type | Callable | None = None) -> list[Viewable]: Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: (type | callable | None) The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. diff --git a/panel/pane/echarts.py b/panel/pane/echarts.py index 915afb719e..2f49f07097 100644 --- a/panel/pane/echarts.py +++ b/panel/pane/echarts.py @@ -139,8 +139,8 @@ def on_event(self, event: str, callback: Callable, query: str | None = None): Reference: https://apache.github.io/echarts-handbook/en/concepts/event/ - Arguments - --------- + Parameters + ---------- event: str The name of the event to register a handler on, e.g. 'click'. callback: str | CustomJS @@ -162,8 +162,8 @@ def js_on_event(self, event: str, callback: str | CustomJS, query: str | None = Reference: https://apache.github.io/echarts-handbook/en/concepts/event/ - Arguments - --------- + Parameters + ---------- event: str The name of the event to register a handler on, e.g. 'click'. code: str diff --git a/panel/pane/perspective.py b/panel/pane/perspective.py index 5acbdaefab..2782f5eaa0 100644 --- a/panel/pane/perspective.py +++ b/panel/pane/perspective.py @@ -499,8 +499,8 @@ def on_click(self, callback: Callable[[PerspectiveClickEvent], None]): config, column names, and row values of the row that was clicked. - Arguments - --------- + Parameters + ---------- callback: (callable) The callback to run on edit events. """ diff --git a/panel/pane/placeholder.py b/panel/pane/placeholder.py index 949f49c4dc..5b25769090 100644 --- a/panel/pane/placeholder.py +++ b/panel/pane/placeholder.py @@ -51,8 +51,8 @@ def update(self, object): """ Updates the object on the Placeholder. - Arguments - --------- + Parameters + ---------- object: The object to update the Placeholder with. """ self.object = object diff --git a/panel/pane/vizzu.py b/panel/pane/vizzu.py index e1f7d3931c..4f8e53f166 100644 --- a/panel/pane/vizzu.py +++ b/panel/pane/vizzu.py @@ -196,8 +196,8 @@ def on_click(self, callback: Callable[[dict], None]): Register a callback to be executed when any element in the chart is clicked on. - Arguments - --------- + Parameters + ---------- callback: (callable) The callback to run on click events. """ diff --git a/panel/param.py b/panel/param.py index 95cd83bda5..3394a67f9c 100644 --- a/panel/param.py +++ b/panel/param.py @@ -762,8 +762,8 @@ def select(self, selector=None): Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. diff --git a/panel/pipeline.py b/panel/pipeline.py index da1d067052..1ff0a34ce6 100644 --- a/panel/pipeline.py +++ b/panel/pipeline.py @@ -539,8 +539,8 @@ def add_stage(self, name, stage, **kwargs): """ Adds a new, named stage to the Pipeline. - Arguments - --------- + Parameters + ---------- name: str A string name for the Pipeline stage stage: param.Parameterized @@ -574,8 +574,8 @@ def define_graph(self, graph, force=False): the default linear flow. The graph should be defined as an adjacency mapping. - Arguments - --------- + Parameters + ---------- graph: dict Dictionary declaring the relationship between different pipeline stages. Should map from a single stage name to diff --git a/panel/reactive.py b/panel/reactive.py index 5765933251..e43fa64166 100644 --- a/panel/reactive.py +++ b/panel/reactive.py @@ -728,8 +728,8 @@ def link( parameter to a callback which is triggered when the parameter changes. - Arguments - --------- + Parameters + ---------- target: param.Parameterized The target object of the link. callbacks: dict | None @@ -797,8 +797,8 @@ def controls(self, parameters: list[str] = [], jslink: bool = True, **kwargs) -> linking are exposed, but an explicit list of parameters can be provided. - Arguments - --------- + Parameters + ---------- parameters: list(str) An explicit list of parameters to return controls for. jslink: bool @@ -856,8 +856,8 @@ def jscallback(self, args: dict[str, Any]={}, **callbacks: str) -> Callback: properties that trigger a callback and the JS code that gets executed. - Arguments - ---------- + Parameters + ----------- args: dict A mapping of objects to make available to the JS callback callbacks: dict @@ -890,8 +890,8 @@ def jslink( maps from the source parameter to a JS code snippet which is executed when the property changes. - Arguments - ---------- + Parameters + ----------- target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned The target to link the value to. code: dict @@ -933,8 +933,8 @@ def _send_event(self, Event: ModelEvent, **event_kwargs: Any): """ Send an event to the frontend - Arguments - ---------- + Parameters + ----------- Event: Bokeh.Event The event to send to the frontend event_kwargs: dict @@ -1120,8 +1120,8 @@ def stream( Streams (appends) the `stream_value` provided to the existing value in an efficient manner. - Arguments - --------- + Parameters + ---------- stream_value: (pd.DataFrame | pd.Series | Dict) The new value(s) to append to the existing value. rollover: (int | None, default=None) @@ -1226,8 +1226,8 @@ def patch(self, patch_value: pd.DataFrame | pd.Series | dict) -> None: """ Efficiently patches (updates) the existing value with the `patch_value`. - Arguments - --------- + Parameters + ---------- patch_value: (pd.DataFrame | pd.Series | Dict) The value(s) to patch the existing value with. @@ -2220,8 +2220,8 @@ def on_event(self, node: str, event: str, callback: Callable) -> None: give it an id of the form `id="name"`, where `name` will be the node identifier. - Arguments - --------- + Parameters + ---------- node: str Named node in the HTML identifiable via id of the form `id="name"`. event: str diff --git a/panel/template/base.py b/panel/template/base.py index 38ddc000f2..9f7ab282d0 100644 --- a/panel/template/base.py +++ b/panel/template/base.py @@ -339,8 +339,8 @@ def resolve_resources( """ Resolves the resources required for this template component. - Arguments - --------- + Parameters + ---------- cdn: bool | Literal['auto'] Whether to load resources from CDN or local server. If set to 'auto' value will be automatically determine based on @@ -447,8 +447,8 @@ def save( """ Saves Panel objects to file. - Arguments - --------- + Parameters + ---------- filename: string or file-like object Filename to save the plot to title: string @@ -486,8 +486,8 @@ def server_doc( """ Returns a servable Document with the template attached. - Arguments - --------- + Parameters + ---------- doc : bokeh.Document (optional) The Bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc() @@ -512,8 +512,8 @@ def servable( Serves the template and returns self to allow it to display itself in a notebook context. - Arguments - --------- + Parameters + ---------- title : str A string title to give the Document (if served as an app) location : boolean or panel.io.location.Location @@ -547,8 +547,8 @@ def select(self, selector=None): Iterates over the Template and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. @@ -967,8 +967,8 @@ def add_panel(self, name: str, panel: Any, tags: list[str] = []) -> None: Add panels to the Template, which may then be referenced by the given name using the jinja2 embed macro. - Arguments - --------- + Parameters + ---------- name : str The name to refer to the panel by in the template panel : panel.Viewable @@ -990,8 +990,8 @@ def add_variable(self, name: str, value: Any) -> None: Add parameters to the template, which may then be referenced by the given name in the Jinja2 template. - Arguments - --------- + Parameters + ---------- name : str The name to refer to the panel by in the template value : object diff --git a/panel/theme/base.py b/panel/theme/base.py index 4d82f31e8a..bccb7b2f3b 100644 --- a/panel/theme/base.py +++ b/panel/theme/base.py @@ -315,8 +315,8 @@ def apply(self, viewable: Viewable, root: Model, isolated: bool = True): """ Applies the Design to a Viewable and all it children. - Arguments - --------- + Parameters + ---------- viewable: Viewable The Viewable to apply the Design to. root: Model @@ -347,8 +347,8 @@ def apply_bokeh_theme_to_model(self, model: Model, theme_override=None): Applies the Bokeh theme associated with this Design system to a model. - Arguments - --------- + Parameters + ---------- model: bokeh.model.Model The Model to apply the theme on. theme_override: str | None @@ -371,8 +371,8 @@ def resolve_resources( """ Resolves the resources required for this design component. - Arguments - --------- + Parameters + ---------- cdn: bool | Literal['auto'] Whether to load resources from CDN or local server. If set to 'auto' value will be automatically determine based on @@ -413,8 +413,8 @@ def params( """ Provides parameter values to apply the provided Viewable. - Arguments - --------- + Parameters + ---------- viewable: Viewable The Viewable to return modifiers for. doc: Document | None diff --git a/panel/viewable.py b/panel/viewable.py index 425567b673..ca2e67c57f 100644 --- a/panel/viewable.py +++ b/panel/viewable.py @@ -367,8 +367,8 @@ def servable( DOM if in a pyodide context and returns the Panel object to allow it to display itself in a notebook context. - Arguments - --------- + Parameters + ---------- title : str A string title to give the Document (if served as an app) location : boolean or panel.io.location.Location @@ -436,8 +436,8 @@ def show( """ Starts a Bokeh server and displays the Viewable in a new tab. - Arguments - --------- + Parameters + ---------- title : str | None A string title to give the Document (if served as an app) port: int (optional, default=0) @@ -570,8 +570,8 @@ def _get_model( Converts the objects being wrapped by the viewable into a bokeh model that can be composed in a bokeh layout. - Arguments - ---------- + Parameters + ----------- doc: bokeh.Document Bokeh document the bokeh model will be attached to. root: bokeh.Model @@ -591,8 +591,8 @@ def _cleanup(self, root: Model | None = None) -> None: """ Clean up method which is called when a Viewable is destroyed. - Arguments - --------- + Pgarameters + ---------- root: bokeh.model.Model Bokeh model for the view being cleaned up """ @@ -666,8 +666,8 @@ def get_root( """ Returns the root model and applies pre-processing hooks - Arguments - --------- + Parameters + ---------- doc: bokeh.Document Bokeh document the bokeh model will be attached to. comm: pyviz_comms.Comm @@ -861,8 +861,8 @@ def clone(self, **params) -> Viewable: """ Makes a copy of the object sharing the same parameters. - Arguments - --------- + Parameters + ---------- params: Keyword arguments override the parameters on the clone. Returns @@ -879,8 +879,8 @@ def select( Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. @@ -907,8 +907,8 @@ def embed( this will only work well for simple apps with a relatively small state space. - Arguments - --------- + Parameters + ---------- max_states: int The maximum number of states to embed max_opts: int @@ -943,8 +943,8 @@ def save( """ Saves Panel objects to file. - Arguments - --------- + Parameters + ---------- filename: str or file-like object Filename to save the plot to title: string @@ -991,8 +991,8 @@ def server_doc( """ Returns a serveable bokeh Document with the panel attached - Arguments - --------- + Parameters + ---------- doc : bokeh.Document (optional) The bokeh Document to attach the panel to as a root, defaults to bokeh.io.curdoc() diff --git a/panel/widgets/base.py b/panel/widgets/base.py index 53beeabc54..a37ab19d9d 100644 --- a/panel/widgets/base.py +++ b/panel/widgets/base.py @@ -101,8 +101,8 @@ def from_values(cls, values, **params): Creates an instance of this Widget where the parameters are inferred from the data. - Arguments - --------- + Parameters + ---------- values: Iterable The values to infer the parameters from. params: dict @@ -207,8 +207,8 @@ def _get_embed_state( Returns the bokeh model and a discrete set of value states for the widget. - Arguments - --------- + Parameters + ---------- root: bokeh.model.Model The root model of the widget values: list (optional) @@ -275,8 +275,8 @@ def select( Iterates over the Viewable and any potential children in the applying the Selector. - Arguments - --------- + Parameters + ---------- selector: type or callable or None The selector allows selecting a subset of Viewables by declaring a type or callable function to filter by. diff --git a/panel/widgets/button.py b/panel/widgets/button.py index e2cfe14228..32c018ab9c 100644 --- a/panel/widgets/button.py +++ b/panel/widgets/button.py @@ -106,8 +106,8 @@ def js_on_click(self, args: dict[str, Any] = {}, code: str = "") -> Callback: Allows defining a JS callback to be triggered when the button is clicked. - Arguments - ---------- + Parameters + ----------- args: dict A mapping of objects to make available to the JS callback code: str @@ -128,8 +128,8 @@ def jscallback(self, args: dict[str, Any] = {}, **callbacks: str) -> Callback: properties that trigger a callback and the JS code that gets executed. - Arguments - ---------- + Parameters + ----------- args: dict A mapping of objects to make available to the JS callback **callbacks: dict @@ -213,8 +213,8 @@ def jslink( maps from the source parameter to a JS code snippet which is executed when the property changes. - Arguments - ---------- + Parameters + ----------- target: panel.viewable.Viewable | bokeh.model.Model | holoviews.core.dimension.Dimensioned The target to link the value(s) to. code: dict @@ -256,8 +256,8 @@ def on_click( ... print("I was clicked!") >>> button.on_click(handle_click) - Arguments - --------- + Parameters + ---------- callback: The function to run on click events. Must accept a positional `Event` argument. Can be a sync or async function @@ -363,8 +363,8 @@ def on_click( The callback is given an `Event` argument declaring the number of clicks - Arguments - --------- + Parameters + ---------- callback: (Callable[[param.parameterized.Event], None]) The function to run on click events. Must accept a positional `Event` argument diff --git a/panel/widgets/file_selector.py b/panel/widgets/file_selector.py index ef3f087bef..15a6799af8 100644 --- a/panel/widgets/file_selector.py +++ b/panel/widgets/file_selector.py @@ -86,8 +86,8 @@ def ls(self, path): """ Concrete classes must implement this method to list the content of a remote filesystem. - Arguments - --------- + Parameters + ---------- path: str The path to search diff --git a/panel/widgets/icon.py b/panel/widgets/icon.py index cbc0df65fa..8f532c9d1b 100644 --- a/panel/widgets/icon.py +++ b/panel/widgets/icon.py @@ -141,8 +141,8 @@ def on_click( The callback is given an `Event` argument declaring the number of clicks. - Arguments - --------- + Parameters + ---------- callback: (Callable[[param.parameterized.Event], None]) The function to run on click events. Must accept a positional `Event` argument diff --git a/panel/widgets/input.py b/panel/widgets/input.py index f5d811282c..495a6beb04 100644 --- a/panel/widgets/input.py +++ b/panel/widgets/input.py @@ -278,8 +278,8 @@ def save(self, filename): Saves the uploaded FileInput data object(s) to file(s) or BytesIO object(s). - Arguments - --------- + Parameters + ---------- filename (str or list[str]): File path or file-like object """ value = self.value diff --git a/panel/widgets/select.py b/panel/widgets/select.py index 8b8a1c30b9..6949a34b8a 100644 --- a/panel/widgets/select.py +++ b/panel/widgets/select.py @@ -864,8 +864,8 @@ def on_double_click( ... print(f"Option {event.option} was double clicked.") >>> select.on_double_click(handle_click) - Arguments - --------- + Parameters + ---------- callback: The function to run on click events. Must accept a positional `Event` argument. Can be a sync or async function diff --git a/panel/widgets/tables.py b/panel/widgets/tables.py index 3e5238363d..5eaad033fa 100644 --- a/panel/widgets/tables.py +++ b/panel/widgets/tables.py @@ -609,8 +609,8 @@ def add_filter(self, filter: Any, column: str | None = None): scalars and the filter will check if the values in the column match any of the items in the list. - Arguments - --------- + Parameters + ---------- filter: Widget, param.Parameter or FunctionType The value by which to filter the DataFrame along the declared column, or a function accepting the DataFrame to @@ -716,8 +716,8 @@ def stream(self, stream_value, rollover=None, reset_index=True): Streams (appends) the `stream_value` provided to the existing value in an efficient manner. - Arguments - --------- + Parameters + ---------- stream_value: (pd.DataFrame | pd.Series | Dict) The new value(s) to append to the existing value. rollover: int @@ -825,8 +825,8 @@ def patch(self, patch_value, as_index=True): """ Efficiently patches (updates) the existing value with the `patch_value`. - Arguments - --------- + Parameters + ---------- patch_value: (pd.DataFrame | pd.Series | Dict) The value(s) to patch the existing value with. as_index: boolean @@ -2109,8 +2109,8 @@ def download(self, filename: str = 'table.csv'): """ Triggers downloading of the table as a CSV or JSON. - Arguments - --------- + Parameters + ---------- filename: str The filename to save the table as. """ @@ -2123,8 +2123,8 @@ def download_menu(self, text_kwargs={}, button_kwargs={}): Returns a menu containing a TextInput and Button widget to set the filename and trigger a client-side download of the data. - Arguments - --------- + Parameters + ---------- text_kwargs: dict Keyword arguments passed to the TextInput constructor button_kwargs: dict @@ -2161,8 +2161,8 @@ def on_edit(self, callback: Callable[[TableEditEvent], None]): a TableEditEvent as the first argument containing the column, row and value of the edited cell. - Arguments - --------- + Parameters + ---------- callback: (callable) The callback to run on edit events. """ @@ -2174,8 +2174,8 @@ def on_click(self, callback: Callable[[CellClickEvent], None], column: str | Non The callback is given a CellClickEvent declaring the column and row of the cell that was clicked. - Arguments - --------- + Parameters + ---------- callback: (callable) The callback to run on edit events. column: (str) diff --git a/pixi.toml b/pixi.toml index d28c8c27f8..830ee2e8ae 100644 --- a/pixi.toml +++ b/pixi.toml @@ -214,6 +214,7 @@ OBJC_DISABLE_INITIALIZE_FORK_SAFETY = "YES" lxml = "*" nbsite = ">=0.8.6rc9" selenium = "*" +numpydoc = "*" [feature.doc.tasks] _docs-refmanual = 'sphinx-apidoc -e -o doc/api/ panel/'