예제 #1
0
def experiment_group_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Add code reference
    assign_code_reference(instance)
    # Check if params need to be set
    if not instance.params and instance.specification:
        instance.params = instance.specification.settings.to_dict()
예제 #2
0
def add_experiment_pre_save(sender, **kwargs):
    instance = kwargs['instance']
    # Check if declarations need to be set
    if not instance.declarations and instance.specification:
        instance.declarations = instance.specification.declarations

    # Add code reference
    # Check if :
    # the experiment is new
    # that it has an exec section
    # that it's not cloned
    # that is not an external repo (because we did not clone it yet)
    # if the instance has a primary key then is getting updated
    condition = (
        not instance.specification or
        not instance.specification.run_exec or
        instance.specification.run_exec.git or
        instance.code_reference or
        not instance.project.has_code)
    if condition:
        return

    assign_code_reference(instance)
예제 #3
0
def add_notebook_code_reference(sender, **kwargs):
    assign_code_reference(kwargs['instance'])
예제 #4
0
def add_tensorboard_code_reference(sender, **kwargs):
    assign_code_reference(kwargs['instance'])