Function

Classes

Function(function)

class Function(function)[source]

Methods

compute([geoctx, timeout, block, …])

Compute this proxy object and wait for its result.

from_callable(func, *arg_types)

publish([name, description, client])

Publish this proxy object as a Workflow.

compute(geoctx=None, timeout=None, block=True, progress_bar=None, channel=None, client=None, **params)

Compute this proxy object and wait for its result.

Parameters
  • geoctx (scenes.geocontext.GeoContext, GeoContext, or None) – The GeoContext parameter under which to run the computation. Almost all computations will require a GeoContext, but for operations that only involve non-geospatial types, this parameter is optional.

  • timeout (int, optional) – The number of seconds to wait for the result, if block is True. Raises TimeoutError if the timeout passes.

  • block (bool, default True) – If True (default), block until the job is completed, or timeout has passed. If False, immediately returns a Job (which has already had execute called).

  • progress_bar (bool, default None) – Whether to draw the progress bar. If None (default), will display a progress bar in Jupyter Notebooks, but not elsewhere. Ignored if block==False.

  • channel (str or None, optional) –

    Channel name to submit the Job to. If None, uses the default channel for this client (descarteslabs.workflows.__channel__).

    Channels are different versions of the backend, to allow for feature changes without breaking existing code. Not all clients are compatible with all channels. This client is only guaranteed to work with its default channel, whose name can be found under descarteslabs.workflows.__channel__.

  • client (workflows.client.Client, optional) – Allows you to use a specific client instance with non-default auth and parameters

  • **params (Proxytype) – Parameters under which to run the computation.

Returns

Appropriate Python object representing the result, either as a plain Python type, or object from descarteslabs.workflows.results.

Return type

result

classmethod from_callable(func, *arg_types)[source]
publish(name='', description='', client=None)

Publish this proxy object as a Workflow.

Parameters
  • name (str, default "") – Name for the new Workflow

  • description (str, default "") – Long-form description of this Workflow. Markdown is supported.

  • client (workflows.client.Client, optional) – Allows you to use a specific client instance with non-default auth and parameters

Returns

workflow – The saved Workflow object. workflow.id contains the ID of the new Workflow.

Return type

Workflow