django-to-galaxy 0.6.4__tar.gz → 0.6.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of django-to-galaxy might be problematic. Click here for more details.
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/PKG-INFO +2 -1
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/invocation.py +16 -7
- django_to_galaxy-0.6.7/django_to_galaxy/migrations/0009_galaxyoutputfile_unique_galaxy_id_per_invocation.py +20 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/galaxy_output_file.py +11 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/invocation.py +39 -15
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/version.py +1 -1
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/pyproject.toml +1 -1
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/LICENSE +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/__init__.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/__init__.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/galaxy_element.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/galaxy_instance.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/galaxy_output_file.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/galaxy_user.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/history.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/tag.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/workflow.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/__init__.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/asymetricslugrelatedfield.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/galaxy_instance.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/galaxy_output_file.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/galaxy_user.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/history.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/invocation.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/invoke_workflow.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/upload_to_history.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/workflow.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/urls.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/create_history.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/galaxy_instance.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/galaxy_output_file.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/galaxy_user.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/history.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/invocation.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/invoke_workflow.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/upload_to_history.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/workflow.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/apps.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0001_new_initial.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0002_rename_state_history_galaxy_state_and_more.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0003_invocation_create_time.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0004_alter_galaxyuser_email_galaxyoutputfile.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0005_alter_galaxyoutputfile_invocation_and_more.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0006_tag_history_tags_workflow_tags.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0007_format_alter_history_tags_alter_workflow_tags_and_more.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0008_workflowinput_label.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/__init__.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/__init__.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/accepted_input.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/galaxy_element.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/galaxy_instance.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/galaxy_user.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/history.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/workflow.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/schemas/__init__.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/schemas/dataset.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/settings.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/templates/admin/import_workflows.html +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/urls.py +0 -0
- {django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-to-galaxy
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.7
|
|
4
4
|
Summary: Django extension that eases communication with Galaxy instance to execute workflows.
|
|
5
5
|
Author: Kenzo-Hugo Hillion
|
|
6
6
|
Author-email: hillion.kenzo@posteo.net
|
|
@@ -9,6 +9,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.9
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Requires-Dist: Django (>=4.0.3,<5.0.0)
|
|
13
14
|
Requires-Dist: Markdown (>=3.3.6,<4.0.0)
|
|
14
15
|
Requires-Dist: bioblend (>=0.16.0,<0.17.0)
|
|
@@ -36,13 +36,22 @@ class InvocationAdmin(GalaxyElementAdmin):
|
|
|
36
36
|
|
|
37
37
|
@admin.display(description="Percentage Done")
|
|
38
38
|
def display_percentage_done(self, obj):
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
try:
|
|
40
|
+
return format_html(
|
|
41
|
+
"""
|
|
42
|
+
<progress value="{0}" max="100"></progress>
|
|
43
|
+
<span style="font-weight:bold">{0}%</span>
|
|
44
|
+
""",
|
|
45
|
+
obj.percentage_done,
|
|
46
|
+
)
|
|
47
|
+
except ZeroDivisionError:
|
|
48
|
+
return format_html(
|
|
49
|
+
"""
|
|
50
|
+
<progress value="{0}" max="100"></progress>
|
|
51
|
+
<span style="font-weight:bold">{0}%</span>
|
|
52
|
+
""",
|
|
53
|
+
0,
|
|
54
|
+
)
|
|
46
55
|
|
|
47
56
|
def _get_message_invocation(
|
|
48
57
|
self,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated by Django 4.1 on 2023-10-27 11:17
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
("django_to_galaxy", "0008_workflowinput_label"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddConstraint(
|
|
14
|
+
model_name="galaxyoutputfile",
|
|
15
|
+
constraint=models.UniqueConstraint(
|
|
16
|
+
fields=("galaxy_id", "invocation"),
|
|
17
|
+
name="unique_galaxy_id_per_invocation",
|
|
18
|
+
),
|
|
19
|
+
),
|
|
20
|
+
]
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/galaxy_output_file.py
RENAMED
|
@@ -40,3 +40,14 @@ class GalaxyOutputFile(models.Model):
|
|
|
40
40
|
|
|
41
41
|
def __str__(self):
|
|
42
42
|
return f"{self.history_name} (from {self.invocation.galaxy_id})"
|
|
43
|
+
|
|
44
|
+
class Meta:
|
|
45
|
+
constraints = [
|
|
46
|
+
models.UniqueConstraint(
|
|
47
|
+
fields=(
|
|
48
|
+
"galaxy_id",
|
|
49
|
+
"invocation",
|
|
50
|
+
),
|
|
51
|
+
name="unique_galaxy_id_per_invocation",
|
|
52
|
+
)
|
|
53
|
+
]
|
|
@@ -10,6 +10,7 @@ from .galaxy_output_file import GalaxyOutputFile
|
|
|
10
10
|
|
|
11
11
|
from django_to_galaxy.utils import enabled_cache
|
|
12
12
|
|
|
13
|
+
from django.core.exceptions import ObjectDoesNotExist
|
|
13
14
|
|
|
14
15
|
RUNNING = "running"
|
|
15
16
|
DONE = "done"
|
|
@@ -58,17 +59,35 @@ class Invocation(models.Model):
|
|
|
58
59
|
"""Get galaxy object using bioblend."""
|
|
59
60
|
return self.workflow.galaxy_owner.obj_gi.invocations.get(self.galaxy_id)
|
|
60
61
|
|
|
62
|
+
def complet_jobs_summary(self, step):
|
|
63
|
+
subinv = self.galaxy_invocation.gi.invocations.get(
|
|
64
|
+
step.wrapped["subworkflow_invocation_id"]
|
|
65
|
+
)
|
|
66
|
+
sub_jobs_summary = subinv.step_jobs_summary()
|
|
67
|
+
for job in sub_jobs_summary:
|
|
68
|
+
self.step_jobs_summary.append(job)
|
|
69
|
+
for sub in subinv.steps:
|
|
70
|
+
if "subworkflow_invocation_id" in sub.wrapped:
|
|
71
|
+
if sub.wrapped["subworkflow_invocation_id"]:
|
|
72
|
+
self.complet_jobs_summary(sub)
|
|
73
|
+
|
|
61
74
|
@property
|
|
62
75
|
def percentage_done(self) -> float:
|
|
63
76
|
"""Retrieve percentage of jobs done for the invocation."""
|
|
64
77
|
if self.status == DONE:
|
|
65
78
|
return 100.0
|
|
66
|
-
step_jobs_summary = self.galaxy_invocation.step_jobs_summary()
|
|
79
|
+
self.step_jobs_summary = self.galaxy_invocation.step_jobs_summary()
|
|
80
|
+
|
|
81
|
+
for step in self.galaxy_invocation.steps:
|
|
82
|
+
if "subworkflow_invocation_id" in step.wrapped:
|
|
83
|
+
if step.wrapped["subworkflow_invocation_id"]:
|
|
84
|
+
self.complet_jobs_summary(step)
|
|
85
|
+
|
|
67
86
|
count_states = defaultdict(int)
|
|
68
|
-
for step in step_jobs_summary:
|
|
87
|
+
for step in self.step_jobs_summary:
|
|
69
88
|
for key in step["states"].keys():
|
|
70
89
|
count_states[key] += 1
|
|
71
|
-
percentage_done = count_states.get("ok", 0) / len(step_jobs_summary)
|
|
90
|
+
percentage_done = count_states.get("ok", 0) / len(self.step_jobs_summary)
|
|
72
91
|
if percentage_done == 1:
|
|
73
92
|
self.status = DONE
|
|
74
93
|
self.save()
|
|
@@ -133,13 +152,19 @@ class Invocation(models.Model):
|
|
|
133
152
|
number_of_try += 1
|
|
134
153
|
if galaxy_inv_wrapped.get("outputs", {}):
|
|
135
154
|
for output_name, output_content in galaxy_inv_wrapped["outputs"].items():
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
155
|
+
try:
|
|
156
|
+
output_file = GalaxyOutputFile.objects.get(
|
|
157
|
+
galaxy_id=output_content["id"],
|
|
158
|
+
invocation=self,
|
|
159
|
+
)
|
|
160
|
+
except ObjectDoesNotExist:
|
|
161
|
+
output_file = GalaxyOutputFile(
|
|
162
|
+
galaxy_id=output_content["id"],
|
|
163
|
+
workflow_name=output_name,
|
|
164
|
+
src=output_content["src"],
|
|
165
|
+
invocation=self,
|
|
166
|
+
)
|
|
167
|
+
output_file.save()
|
|
143
168
|
output_file.synchronize()
|
|
144
169
|
else:
|
|
145
170
|
logger.warning(
|
|
@@ -151,13 +176,12 @@ class Invocation(models.Model):
|
|
|
151
176
|
galaxy_inv_wrapped = self._get_galaxy_invocation().wrapped
|
|
152
177
|
if galaxy_inv_wrapped.get("outputs", {}):
|
|
153
178
|
for output_name, output_content in galaxy_inv_wrapped["outputs"].items():
|
|
154
|
-
|
|
155
|
-
galaxy_id=output_content["id"]
|
|
156
|
-
).exists():
|
|
179
|
+
try:
|
|
157
180
|
output_file = GalaxyOutputFile.objects.get(
|
|
158
|
-
galaxy_id=output_content["id"]
|
|
181
|
+
galaxy_id=output_content["id"],
|
|
182
|
+
invocation=self,
|
|
159
183
|
)
|
|
160
|
-
|
|
184
|
+
except ObjectDoesNotExist:
|
|
161
185
|
output_file = GalaxyOutputFile(
|
|
162
186
|
galaxy_id=output_content["id"],
|
|
163
187
|
workflow_name=output_name,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/admin/galaxy_output_file.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/galaxy_user.py
RENAMED
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/history.py
RENAMED
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/invocation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/serializers/workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/create_history.py
RENAMED
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/galaxy_instance.py
RENAMED
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/galaxy_output_file.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/invoke_workflow.py
RENAMED
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/api/views/upload_to_history.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/migrations/0001_new_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_to_galaxy-0.6.4 → django_to_galaxy-0.6.7}/django_to_galaxy/models/galaxy_instance.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|