Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f9e07bf
ignore my PyCharm files
skeating May 9, 2019
d8167d0
Merge remote-tracking branch 'origin/master' into 67-add-view-run-exp
skeating May 13, 2019
01969b8
Finally sorted the url and getting a new page displayed
skeating May 13, 2019
f274d1c
corrected name as can use run experiments with either models/protocols
skeating May 13, 2019
c2aade3
change name model -> entity
skeating May 13, 2019
bf4174b
page no lists the appropriate things - tackling version next
skeating May 14, 2019
e93247c
fixed test that worked locally but not in github
skeating May 16, 2019
88ecc0a
sorted the view for my model/protocols
skeating May 17, 2019
5b04abf
add force override checkbox
skeating May 17, 2019
441a1bb
My local set up is not letting me play with js files so adding them s…
skeating May 17, 2019
bc4de21
add url test for runexperiments
skeating May 20, 2019
898e589
getting checkboxes to work as indicated
skeating May 20, 2019
b79fc2c
checkboxes not working as hoped try again
skeating May 20, 2019
7e07e6f
trying checkboxes again
skeating May 20, 2019
010f601
sorry changed context and forgot tests
skeating May 20, 2019
b0f360f
typo in comments
skeating May 21, 2019
9f6a427
Try Jonathan's suggestion to sort checkboxes
skeating May 21, 2019
964d8d0
Made EntityRunExperimentView also inherit PermissionRequiredMixin
skeating May 21, 2019
00bb989
start with latest versions checked
skeating May 21, 2019
6f1019f
update tests for adding permission to run experiment view
skeating May 21, 2019
b56a372
try again with tests - my local setup is clearly not completely accur…
skeating May 22, 2019
3718b94
think I've got it- sorted the tests for permissions on runExperiment
skeating May 22, 2019
75db07d
<ul> tag should be outside for loop
skeating May 22, 2019
cf45cd2
improve query speed
skeating May 22, 2019
0a2dac4
change wording of force override button
skeating May 22, 2019
12d466d
only show Run experiment button if user has permission to create expe…
skeating May 22, 2019
626b5ed
changed hard coded 'model' to get correct entity type
skeating May 22, 2019
9d61b18
Merge remote-tracking branch 'origin/submit-expt-improvements' into 6…
skeating May 23, 2019
dde92d2
In teh interest of time pushing my development work to git so I get a…
skeating May 23, 2019
29415f6
trying to see if this works
skeating May 23, 2019
dd6e4e9
am I actually picking up experiments
skeating May 23, 2019
4137ec8
that confirmed my suspicions - take out the 404 code that I added to …
skeating May 23, 2019
d377474
Merge remote-tracking branch 'origin/master' into 67-add-view-run-exp
skeating May 23, 2019
5ca1340
Merge remote-tracking branch 'origin/master' into 67-add-view-run-exp
skeating May 28, 2019
65e7afe
finally got tings working so I add experiments to PlannedExperiments
skeating May 28, 2019
c6ad76f
divide listed entities into 'My' and 'Other'
skeating May 28, 2019
5a27adf
testing of my vs other lists and running experiments
skeating May 29, 2019
bba5e24
Merge remote-tracking branch 'origin/master' into 67-add-view-run-exp
skeating May 29, 2019
9b1e47d
Got the force or not to force rerun checkbox working
skeating May 29, 2019
e1bf92d
changed spelling of function to be more python-esque Thanks Michael
skeating May 29, 2019
03267f1
Add is_fitting_spec flag, settable when creating protocols
jonc125 May 30, 2019
98558ae
My 'experiments' should link to my experiments...
jonc125 May 30, 2019
2986d68
changed name and added additional test for no checkboxes checked
skeating May 30, 2019
dcf1a71
few more changes from Jonathan - mostly syntax
skeating May 30, 2019
4b7ded9
more changes from Jonathan
skeating May 30, 2019
a9d377b
Add 'show fits' buttons
jonc125 May 30, 2019
ef12137
Support fitting specs in matrix JSON view
jonc125 May 31, 2019
39b48cc
Protocols named 'Fit ...' become fitting specs on migration
jonc125 May 31, 2019
6f6c64b
missed a line
skeating May 31, 2019
114f0b6
filter for experiments with or whithout versions
skeating May 31, 2019
bdb41e1
add test for experiment no versions
skeating May 31, 2019
e555f0a
took out if permission to create experiment
skeating May 31, 2019
9874020
add newline at eof
skeating May 31, 2019
a3a4e6d
Creating expts & editing entities are independent permissions
jonc125 Jun 1, 2019
e616eaf
Funkier way of setting filter args
jonc125 Jun 1, 2019
79334c2
Correct experiment with no versions test
jonc125 Jun 1, 2019
5f501c7
Associate run experiments view with an entity _version_
jonc125 Jun 1, 2019
5952ea7
Merge branch 'master' into 182-fitting-specs
jonc125 Jun 1, 2019
798ad6d
Turn off dev debug by default
jonc125 Jun 1, 2019
24d783b
Fix templatetag test
jonc125 Jun 1, 2019
cf409b6
Fix version name display
jonc125 Jun 1, 2019
7787a98
Remove the switcher from expt view
jonc125 Jun 1, 2019
53dec03
Hacky version of experimental data overlay
jonc125 Jun 1, 2019
775307f
Merge branch 'master' into 67-add-view-run-exp
jonc125 Jun 1, 2019
3df3a0b
Improve key handling
jonc125 Jun 1, 2019
82d5e53
Do overlay on initial load and if dataset loaded second
jonc125 Jun 1, 2019
a2b9408
Add overlay to highcharts
jonc125 Jun 1, 2019
0d6b650
Pass extra args to back-end if doing a fit
jonc125 Jun 1, 2019
7451949
Fix DB migration?
jonc125 Jun 1, 2019
734b0b4
Fix DB migration?
jonc125 Jun 1, 2019
39c22db
Don't show overlay menu if no linked data
jonc125 Jun 1, 2019
b0f87f1
Fix key labels on plots
jonc125 Jun 1, 2019
9da2bad
Merge branch '67-add-view-run-exp' into 182-fitting-specs
jonc125 Jun 3, 2019
cf93f11
Better link to fitting egs
jonc125 Jun 3, 2019
3208fc6
Fix parameter
jonc125 Jun 3, 2019
74c5b77
Put display back on one line
jonc125 Jun 3, 2019
79f9e28
Use tags if available on matrix axes
jonc125 Jun 3, 2019
bd7c2e9
Show _version_ author on detail view
jonc125 Jun 3, 2019
b16de44
Update link again
jonc125 Jun 3, 2019
3211b7e
Don't include blank experiments in comparison options
jonc125 Jun 3, 2019
57138c3
Fix dataset creation permission
jonc125 Jun 3, 2019
f2f43f8
Fix attributes in generated OMEX manifest
jonc125 Jun 3, 2019
5164cfb
Fix expt visibility with moderated entities
jonc125 Jun 3, 2019
7e4d598
Fix run-expt permission check
jonc125 Jun 3, 2019
2dc6d3e
Start recording finishing times for experiments!
jonc125 Jun 3, 2019
584cc4a
Display experiment duration if available
jonc125 Jun 3, 2019
77ce258
Better rendering of checkbox inputs
jonc125 Jun 3, 2019
9cf7b6f
Fix test for version author fix
jonc125 Jun 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ ENV/
# Rope project settings
.ropeproject

# PyCharm files
.idea/

# mkdocs documentation
/site

Expand All @@ -113,5 +116,3 @@ weblab/data/

# media directory
weblab/media/

weblab/\.idea/
2 changes: 1 addition & 1 deletion weblab/config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


DEBUG = True
LOG_DEBUG = DEBUG
LOG_DEBUG = False

ALLOWED_HOSTS = ['*']

Expand Down
6 changes: 3 additions & 3 deletions weblab/core/combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def xml_doc(self):
root,
'{%s}content' % MANIFEST_NS,
**{
('{%s}location' % MANIFEST_NS): path,
('{%s}format' % MANIFEST_NS): fmt,
('{%s}master' % MANIFEST_NS): 'true' if is_master else 'false'
'location': path,
'format': fmt,
'master': 'true' if is_master else 'false'
}
)

Expand Down
2 changes: 1 addition & 1 deletion weblab/datasets/templatetags/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@register.simple_tag(takes_context=True)
def can_create_dataset(context):
user = context['user']
return user.has_perm('datasets.create_dataset_experiment')
return user.has_perm('datasets.create_dataset')


@register.filter
Expand Down
12 changes: 8 additions & 4 deletions weblab/entities/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ class Meta:
class ProtocolEntityForm(EntityForm):
class Meta:
model = ProtocolEntity
fields = ['name']
fields = ['name', 'is_fitting_spec']

is_fitting_spec = forms.BooleanField(
label='This protocol is a parameter fitting specification',
widget=forms.CheckboxInput(attrs={'class': 'inline'}),
required=False)


class EntityVersionForm(forms.Form):
Expand All @@ -57,15 +62,14 @@ class EntityVersionForm(forms.Form):
label='Description of this version',
widget=forms.Textarea)
rerun_expts = forms.BooleanField(
label='',
help_text='Re-run experiments involving the previous version of this %s',
label='Re-run experiments involving the previous version of this %s',
widget=forms.CheckboxInput(attrs={'class': 'inline'}),
required=False)

def __init__(self, *args, **kwargs):
entity_type = kwargs.pop('entity_type')
super().__init__(*args, **kwargs)
self.fields['rerun_expts'].help_text = self.fields['rerun_expts'].help_text % entity_type
self.fields['rerun_expts'].label = self.fields['rerun_expts'].label % entity_type


class EntityChangeVisibilityForm(UserKwargModelFormMixin, forms.Form):
Expand Down
28 changes: 28 additions & 0 deletions weblab/entities/migrations/0014_entity_is_fitting_spec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-05-30 13:02
from __future__ import unicode_literals

from django.db import migrations, models


def set_initial_fitting_specs(apps, schema_editor):
Entity = apps.get_model('entities', 'Entity')
Entity.objects.filter(name__startswith='Fit ').update(is_fitting_spec=True)


class Migration(migrations.Migration):

dependencies = [
('entities', '0013_auto_20190408_1354'),
]

operations = [
migrations.AddField(
model_name='entity',
name='is_fitting_spec',
field=models.BooleanField(
default=False,
help_text='This protocol is a parameter fitting specification'),
),
migrations.RunPython(set_initial_fitting_specs, migrations.RunPython.noop),
]
5 changes: 5 additions & 0 deletions weblab/entities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ class Entity(UserCreatedModelMixin, models.Model):

name = models.CharField(validators=[MinLengthValidator(2)], max_length=255)

is_fitting_spec = models.BooleanField(
default=False,
help_text="This protocol is a parameter fitting specification",
)

class Meta:
ordering = ['name']
unique_together = ('entity_type', 'name', 'author')
Expand Down
7 changes: 7 additions & 0 deletions weblab/entities/templatetags/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,10 @@ def can_delete_entity(context, entity):
def can_manage_entity(context, entity):
user = context['user']
return entity.is_managed_by(user)


@register.filter
def url_run_experiments(entity, commit):
last_tag = _url_friendly_label(entity, commit)
args = [entity.entity_type, entity.id, last_tag]
return reverse('entities:runexperiments', args=args)
13 changes: 13 additions & 0 deletions weblab/entities/tests/test_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,16 @@ def test_url_friendly_label(model_with_version, helpers):
commit3 = helpers.add_version(model_with_version)
model_with_version.repo.tag('latest')
assert entity_tags._url_friendly_label(model_with_version, commit3) == commit3.hexsha


@pytest.mark.django_db
def test_url_runexperiments(model_with_version, protocol_with_version):
model = model_with_version
model_commit = model.repo.latest_commit
assert (entity_tags.url_run_experiments(model, model_commit) ==
'/entities/models/%d/versions/%s/runexperiments' % (model.pk, model_commit.hexsha))

protocol = protocol_with_version
protocol_commit = protocol.repo.latest_commit
assert (entity_tags.url_run_experiments(protocol, protocol_commit) ==
'/entities/protocols/%d/versions/%s/runexperiments' % (protocol.pk, protocol_commit.hexsha))
Loading