django-to-galaxy 0.6.5__py3-none-any.whl → 0.6.8__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.

@@ -59,17 +59,38 @@ class Invocation(models.Model):
59
59
  """Get galaxy object using bioblend."""
60
60
  return self.workflow.galaxy_owner.obj_gi.invocations.get(self.galaxy_id)
61
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
+
62
74
  @property
63
75
  def percentage_done(self) -> float:
64
76
  """Retrieve percentage of jobs done for the invocation."""
65
77
  if self.status == DONE:
66
78
  return 100.0
67
- 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
+
68
86
  count_states = defaultdict(int)
69
- for step in step_jobs_summary:
87
+ for step in self.step_jobs_summary:
70
88
  for key in step["states"].keys():
71
89
  count_states[key] += 1
72
- percentage_done = count_states.get("ok", 0) / len(step_jobs_summary)
90
+ try:
91
+ percentage_done = count_states.get("ok", 0) / len(self.step_jobs_summary)
92
+ except ZeroDivisionError:
93
+ percentage_done = 0
73
94
  if percentage_done == 1:
74
95
  self.status = DONE
75
96
  self.save()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-to-galaxy
3
- Version: 0.6.5
3
+ Version: 0.6.8
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)
@@ -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=gjSdyYdyEcrDMFG-wO_Zp4wyQCpwwilCx-q9ymudbRU,6870
49
+ django_to_galaxy/models/invocation.py,sha256=spBky_aS1iQV8szKc-K8d-Q7Igk7cuMXqX9KO6lvqsA,7703
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.5.dist-info/LICENSE,sha256=Er3Bp2y6Wf31e0s1-Tdu_d6Gd89FtTizmGUJzGQkWvo,34498
59
- django_to_galaxy-0.6.5.dist-info/METADATA,sha256=W0Qp3Rkdj1hexDNR1UT6XmN3JSse8DSNZZn7Tkzxfxs,713
60
- django_to_galaxy-0.6.5.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
61
- django_to_galaxy-0.6.5.dist-info/RECORD,,
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,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.7.0
2
+ Generator: poetry-core 1.9.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any