From 016227c80cc1744d87654d3e108c6a60fe1d0758 Mon Sep 17 00:00:00 2001 From: Luis Pereira Date: Mon, 2 Dec 2024 12:20:56 +0100 Subject: [PATCH] update docstrings --- .../_api/simulators/simulator_models.py | 25 +++++++++++-------- .../_api/simulators/simulator_routines.py | 11 ++++---- cognite/client/_api/simulators/simulators.py | 2 +- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/cognite/client/_api/simulators/simulator_models.py b/cognite/client/_api/simulators/simulator_models.py index 785fbf913..39e5602ed 100644 --- a/cognite/client/_api/simulators/simulator_models.py +++ b/cognite/client/_api/simulators/simulator_models.py @@ -35,19 +35,18 @@ def list( List simulator model revisions Args: - limit (int): The maximum number of model revisions to return. Defaults to 100. + limit (int): The maximum number of simulator model revisions to return. Defaults to 100. filter (SimulatorModelRevisionsFilter | dict[str, Any] | None): The filter to narrow down simulator model revisions. Returns: - SimulatorModelRevisionList: List all simulator model revisions + SimulatorModelRevisionList: List of simulator model revisions Examples: - List simulators model revisions: - - >>> from cognite.client import CogniteClient - >>> client = CogniteClient() - >>> res = client.simulators.models.routines.list() + List simulator model revisions: + >>> from cognite.client import CogniteClient + >>> client = CogniteClient() + >>> res = client.simulators.models.revisions.list() """ self._warning.warn() @@ -78,11 +77,15 @@ def retrieve(self, id: int | None = None, external_id: str | None = None) -> Sim Examples: - Retrieve simulator model revisions: + Get simulator model revisions by id: + >>> from cognite.client import CogniteClient + >>> client = CogniteClient() + >>> res = client.simulators.models.revisions.retrieve(ids=[1, 2, 3]) - >>> from cognite.client import CogniteClient - >>> client = CogniteClient() - >>> res = client.simulators.models.revisions.retrieve(external_id="1") + Get simulator model revisions by external id: + >>> from cognite.client import CogniteClient + >>> client = CogniteClient() + >>> res = client.simulators.models.revisions.retrieve(external_ids=["abc", "def"]) """ identifiers = IdentifierSequence.load(ids=id, external_ids=external_id).as_singleton() diff --git a/cognite/client/_api/simulators/simulator_routines.py b/cognite/client/_api/simulators/simulator_routines.py index a9a84848f..44b6a2e74 100644 --- a/cognite/client/_api/simulators/simulator_routines.py +++ b/cognite/client/_api/simulators/simulator_routines.py @@ -43,11 +43,10 @@ def list( Examples: - List simulators: - - >>> from cognite.client import CogniteClient - >>> client = CogniteClient() - >>> res = client.simulators.routines.revisions.list() + List simulator routine revisions: + >>> from cognite.client import CogniteClient + >>> client = CogniteClient() + >>> res = client.simulators.routines.revisions.list() """ self._warning.warn() @@ -111,7 +110,7 @@ def __init__(self, config: ClientConfig, api_version: str | None, cognite_client def list( self, limit: int = DEFAULT_LIMIT_READ, filter: SimulatorRoutinesFilter | dict[str, Any] | None = None ) -> SimulatorRoutineList: - """`Filter simulator routines `_ + """`Filter simulator routines `_ List simulator routines diff --git a/cognite/client/_api/simulators/simulators.py b/cognite/client/_api/simulators/simulators.py index 8854da47a..7599951d0 100644 --- a/cognite/client/_api/simulators/simulators.py +++ b/cognite/client/_api/simulators/simulators.py @@ -38,7 +38,7 @@ def list(self, limit: int = DEFAULT_LIMIT_READ) -> SimulatorList: List simulators Args: - limit (int): The maximum number of simulators to return. Defaults to 25. Set to -1, float("inf") or None + limit (int): The maximum number of simulators to return. Defaults to 10. Returns: SimulatorList: List of simulators