From 071b86be5d2a625a253b5ba5ee91d94082a85084 Mon Sep 17 00:00:00 2001 From: Eman Abdelhaleem Date: Mon, 29 Dec 2025 12:22:50 +0200 Subject: [PATCH 1/3] add example, default to get_flow docstring --- openml/flows/functions.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/openml/flows/functions.py b/openml/flows/functions.py index 9906958e5..970e881cb 100644 --- a/openml/flows/functions.py +++ b/openml/flows/functions.py @@ -78,16 +78,32 @@ def get_flow(flow_id: int, reinstantiate: bool = False, strict_version: bool = T flow_id : int The OpenML flow id. - reinstantiate: bool + reinstantiate: bool, optional, default=False Whether to reinstantiate the flow to a model instance. - strict_version : bool, default=True + strict_version : bool, optional, default=True Whether to fail if version requirements are not fulfilled. Returns ------- flow : OpenMLFlow the flow + + Examples + -------- + >>> import openml + Download the flow with flow_id = 5 + >>> flow_id = 5 + >>> flow = openml.flows.get_flow() + >>> print(flow) + OpenML Flow + =========== + Flow ID.........: 5 (version 1) + Flow URL........: https://www.openml.org/f/5 + Flow Name.......: openml.evaluation.average_cost + Flow Description: An implementation of the evaluation measure "average_cost" + Upload Date.....: 2014-01-16 14:12:56 + Dependencies....: Build on top of Weka API (Jar version 3.?.?) """ flow_id = int(flow_id) flow = _get_flow_description(flow_id) From 230733e6bba1c9dcb80533dc57e1a564095b7692 Mon Sep 17 00:00:00 2001 From: Eman Abdelhaleem Date: Mon, 29 Dec 2025 12:31:42 +0200 Subject: [PATCH 2/3] ADD examples to list_flows docstring --- openml/flows/functions.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openml/flows/functions.py b/openml/flows/functions.py index 970e881cb..4fa8ea28f 100644 --- a/openml/flows/functions.py +++ b/openml/flows/functions.py @@ -180,6 +180,13 @@ def list_flows( - version - external version - uploader + + Examples + -------- + >>> import openml + >>> flows = openml.flows.list_flows() + A df of all flows which are on openML is returned + [123519 rows x 6 columns] """ listing_call = partial(_list_flows, tag=tag, uploader=uploader) batches = openml.utils._list_all(listing_call, offset=offset, limit=size) From 3a9c3cca5e47ed8f3c6ed35ac0db87dd12c230a0 Mon Sep 17 00:00:00 2001 From: Eman Abdelhaleem Date: Mon, 29 Dec 2025 12:42:34 +0200 Subject: [PATCH 3/3] ADD examples to flow_exists docstring --- openml/flows/functions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openml/flows/functions.py b/openml/flows/functions.py index 4fa8ea28f..7eb979ecd 100644 --- a/openml/flows/functions.py +++ b/openml/flows/functions.py @@ -245,6 +245,14 @@ def flow_exists(name: str, external_version: str) -> int | bool: flow_exist : int or bool flow id iff exists, False otherwise + Examples + -------- + >>> import openml + >>> flow = openml.flows.flow_exists(name = "openml.evaluation.EuclideanDistance", \ + >>> external_version = "1") + >>> print(flow) + + Notes ----- see https://www.openml.org/api_docs/#!/flow/get_flow_exists_name_version