Primitives

Classes

Number(obj)

Abstract base class for numeric Proxytypes.

Primitive(obj)

Proxy wrapper around a Python primitive type.

Int(obj)

Proxy int

Float(obj)

Proxy float

Bool(obj)

Proxy bool

Str(obj)

Proxy str

NoneType(obj)

Proxy type(None)

Any(value)

Generic Proxytype that supports almost all operations.

class Number(obj)[source]

Abstract base class for numeric Proxytypes.

Use the concrete subtypes Int and Float instead; Number cannot be instantiated and should only be used for isinstance() checks.

You can explicitly construct one numeric type from another, performing a cast (Int(Float(4.2))), but one numeric type will not implicitly promote to another (Int._promote(Float(4.2)) will fail).

Methods

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

Compute this proxy object and wait for its result.

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

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

class Primitive(obj)[source]

Proxy wrapper around a Python primitive type.

Do not use Primitive directly; instead, use one of the built-in subtypes (Int, Str, etc.)

Methods

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

Compute this proxy object and wait for its result.

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

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

class Int(obj)[source]

Proxy int

Methods

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

Compute this proxy object and wait for its result.

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

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

class Float(obj)[source]

Proxy float

Methods

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

Compute this proxy object and wait for its result.

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

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

class Bool(obj)[source]

Proxy bool

Methods

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

Compute this proxy object and wait for its result.

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

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

class Str(obj)[source]

Proxy str

Methods

capitalize()

Return a capitalized version of the string.

center(width[, fillchar])

Return a centered string of length width.

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

Compute this proxy object and wait for its result.

contains(other)

Whether this string contains the given substring (returns Bool)

count(sub)

Return an Int of the number of non-overlapping occurrences of the substring sub in this string.

endswith(suffix)

Return True if S ends with the specified suffix, False otherwise.

expandtabs([tabsize])

Return a copy where all tab characters are expanded using spaces.

find(sub)

Return the lowest index in S where substring sub is found in this string.

format(*args, **kwargs)

Return a formatted version of S, using substitutions from args and kwargs.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

isdigit()

Return True if the string is a digit string, False otherwise.

islower()

Return True if the string is a lowercase string, False otherwise.

isspace()

Return True if the string is a whitespace string, False otherwise.

istitle()

Return True if the string is a title-cased string, False otherwise.

isupper()

Return True if the string is an uppercase string, False otherwise.

join(strings)

Concatenate a List[Str].

length()

The length of the string (returns Int)

ljust(width[, fillchar])

Return a left-justified string of length width.

lower()

Return a copy of the string converted to lowercase.

lstrip([chars])

Return a copy of the string with leading whitespace removed.

partition(sep)

Partition the string into three parts using the given separator.

publish([name, description, client])

Publish this proxy object as a Workflow.

replace(old, new[, count])

Return a copy with all occurrences of substring old replaced by new.

rfind(sub)

Return the highest index in S where substring sub is found.

rjust(width[, fillchar])

Return a right-justified string of length width.

rpartition(sep)

Partition the string into three parts using the given separator.

rsplit([sep, maxsplit])

Return a list of the words in the string, using sep as the delimiter string.

rstrip([chars])

Return a copy of the string with trailing whitespace removed.

split([sep, maxsplit])

Return a List[Str] of the words in the string, using sep as the delimiter string.

splitlines()

Return a List[Str] of the lines in the string, breaking at line boundaries.

startswith(prefix)

Return True if S starts with the specified prefix, False otherwise.

strip([chars])

Return a copy of the string with leading and trailing whitespace remove.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

upper()

Return a copy of the string converted to uppercase.

zfill(width)

Pad a numeric string with zeros on the left, to fill a field of the given width.

capitalize()[source]

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

center(width, fillchar=' ')[source]

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

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

contains(other)[source]

Whether this string contains the given substring (returns Bool)

count(sub)[source]

Return an Int of the number of non-overlapping occurrences of the substring sub in this string.

endswith(suffix)[source]

Return True if S ends with the specified suffix, False otherwise.

expandtabs(tabsize=8)[source]

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub)[source]

Return the lowest index in S where substring sub is found in this string.

Return -1 on failure.

format(*args, **kwargs)[source]

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{‘ and ‘}’).

isalnum()[source]

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()[source]

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isdigit()[source]

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

islower()[source]

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isspace()[source]

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()[source]

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()[source]

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(strings)[source]

Concatenate a List[Str].

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: wf.Str('.').join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'

length()[source]

The length of the string (returns Int)

ljust(width, fillchar=' ')[source]

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()[source]

Return a copy of the string converted to lowercase.

lstrip(chars=None)[source]

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

partition(sep)[source]

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a Tuple[Str, Str, Str] containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a Tuple[Str, Str, Str] containing the original string and two empty strings.

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

replace(old, new, count=-1)[source]

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub)[source]

Return the highest index in S where substring sub is found.

Return -1 on failure.

rjust(width, fillchar=' ')[source]

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep)[source]

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)[source]

Return a list of the words in the string, using sep as the delimiter string.

sep

The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result.

maxsplit

Maximum number of splits to do. -1 (the default value) means no limit.

Splits are done starting at the end of the string and working to the front.

rstrip(chars=None)[source]

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)[source]

Return a List[Str] of the words in the string, using sep as the delimiter string.

sep

The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result.

maxsplit

Maximum number of splits to do. -1 (the default value) means no limit.

splitlines()[source]

Return a List[Str] of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting strings.

startswith(prefix)[source]

Return True if S starts with the specified prefix, False otherwise.

strip(chars=None)[source]

Return a copy of the string with leading and trailing whitespace remove.

If chars is given and not None, remove characters in chars instead.

swapcase()[source]

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()[source]

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

upper()[source]

Return a copy of the string converted to uppercase.

zfill(width)[source]

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class NoneType(obj)[source]

Proxy type(None)

Methods

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

Compute this proxy object and wait for its result.

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

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

class Any(value)[source]

Generic Proxytype that supports almost all operations.

Methods

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

Compute this proxy object and wait for its result.

contains(other)

Contains is equivalient to the Python in operator.

length()

Length is equivalent to the Python len operator.

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

contains(other)[source]

Contains is equivalient to the Python in operator.

Parameters

other (Proxytype) – A Proxytype or type that can be promoted to a Proxytype

Returns

A Boolean ProxyType

Return type

Boolean

length()[source]

Length is equivalent to the Python len operator.

Returns

An Int proxytype

Return type

Int

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