django-to-galaxy 0.6.8__py3-none-any.whl → 0.6.9__py3-none-any.whl

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.

@@ -157,14 +157,15 @@ class GalaxyUserAdmin(admin.ModelAdmin):
157
157
  label=elem_dict["label"],
158
158
  workflow=wf,
159
159
  )
160
- for format in step_dict.tool_inputs["format"]:
161
- (
162
- winputformat,
163
- created,
164
- ) = Format.objects.get_or_create(
165
- format=format.strip()
166
- )
167
- workflowinput.formats.add(winputformat.id)
160
+ if hasattr(step_dict.tool_inputs, "format"):
161
+ for format in step_dict.tool_inputs["format"]:
162
+ (
163
+ winputformat,
164
+ created,
165
+ ) = Format.objects.get_or_create(
166
+ format=format.strip()
167
+ )
168
+ workflowinput.formats.add(winputformat.id)
168
169
  workflowinput.optional = step_dict.tool_inputs[
169
170
  "optional"
170
171
  ]
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
  from collections import defaultdict
3
3
  from time import sleep
4
- from typing import List, Dict
4
+ from typing import Any, List, Dict
5
5
 
6
6
  from bioblend.galaxy.objects import wrappers
7
7
  from django.db import models
@@ -48,6 +48,21 @@ class Invocation(models.Model):
48
48
  create_time = models.DateTimeField()
49
49
  """Time the invocation was created."""
50
50
 
51
+ def step_jobs_summary(self) -> List[Dict[str, Any]]:
52
+ """Workaround self.galaxy_invocation.step_jobs_summary() due to v24.0 db issue"""
53
+ step_jobs_summary = []
54
+ for step_job in self.galaxy_invocation.steps:
55
+ if step_job.job_id is not None:
56
+ step_job_summary = {}
57
+ step_job_summary["states"] = {}
58
+ step_job_summary["id"] = step_job.job_id
59
+ step_job_summary["states"][
60
+ self.workflow.galaxy_owner.obj_gi.jobs.get(step_job.job_id).state
61
+ ] = 1
62
+ step_jobs_summary.append(step_job_summary)
63
+
64
+ return step_jobs_summary
65
+
51
66
  @property
52
67
  def galaxy_invocation(self) -> wrappers.Invocation:
53
68
  """Galaxy object using bioblend."""
@@ -76,7 +91,7 @@ class Invocation(models.Model):
76
91
  """Retrieve percentage of jobs done for the invocation."""
77
92
  if self.status == DONE:
78
93
  return 100.0
79
- self.step_jobs_summary = self.galaxy_invocation.step_jobs_summary()
94
+ self.step_jobs_summary = self.step_jobs_summary()
80
95
 
81
96
  for step in self.galaxy_invocation.steps:
82
97
  if "subworkflow_invocation_id" in step.wrapped:
@@ -110,7 +125,7 @@ class Invocation(models.Model):
110
125
  return self._job_id_to_tools
111
126
 
112
127
  def _build_job_id_to_tools(self) -> Dict[str, dict]:
113
- step_jobs_summary = self.galaxy_invocation.step_jobs_summary()
128
+ step_jobs_summary = self.step_jobs_summary()
114
129
  job_id_to_tools = {}
115
130
  for step in step_jobs_summary:
116
131
  job_id = step["id"]
@@ -125,7 +140,7 @@ class Invocation(models.Model):
125
140
  @property
126
141
  def detailed_step_jobs_summary(self) -> List[dict]:
127
142
  """Retrive `step_jobs_summary` with details of tool used."""
128
- step_jobs_summary = self.galaxy_invocation.step_jobs_summary()
143
+ step_jobs_summary = self.step_jobs_summary()
129
144
  detailed_jobs_summary = []
130
145
  for step in step_jobs_summary:
131
146
  detailed_step = step
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-to-galaxy
3
- Version: 0.6.8
3
+ Version: 0.6.9
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
@@ -3,7 +3,7 @@ django_to_galaxy/admin/__init__.py,sha256=Rf8utzaDbRa3MAFmerhMC8kybejbiUlDFt8mbF
3
3
  django_to_galaxy/admin/galaxy_element.py,sha256=pDdFWQO5BHt251kIW8Gawe0M0O8r5z4cI6EJqQsDBqI,159
4
4
  django_to_galaxy/admin/galaxy_instance.py,sha256=yVlbA5fVbMQBKyKwaFJM3CRFQ2HDjzYHsni_l8MBndU,834
5
5
  django_to_galaxy/admin/galaxy_output_file.py,sha256=bnpwlAH8cQe6nkWIln8iSFDtVyr0kqI5P-QNbISWCfE,2321
6
- django_to_galaxy/admin/galaxy_user.py,sha256=NO0qzhsk6WVnWwvXuodGPLi0o4CPbg0yTZh4VxYvH0k,7278
6
+ django_to_galaxy/admin/galaxy_user.py,sha256=A_VBW0LlPoEHfPhPbo21H6YNhWlTgPCyzPxQM-3Yv84,7387
7
7
  django_to_galaxy/admin/history.py,sha256=eVN-ZCAju0_1ygeSnHEie3a7iy7LoW3bOhWQyU20XTw,2562
8
8
  django_to_galaxy/admin/invocation.py,sha256=Rgtkyyl2WrDZN-fF_u5lPlicGe341UGwBMbI06nZG78,4821
9
9
  django_to_galaxy/admin/tag.py,sha256=jqQ64sLieq4CSRFHesNt33SqTNnA-z3oiQuj7Ncx_jU,315
@@ -46,7 +46,7 @@ django_to_galaxy/models/galaxy_instance.py,sha256=931iyrqJxK6YCbkaC6FPdqMRI_hhGQ
46
46
  django_to_galaxy/models/galaxy_output_file.py,sha256=oAq7HZBk3svG88NagFpkpiB5TQoncbpGFxCCTFoCzyo,1915
47
47
  django_to_galaxy/models/galaxy_user.py,sha256=Cz6wmyD3PvltFi2yKEKr2z7YTsxlmnNV8xwA0Gltu_o,3264
48
48
  django_to_galaxy/models/history.py,sha256=RF661ULnSMO6wvEutZ-qVDY-9vxu-JcWiGbN7MwdVvI,2635
49
- django_to_galaxy/models/invocation.py,sha256=spBky_aS1iQV8szKc-K8d-Q7Igk7cuMXqX9KO6lvqsA,7703
49
+ django_to_galaxy/models/invocation.py,sha256=kexyKXY2I5QaPlBUs9cva1jzsN2EczIwcPKElgG6Sng,8319
50
50
  django_to_galaxy/models/workflow.py,sha256=1Ok0TSSIM-LJbaY1Vm19YVg_WwDxznbLDcXI71S_IL8,1891
51
51
  django_to_galaxy/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  django_to_galaxy/schemas/dataset.py,sha256=yjwLJGb487VJDXoXGg8fG_TW6TJPeyeGtd9vofU-7HI,396
@@ -55,7 +55,7 @@ django_to_galaxy/templates/admin/import_workflows.html,sha256=YB101H99EOR8td_Dzf
55
55
  django_to_galaxy/urls.py,sha256=ydMl_0qSyz8GSGkWpiSzU3khqj9mPyZacx532JybLHk,106
56
56
  django_to_galaxy/utils.py,sha256=gjUzzqfpili66CY7vFyseqHOD9vqWg_2tzWAiTe3pNE,1625
57
57
  django_to_galaxy/version.py,sha256=O9WfyDkb-iJLGWlnKx2K7kFtcDgFCboBiFm553-3Sjk,111
58
- django_to_galaxy-0.6.8.dist-info/LICENSE,sha256=Er3Bp2y6Wf31e0s1-Tdu_d6Gd89FtTizmGUJzGQkWvo,34498
59
- django_to_galaxy-0.6.8.dist-info/METADATA,sha256=cI5_FiVzbmrZi6cm8KDce_ztbCB5GCyJMs0dkzqdHCY,764
60
- django_to_galaxy-0.6.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
61
- django_to_galaxy-0.6.8.dist-info/RECORD,,
58
+ django_to_galaxy-0.6.9.dist-info/LICENSE,sha256=Er3Bp2y6Wf31e0s1-Tdu_d6Gd89FtTizmGUJzGQkWvo,34498
59
+ django_to_galaxy-0.6.9.dist-info/METADATA,sha256=egbQux6CxINf3spU2jrz2LzRslamR4T6JtvoLnzPm3U,764
60
+ django_to_galaxy-0.6.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
61
+ django_to_galaxy-0.6.9.dist-info/RECORD,,