junban 1.0.2__tar.gz → 1.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: junban
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Junban – Simple Sequential Python Workflows
5
5
  Author-email: Sebastian Franz <sebastian.franz@tum.de>
6
6
  Project-URL: Issues, https://github.com/biocentral/junban/issues
@@ -41,9 +41,13 @@ class Pipeline(Generic[C]):
41
41
  current_context = context
42
42
  for step in self.steps:
43
43
  try:
44
- self._log_info(f"[{self.name}] {step.get_start_message()}")
45
- current_context = step.run(current_context)
46
- self._log_info(f"[{self.name}] {step.get_end_message()}")
44
+ skip = step.maybe_skip(context)
45
+ if skip:
46
+ self._log_info(f"[{self.name}] Skipping..")
47
+ else:
48
+ self._log_info(f"[{self.name}] {step.get_start_message()}")
49
+ current_context = step.run(current_context)
50
+ self._log_info(f"[{self.name}] {step.get_end_message()}")
47
51
  except AssertionError as e:
48
52
  self._log_error(f"[{self.name}] Assertion error in step {step.__class__.__name__}: {str(e)}")
49
53
  raise
@@ -20,6 +20,11 @@ class PipelineStep(ABC, Generic[C]):
20
20
  """
21
21
  return True
22
22
 
23
+ def _skip(self, context: C) -> bool:
24
+ """ If this method returns True, the pipeline step will be skipped entirely.
25
+ Should not modify the context in any way."""
26
+ return False
27
+
23
28
  @abstractmethod
24
29
  def get_start_message(self) -> str:
25
30
  raise NotImplementedError
@@ -32,6 +37,9 @@ class PipelineStep(ABC, Generic[C]):
32
37
  def _execute(self, context: C) -> C:
33
38
  raise NotImplementedError
34
39
 
40
+ def maybe_skip(self, context: C) -> bool:
41
+ return self._skip(context)
42
+
35
43
  def run(self, context: C) -> C:
36
44
  if not self._check_entry_assumptions(context):
37
45
  assert False, "Entry assumptions not met"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: junban
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Junban – Simple Sequential Python Workflows
5
5
  Author-email: Sebastian Franz <sebastian.franz@tum.de>
6
6
  Project-URL: Issues, https://github.com/biocentral/junban/issues
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "junban"
3
- version = "1.0.2"
3
+ version = "1.0.3"
4
4
  description = "Junban – Simple Sequential Python Workflows"
5
5
  authors = [
6
6
  {name = "Sebastian Franz", email = "sebastian.franz@tum.de"},
File without changes
File without changes
File without changes
File without changes