client.array ============ .. py:module:: client.array Attributes ---------- .. autoapisummary:: client.array.logger Classes ------- .. autoapisummary:: client.array.Array Module Contents --------------- .. py:data:: logger .. py:class:: Array(task_template_version: jobmon.client.task_template_version.TaskTemplateVersion, task_args: Dict[str, Any], op_args: Dict[str, Any], cluster_name: str, max_concurrently_running: int = MaxConcurrentlyRunning.MAXCONCURRENTLYRUNNING, upstream_tasks: Optional[List[jobmon.client.task.Task]] = None, compute_resources: Optional[Dict[str, Any]] = None, compute_resources_callable: Optional[Callable] = None, resource_scales: Optional[Dict[str, float]] = None, name: Optional[str] = None, requester: Optional[jobmon.core.requester.Requester] = None, max_attempts: Optional[int] = None) Representation of a client array object. Supports functionality to create tasks from the cross product of provided node_args. Initialize the array object. .. py:attribute:: compute_resources_callable :type: Callable[Ellipsis, Any] | None .. py:attribute:: max_concurrently_running :type: int .. py:attribute:: task_template_version .. py:attribute:: task_args .. py:attribute:: op_args .. py:attribute:: upstream_tasks :value: None .. py:attribute:: requester :value: None .. py:attribute:: tasks :type: Dict[int, jobmon.client.task.Task] .. py:property:: name :type: str Return the array name. .. py:property:: is_bound :type: bool If the array has been bound to the db. .. py:property:: array_id :type: int If the array is bound then it will have been given an id. .. py:property:: compute_resources :type: Dict[str, Any] A dictionary that includes the users requested resources for the current run. E.g. {cores: 1, mem: 1, runtime: 60, queue: all.q}. .. py:property:: resource_scales :type: Dict[str, float] A dictionary that includes the users requested resource scales for the current run. E.g. {memory: 0.6, runtime: 0.3}. .. py:property:: cluster_name :type: str The name of the cluster the user wants to run their task on. .. py:property:: max_attempts :type: Optional[int] Get the max_attempts. .. py:property:: workflow :type: jobmon.client.workflow.Workflow Get the workflow id if it has been bound to the db. .. py:method:: add_task(task: jobmon.client.task.Task) -> None Add a task to an array. Set semantics - add tasks once only, based on hash name. :param task: single task to add. .. py:method:: create_tasks(upstream_tasks: Optional[List[jobmon.client.task.Task]] = None, task_attributes: Union[List, dict] = {}, max_attempts: Optional[int] = None, resource_scales: Optional[Dict[str, Any]] = None, **node_kwargs: Any) -> List[jobmon.client.task.Task] Create a task associated with the array. :param upstream_tasks: Task objects that must be run prior to this one :param task_attributes: attributes and their values or just the attributes that will be given values later :type task_attributes: dict or list :param max_attempts: Number of attempts to try this task before giving up. Default is wf default. :param resource_scales: determines the scaling factor for how aggressive resource adjustments will be scaled up :param \*\*node_kwargs: values for each node argument specified in command_template :raises ValueError: if the args that are supplied do not match the args in the command template. .. py:method:: expand_dict(**kwargs: Any) -> Iterator[Dict] :staticmethod: Expand a dictionary of iterables into combinations of values. Given kwargs and values corresponding to node_args, return a dict of combinations of those node_args. Values of kwargs must be iterables. .. py:method:: get_tasks_by_node_args(**kwargs: Any) -> List[jobmon.client.task.Task] Query tasks by node args. Used for setting dependencies. .. py:method:: validate() -> None .. py:method:: bind() -> None Add an array to the database.