django_analyses.models.input.definitions package

Submodules

django_analyses.models.input.definitions.boolean_input_definition module

class django_analyses.models.input.definitions.boolean_input_definition.BooleanInputDefinition(id, key, description, required, is_configuration, value_attribute, db_value_preprocessing, run_method_input, content_type, field_name, inputdefinition_ptr, default, is_output_switch)

Bases: django_analyses.models.input.definitions.input_definition.InputDefinition

default

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_type() → django_analyses.models.input.definitions.input_definitions.InputDefinitions
input_class

alias of django_analyses.models.input.types.boolean_input.BooleanInput

input_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

inputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

inputdefinition_ptr_id
is_output_switch

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

django_analyses.models.input.definitions.directory_input_definition module

class django_analyses.models.input.definitions.directory_input_definition.DirectoryInputDefinition(id, key, description, required, is_configuration, value_attribute, db_value_preprocessing, run_method_input, content_type, field_name, inputdefinition_ptr, is_output_directory, default)

Bases: django_analyses.models.input.definitions.input_definition.InputDefinition

default

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_type() → django_analyses.models.input.definitions.input_definitions.InputDefinitions
input_class

alias of django_analyses.models.input.types.directory_input.DirectoryInput

input_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

inputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

inputdefinition_ptr_id
is_output_directory

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

django_analyses.models.input.definitions.file_input_definition module

class django_analyses.models.input.definitions.file_input_definition.FileInputDefinition(id, key, description, required, is_configuration, value_attribute, db_value_preprocessing, run_method_input, content_type, field_name, inputdefinition_ptr, default)

Bases: django_analyses.models.input.definitions.input_definition.InputDefinition

default

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_type() → django_analyses.models.input.definitions.input_definitions.InputDefinitions
input_class

alias of django_analyses.models.input.types.file_input.FileInput

input_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

inputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

inputdefinition_ptr_id

django_analyses.models.input.definitions.float_input_definition module

class django_analyses.models.input.definitions.float_input_definition.FloatInputDefinition(id, key, description, required, is_configuration, value_attribute, db_value_preprocessing, run_method_input, content_type, field_name, inputdefinition_ptr, numberinputdefinition_ptr, min_value, max_value, default)

Bases: django_analyses.models.input.definitions.number_input_definition.NumberInputDefinition

default

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_type() → django_analyses.models.input.definitions.input_definitions.InputDefinitions
input_class

alias of django_analyses.models.input.types.float_input.FloatInput

input_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

max_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

min_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numberinputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

numberinputdefinition_ptr_id

django_analyses.models.input.definitions.input_definition module

Definition of the InputDefinition class.

class django_analyses.models.input.definitions.input_definition.InputDefinition(*args, **kwargs)

Bases: django.db.models.base.Model

Represents a single input definition in the database. Instances are used to as the building blocks for InputSpecification instances.

booleaninputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

check_input_class_definition() → None

Checks the validity of the assigned input_class.

Raises:ValidationError – Invalid input_class definition
content_type

If this input’s value references the value of a field in the database, this references the field’s model.

content_type_id
db_value_preprocessing

If values passed as inputs matching this input definition should be extracted from some object, this field specifies the name of the attribute which will be called using get_db_value().

default = None

Child models may allow setting a default value using the appropriate Field subclass.

description

A description of this input definition.

directoryinputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

extract_nested_value(obj: Any, location: str) → Any

Extract some nested attribute within an object.

Parameters:
  • obj (Any) – The object containing the nested value
  • location (str) – Address of nested attribute within object
Returns:

Nested attribute value

Return type:

Any

field_name

If this input’s value references the value of a field in the database, this references the field’s name within the :att:`content_type` model.

fileinputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

get_db_value(value: Any) → Any

Returns the appropriate DB value for inputs in which db_value_preprocessing is defined.

Parameters:value (Any) – The object containing the nested value
Returns:Nested attribute value
Return type:Any
Raises:ValueError – Value extraction failure
get_or_create_input_instance(**kwargs) → django_analyses.models.input.input.Input

Creates an instance of the appropriate django_analyses.models.input.input.Input subclass.

Returns:Created instance
Return type:Input
input_class = None

Each definition should override this class attribute in order to allow for Input instances creation.

is_configuration

Whether this input definition is a configuration of the analysis parameters or, e.g., a definition of the input or output of it.

key

Input key used when passing inputs to run some analysis.

listinputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

numberinputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

objects = <django_analyses.models.managers.input_definition.InputDefinitionManager object>
pipe_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

required

Whether this input is required for the execution of the analysis.

run_method_input

Whether the created inputs instances should be passed to interface’s class at initialization (False) or upon calling the run method (True).

save(*args, **kwargs)

Overrides the model’s save() method to provide custom functionality.

specification_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

stringinputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

validate() → None

Validates input definition instances before calling save(). This method should be overridden by subclasses that require some kind of custom validation.

value_attribute

If the actual input to the analysis class is meant to be some attribute of given input, the attribute name may be set here.

django_analyses.models.input.definitions.input_definitions module

class django_analyses.models.input.definitions.input_definitions.InputDefinitions

Bases: enum.Enum

An enumeration.

BLN = 'Boolean'
DIR = 'Directory'
FIL = 'File'
FLT = 'Float'
INT = 'Integer'
LST = 'List'
STR = 'String'

django_analyses.models.input.definitions.integer_input_definition module

class django_analyses.models.input.definitions.integer_input_definition.IntegerInputDefinition(id, key, description, required, is_configuration, value_attribute, db_value_preprocessing, run_method_input, content_type, field_name, inputdefinition_ptr, numberinputdefinition_ptr, min_value, max_value, default)

Bases: django_analyses.models.input.definitions.number_input_definition.NumberInputDefinition

default

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_type() → django_analyses.models.input.definitions.input_definitions.InputDefinitions
input_class

alias of django_analyses.models.input.types.integer_input.IntegerInput

input_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

max_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

min_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numberinputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

numberinputdefinition_ptr_id

django_analyses.models.input.definitions.list_input_definition module

class django_analyses.models.input.definitions.list_input_definition.ListInputDefinition(id, key, description, required, is_configuration, value_attribute, db_value_preprocessing, run_method_input, content_type, field_name, inputdefinition_ptr, element_type, min_length, max_length, default, as_tuple)

Bases: django_analyses.models.input.definitions.input_definition.InputDefinition

as_tuple

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

default

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

element_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

expected_type_definition
get_element_type_display(*, field=<django.db.models.fields.CharField: element_type>)
get_type() → django_analyses.models.input.definitions.input_definitions.InputDefinitions
input_class

alias of django_analyses.models.input.types.list_input.ListInput

input_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

inputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

inputdefinition_ptr_id
max_length

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

min_length

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

raise_max_length_error() → None
raise_min_length_error() → None
raise_not_list_error() → None
raise_wrong_type_error() → None
validate()

Validates input definition instances before calling save(). This method should be overridden by subclasses that require some kind of custom validation.

validate_default_value() → None
validate_default_value_max_length() → bool
validate_default_value_min_length() → bool
validate_elements_type_for_default() → bool

django_analyses.models.input.definitions.messages module

django_analyses.models.input.definitions.number_input_definition module

class django_analyses.models.input.definitions.number_input_definition.NumberInputDefinition(id, key, description, required, is_configuration, value_attribute, db_value_preprocessing, run_method_input, content_type, field_name, inputdefinition_ptr)

Bases: django_analyses.models.input.definitions.input_definition.InputDefinition

floatinputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

inputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

inputdefinition_ptr_id
integerinputdefinition

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

raise_default_over_max_error()
raise_default_under_min_error()
validate() → None

Validates input definition instances before calling save(). This method should be overridden by subclasses that require some kind of custom validation.

validate_default()

django_analyses.models.input.definitions.string_input_definition module

Definition of the StringInputDefinition class.

class django_analyses.models.input.definitions.string_input_definition.StringInputDefinition(*args, **kwargs)

Bases: django_analyses.models.input.definitions.input_definition.InputDefinition

Represents a single string input definition in the database.

choices

Possible choices for the string input value.

default

Default value.

dynamic_default

Dynamic default value expressed as some formatting template which requires run-dependent information.

get_type() → django_analyses.models.input.definitions.input_definitions.InputDefinitions
input_class

alias of django_analyses.models.input.types.string_input.StringInput

input_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

inputdefinition_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

inputdefinition_ptr_id
is_output_path

Whether this string determines the output path of the analysis.

is_output_switch

Whether this string determines if some output will be generated or not.

max_length

Maximal string length.

min_length

Minimal string length.

validate() → None

Overrides django_analyses.models.input.definitions.input_definition.InputDefinition.validate() to validate choices (in cases where choices is defined).

Raises:ValidationError – Invalid choice

Module contents

InputDefinition subclasses are used to create an InputSpecification that may be associated with some AnalysisVersion. Each type of input definition is used describe some kind of input that could be passed to associated AnalysisVersion.