smttask.base.TaskInput#

class smttask.base.TaskInput(*args, digest: str = None, hashed_digest: str = None, unhashed_digests: dict = {}, **kwargs)#

Base class for task inputs. Each Task defines a new TaskInput class, which subclasses this one.

The following attributes are disallowed and will raise an error if they are part of the list of inputs:

  • reason

  • digest

  • arg0

  • _digest_length

  • _unhashed_params

  • _disallowed_input_names

The class variable _unhashed_params is a list of attribute names which are not hashed as part of the digest, but appended to it in the format ‘{hash}__{θ1 name}_{θ1 val}__{θ2 name}_{θ2 val}…’. This is used by the Iterative task, to be able to recognize runs with the same parameters but just different numbers of iterations.

__init__(*args, **kwargs)#

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Methods

__init__(*args, **kwargs)

Create a new model by parsing and validating input data from keyword arguments.

compute_hashed_digest()

The method compute_hashed_digest is called once during task instantiation and stored in the hashed_digest attribute.

compute_unhashed_digests()

The method compute_unhashed_digest is called once during task instantiation and stored in the hashed_digest attribute.

construct([_fields_set])

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.

copy(*[, include, exclude, update, deep])

Duplicate a model, optionally choose which fields to include, exclude and change.

describe()

dict(*[, include, exclude, by_alias, ...])

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

digest_encoder(value)

Specialized encoder for computing digests.

display_block()

from_orm(obj)

json(*[, include, exclude, by_alias, ...])

Generate a JSON representation of the model, include and exclude arguments as per dict().

load([progbar])

Return a copy, with all lazy inputs resolved:

parse_file(path, *[, content_type, ...])

parse_obj(obj)

parse_raw(b, *[, content_type, encoding, ...])

schema([by_alias, ref_template])

schema_json(*[, by_alias, ref_template])

update_forward_refs(**localns)

Try to update ForwardRefs on fields based on this Model, globalns and localns.

validate(value)

Attributes

digest

hashed_digest

unhashed_digests