genui.models package

Subpackages

Submodules

genui.models.admin module

class genui.models.admin.ModelAdmin(model, admin_site)[source]

Bases: ModelAdmin

property media

genui.models.apps module

class genui.models.apps.ModelsConfig(app_name, app_module)[source]

Bases: AppConfig

name = 'genui.models'
ready()[source]

Override this method in subclasses to run code when Django starts.

genui.models.genuisetup module

genuisetup

Created by: Martin Sicho On: 4/28/20, 4:43 PM

genui.models.genuisetup.setup(*args, **kwargs)[source]

genui.models.helpers module

helpers

Created by: Martin Sicho On: 30-01-20, 13:29

genui.models.helpers.createDefaultModels(project, app)[source]
genui.models.helpers.discoverGenuiModels(container, core_package='genuimodels', modules=('algorithms', 'builders', 'metrics'), force=False, additional_bases=())[source]

genui.models.models module

class genui.models.models.Algorithm(id, corePackage, name)[source]

Bases: ImportableModelComponent

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

corePackage

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

fileFormats

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.

id

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

metrics

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.

name

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

objects = <django.db.models.manager.Manager object>
parameters

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.

trainingstrategy_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.

validModes

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.

class genui.models.models.AlgorithmMode(id, name)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

algorithm_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.

id

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

metrics

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.

name

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

objects = <django.db.models.manager.Manager object>
trainingstrategy_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.

class genui.models.models.BasicValidationStrategy(id, polymorphic_ctype, modelInstance, validationstrategy_ptr, cvFolds, validSetSize)[source]

Bases: ValidationSet, CV

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

cvFolds

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

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
validSetSize

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

validationstrategy_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.

validationstrategy_ptr_id
class genui.models.models.CV(*args, **kwargs)[source]

Bases: ValidationStrategy

class Meta[source]

Bases: object

abstract = False
cvFolds

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

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
validationstrategy_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.

validationstrategy_ptr_id
class genui.models.models.ImportableModelComponent(*args, **kwargs)[source]

Bases: Model

class Meta[source]

Bases: object

abstract = False
corePackage

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

class genui.models.models.Model(id, polymorphic_ctype, name, description, created, updated, project, builder)[source]

Bases: TaskShortcutsMixIn, TaskMixin, DataSet

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

builder

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

builder_id
created

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

description

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

drugexagent

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.

drugexnet

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.

files

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.

generator

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.

get_next_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_next_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, is_next=False, **kwargs)
get_previous_by_updated(*, field=<django.db.models.fields.DateTimeField: updated>, is_next=False, **kwargs)
id

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

map

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.

property modelFile
name

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

objects = <genui.utils.extensions.tasks.models.PolymorphicTaskManager object>
onFileSave(saved: ModelFile)[source]

This will be called when a file is being saved to this model instance. You can throw the ModelFile.Rejected exception if the file is invalid.

Parameters

saved

Returns

performance

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.

polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
qsarmodel

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.

tasks

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

trainingStrategies

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.

property trainingStrategy
updated

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

validationStrategies

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.

property validationStrategy
class genui.models.models.ModelBuilder(id, corePackage, name)[source]

Bases: ImportableModelComponent

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

corePackage

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

id

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

model_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.

name

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

objects = <django.db.models.manager.Manager object>
class genui.models.models.ModelFile(id, modelInstance, kind, note, format, file)[source]

Bases: Model

AUXILIARY = 'aux'
exception DoesNotExist

Bases: ObjectDoesNotExist

exception InvalidFileFormatError(msg)[source]

Bases: Exception

KINDS = [('main', 'Main'), ('aux', 'Auxiliary')]
MAIN = 'main'
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception Rejected(msg)[source]

Bases: Exception

static create(model, name, file_, kind='aux', note=None)[source]
file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
format

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

format_id
static generateAuxFileName(model, fileFormat)[source]
static generateMainFileName(model, fileFormat)[source]
get_kind_display(*, field=<django.db.models.fields.CharField: kind>)
id

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

kind

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

modelInstance

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

modelInstance_id
note

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

objects = <django.db.models.manager.Manager object>
property path
class genui.models.models.ModelFileFormat(id, fileExtension, description)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

algorithm_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.

description

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

fileExtension

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

id

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

modelfile_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.

objects = <django.db.models.manager.Manager object>
class genui.models.models.ModelParameter(id, name, algorithm, contentType, defaultValue)[source]

Bases: Model

BOOL = 'bool'
CONTENT_TYPES = [('string', 'String'), ('bool', 'Logical'), ('integer', 'Integer'), ('float', 'Float')]
exception DoesNotExist

Bases: ObjectDoesNotExist

FLOAT = 'float'
INTEGER = 'integer'
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

STRING = 'string'
algorithm

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

algorithm_id
contentType

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

defaultValue

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

defaultValue_id
get_contentType_display(*, field=<django.db.models.fields.CharField: contentType>)
id

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

modelparametervalue_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.

name

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

objects = <django.db.models.manager.Manager object>
class genui.models.models.ModelParameterBool(id, polymorphic_ctype, parameter, strategy, modelparametervalue_ptr, value)[source]

Bases: ModelParameterValue

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

modelparametervalue_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.

modelparametervalue_ptr_id
static parseValue(val)[source]
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
value

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

class genui.models.models.ModelParameterFloat(id, polymorphic_ctype, parameter, strategy, modelparametervalue_ptr, value)[source]

Bases: ModelParameterValue

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

modelparametervalue_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.

modelparametervalue_ptr_id
static parseValue(val)[source]
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
value

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

class genui.models.models.ModelParameterInt(id, polymorphic_ctype, parameter, strategy, modelparametervalue_ptr, value)[source]

Bases: ModelParameterValue

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

modelparametervalue_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.

modelparametervalue_ptr_id
static parseValue(val)[source]
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
value

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

class genui.models.models.ModelParameterStr(id, polymorphic_ctype, parameter, strategy, modelparametervalue_ptr, value)[source]

Bases: ModelParameterValue

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

modelparametervalue_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.

modelparametervalue_ptr_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
value

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

class genui.models.models.ModelParameterValue(id, polymorphic_ctype, parameter, strategy)[source]

Bases: PolymorphicModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

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

modelparameter_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.

modelparameterbool

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.

modelparameterfloat

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.

modelparameterint

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.

modelparameterstr

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.

parameter

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

parameter_id
static parseValue(val)[source]
polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
strategy

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

strategy_id
class genui.models.models.ModelPerfomanceNN(id, polymorphic_ctype, metric, value, model, modelperformance_ptr, epoch, step)[source]

Bases: ModelPerformance

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

epoch

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

modelperformance_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.

modelperformance_ptr_id
modelperformancedrugex

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.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
step

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

class genui.models.models.ModelPerformance(id, polymorphic_ctype, metric, value, model)[source]

Bases: PolymorphicModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

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

metric

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

metric_id
model

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

model_id
modelperfomancenn

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.

modelperformancecv

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.

points

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.

polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
roccurvepoint

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.

value

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

class genui.models.models.ModelPerformanceCV(id, polymorphic_ctype, metric, value, model, modelperformance_ptr, fold)[source]

Bases: ModelPerformance

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

fold

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

modelperformance_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.

modelperformance_ptr_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
class genui.models.models.ModelPerformanceMetric(id, corePackage, name, description)[source]

Bases: ImportableModelComponent

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

corePackage

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

description

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

id

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

modelperformance_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.

name

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

objects = <django.db.models.manager.Manager object>
validAlgorithms

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.

validModes

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.

validationstrategy_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.

class genui.models.models.ROCCurvePoint(id, polymorphic_ctype, metric, value, model, modelperformance_ptr, fpr, auc)[source]

Bases: ModelPerformance

exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

auc

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

auc_id
fpr

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

modelperformance_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.

modelperformance_ptr_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
property tpr
class genui.models.models.TrainingStrategy(id, polymorphic_ctype, algorithm, mode, modelInstance)[source]

Bases: PolymorphicModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

algorithm

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

algorithm_id
drugexagenttraining

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.

drugexnettraining

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.

id

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

mappingstrategy

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.

mode

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

mode_id
modelInstance

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

modelInstance_id
parameters

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.

polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
processMetaData(metadata)[source]
qsartrainingstrategy

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.

class genui.models.models.ValidationSet(*args, **kwargs)[source]

Bases: ValidationStrategy

class Meta[source]

Bases: object

abstract = False
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
validSetSize

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

validationstrategy_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.

validationstrategy_ptr_id
class genui.models.models.ValidationStrategy(id, polymorphic_ctype, modelInstance)[source]

Bases: PolymorphicModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

basicvalidationstrategy

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.

drugexagentvalidation

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.

drugexnetvalidation

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.

id

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

metrics

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.

modelInstance

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

modelInstance_id
polymorphic_ctype

The model field that stores the ContentType reference to the actual class.

polymorphic_ctype_id
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False

genui.models.serializers module

serializers

Created by: Martin Sicho On: 24-01-20, 14:44

class genui.models.serializers.AlgorithmModeSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name')
model

alias of AlgorithmMode

class genui.models.serializers.AlgorithmSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'fileFormats', 'parameters', 'validModes')
model

alias of Algorithm

class genui.models.serializers.BasicValidationStrategyInitSerializer(*args, **kwargs)[source]

Bases: ValidationStrategySerializer

class Meta[source]

Bases: object

fields = ('metrics', 'cvFolds', 'validSetSize')
model

alias of BasicValidationStrategy

class genui.models.serializers.BasicValidationStrategySerializer(*args, **kwargs)[source]

Bases: BasicValidationStrategyInitSerializer

class genui.models.serializers.ModelFileFormatSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'fileExtension', 'description')
model

alias of ModelFileFormat

class genui.models.serializers.ModelFileSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'file', 'format', 'kind', 'model', 'note')
model

alias of ModelFile

read_only_fields = ('id', 'format')
create(validated_data)[source]

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class genui.models.serializers.ModelParameterSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'contentType', 'defaultValue')
model

alias of ModelParameter

read_only_fields = ('defaultValue',)
get_defaultValue(obj)[source]
class genui.models.serializers.ModelParameterValueSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'parameter', 'value')
model

alias of ModelParameterValue

class genui.models.serializers.ModelPerformanceMetricSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'validAlgorithms', 'validModes')
model

alias of ModelPerformanceMetric

class genui.models.serializers.ModelPerformanceSerializer(*args, **kwargs)[source]

Bases: GenericModelSerializerMixIn, HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'value', 'metric', 'className', 'extraArgs')
model

alias of ModelPerformance

class genui.models.serializers.ModelSerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('id', 'name', 'description', 'created', 'updated', 'project', 'trainingStrategy', 'validationStrategy', 'modelFile', 'build', 'taskID')
model

alias of Model

read_only_fields = ('id', 'created', 'updated', 'modelFile', 'taskID')
create(validated_data, **kwargs)[source]

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

static saveParameters(strat_instance: TrainingStrategy, strat_data)[source]
useBuilder(builder_class)[source]
class genui.models.serializers.TrainingStrategyInitSerializer(*args, **kwargs)[source]

Bases: TrainingStrategySerializer

class Meta[source]

Bases: object

fields = ('algorithm', 'mode', 'parameters')
model

alias of TrainingStrategy

class genui.models.serializers.TrainingStrategySerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('algorithm', 'mode', 'parameters')
model

alias of TrainingStrategy

class genui.models.serializers.ValidationStrategyInitSerializer(*args, **kwargs)[source]

Bases: ValidationStrategySerializer

class Meta[source]

Bases: object

fields = ('metrics',)
model

alias of ValidationStrategy

class genui.models.serializers.ValidationStrategySerializer(*args, **kwargs)[source]

Bases: HyperlinkedModelSerializer

class Meta[source]

Bases: object

fields = ('metrics',)
model

alias of ValidationStrategy

genui.models.signals module

signals

Created by: Martin Sicho On: 17-01-20, 10:13

genui.models.signals.delete_model_remove_files(sender, instance, using, **kwargs)[source]
genui.models.signals.save_model_checks(sender, instance, using, **kwargs)[source]
genui.models.signals.save_model_file_callback(sender, instance, using, **kwargs)[source]

genui.models.tests module

genui.models.urls module

urls

Created by: Martin Sicho On: 5/3/20, 6:13 PM

genui.models.views module

class genui.models.views.AlgorithmViewSet(**kwargs)[source]

Bases: ListModelMixin, RetrieveModelMixin, GenericViewSet

queryset
serializer_class

alias of AlgorithmSerializer

class genui.models.views.BuildMixIn[source]

Bases: object

build_task = None
builder_class = None
get_build_task()[source]
get_builder_class(asName=True)[source]
get_serializer_class()[source]
init_serializer_class = None
class genui.models.views.FilterToModelMixin[source]

Bases: object

get_queryset()[source]
lookup_field = 'model'
model_class = None
class genui.models.views.MetricsViewSet(**kwargs)[source]

Bases: ListModelMixin, RetrieveModelMixin, GenericViewSet

queryset
serializer_class

alias of ModelPerformanceMetricSerializer

class genui.models.views.ModelFileView(**kwargs)[source]

Bases: FilterToModelMixin, FilterToUserMixIn, ListCreateAPIView

create(request, *args, **kwargs)[source]
lookup_field = 'modelInstance'
owner_relation = 'modelInstance__project__owner'
parser_classes = (<class 'rest_framework.parsers.MultiPartParser'>,)
queryset
serializer_class

alias of ModelFileSerializer

class genui.models.views.ModelPerformanceListView(**kwargs)[source]

Bases: FilterToModelMixin, FilterToUserMixIn, ListAPIView

owner_relation = 'model__project__owner'
pagination_class

alias of PerformancePagination

queryset
serializer_class

alias of ModelPerformanceSerializer

class genui.models.views.ModelViewSet(**kwargs)[source]

Bases: FilterToProjectMixIn, FilterToUserMixIn, BuildMixIn, ModelViewSet

create(request, *args, **kwargs)[source]
get_builder_kwargs()[source]
list(request, *args, **kwargs)[source]
owner_relation = 'project__owner'
project_id_param = {'description': 'ID of a project to limit the list of results to.', 'in': 'query', 'name': 'project_id', 'type': 'number'}
class genui.models.views.PerformancePagination[source]

Bases: GenuiPagination

page_size = 10
class genui.models.views.PredictMixIn[source]

Bases: object

get_predict_task()[source]
predict_task = None

Module contents