-
Notifications
You must be signed in to change notification settings - Fork 2
Introduction of runnable base class to assist with introduction of fitting specs #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d26f06b
Introduction of runnable entity
sroderick-g5sro 460aea3
Runnable class - resolve unit test failures
sroderick-g5sro f28644c
Runnable class - resolve unit test failures
sroderick-g5sro a0eb411
Changed linkage to experiment via experiment version
sroderick-g5sro d6f2972
renamed migration method to reference correct entity
sroderick-g5sro c982b88
Whitespace issue
sroderick-g5sro d6f0629
change migration path for upgrade to runnable base class
sroderick-g5sro ae7aa19
revert accidental check-in
sroderick-g5sro 34ad42a
Changed migration link to runnable
sroderick-g5sro 90e70f8
Corrected mapping to experiment in email template
sroderick-g5sro 6da1298
Changed migration link to runnable
sroderick-g5sro 13e86e8
Refactor experiment_version to runnable
sroderick-g5sro dfe184f
isort correction
sroderick-g5sro 41a8e98
Alternative approach to migrations
jonc125 f094e49
Fix template so it refers to runnable
jonc125 7f8bbdc
Tidying
jonc125 0450c51
I missed a migration!
jonc125 b10b447
Fix the expt detail view
jonc125 8b1ee4b
Why don't tests flag this as an error?
jonc125 4abf49f
Now the test fails for the right reason!
jonc125 f6a190c
Fix the test again
jonc125 3384655
Fix other tests that assumed entity names
jonc125 8cb7486
Merge pull request #260 from ModellingWebLab/template-testing
jonc125 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| from django.apps import AppConfig | ||
| from django.db.models.signals import pre_delete | ||
|
|
||
| from .signals import experiment_version_deleted, running_experiment_deleted | ||
| from .signals import runnable_deleted, running_experiment_deleted | ||
|
|
||
|
|
||
| class ExperimentsConfig(AppConfig): | ||
| name = 'experiments' | ||
|
|
||
| def ready(self): | ||
| from .models import ExperimentVersion, RunningExperiment | ||
| from .models import Runnable, RunningExperiment | ||
|
|
||
| pre_delete.connect(experiment_version_deleted, ExperimentVersion) | ||
| pre_delete.connect(runnable_deleted, Runnable) | ||
| pre_delete.connect(running_experiment_deleted, RunningExperiment) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # Generated by Django 1.11.20 on 2020-03-16 16:52 | ||
| from __future__ import unicode_literals | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('experiments', '0024_merge_20200211_0929'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RenameModel( | ||
| old_name='ExperimentVersion', | ||
| new_name='Runnable', | ||
| ), | ||
| migrations.RemoveIndex( | ||
| model_name='runnable', | ||
| name='experiments_created_00e2f1_idx', | ||
| ), | ||
| migrations.AddIndex( | ||
| model_name='runnable', | ||
| index=models.Index(fields=['created_at'], name='experiments_created_a4e4b7_idx'), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # Generated by Django 1.11.20 on 2020-03-16 17:00 | ||
| from __future__ import unicode_literals | ||
|
|
||
| from django.db import migrations, models | ||
| import django.db.models.deletion | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
sroderick-g5sro marked this conversation as resolved.
|
||
|
|
||
| dependencies = [ | ||
| ('experiments', '0025_auto_20200316_1652'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name='ExperimentVersion', | ||
| fields=[ | ||
| ('runnable_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='experiments.Runnable')), | ||
| ('experiment_key', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='versions_copy', to='experiments.Experiment')), | ||
| ], | ||
| options={ | ||
| 'abstract': False, | ||
| }, | ||
| bases=('experiments.runnable',), | ||
| ), | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # Generated by Django 1.11.20 on 2020-03-16 17:02 | ||
| from __future__ import unicode_literals | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
|
|
||
| def runnable_to_exp_version(apps, schema_editor): | ||
| ExperimentVersion = apps.get_model('experiments', 'ExperimentVersion') | ||
| Runnable = apps.get_model('experiments', 'Runnable') | ||
| for runnable in Runnable.objects.all(): | ||
| experiment_version = ExperimentVersion(runnable_ptr=runnable, | ||
| experiment_key_id=runnable.experiment_id) | ||
| experiment_version.save_base(raw=True) | ||
|
|
||
|
|
||
| def exp_version_to_runnable(apps, schema_editor): | ||
| ExperimentVersion = apps.get_model('experiments', 'ExperimentVersion') | ||
| Runnable = apps.get_model('experiments', 'Runnable') | ||
| for experiment_version in ExperimentVersion.objects.all(): | ||
| runnable = experiment_version.runnable_ptr | ||
| runnable.experiment_id = experiment_version.experiment_key_id | ||
| runnable.save() | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('experiments', '0026_experimentversion'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RunPython(runnable_to_exp_version, exp_version_to_runnable), | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.