aboutsummaryrefslogtreecommitdiff
path: root/src/argaze/DataFeatures.py
diff options
context:
space:
mode:
authorThéo de la Hogue2024-03-21 08:42:31 +0100
committerThéo de la Hogue2024-03-21 08:42:31 +0100
commit6a7e54a0df84d7864dddfccc4eb0e7ab3c140f97 (patch)
treef50500c3a73d821ee2b7c731a263b3d399fdd7e5 /src/argaze/DataFeatures.py
parent9e401e64862d40effbf0387afce5d1c46301bd91 (diff)
downloadargaze-6a7e54a0df84d7864dddfccc4eb0e7ab3c140f97.zip
argaze-6a7e54a0df84d7864dddfccc4eb0e7ab3c140f97.tar.gz
argaze-6a7e54a0df84d7864dddfccc4eb0e7ab3c140f97.tar.bz2
argaze-6a7e54a0df84d7864dddfccc4eb0e7ab3c140f97.tar.xz
Fixing PipelineStepObject.children method. Adding PipelineInputProvider class.
Diffstat (limited to 'src/argaze/DataFeatures.py')
-rw-r--r--src/argaze/DataFeatures.py46
1 files changed, 41 insertions, 5 deletions
diff --git a/src/argaze/DataFeatures.py b/src/argaze/DataFeatures.py
index 43e7ea7..1334961 100644
--- a/src/argaze/DataFeatures.py
+++ b/src/argaze/DataFeatures.py
@@ -566,7 +566,7 @@ class PipelineStepObject():
filepath = os.path.join(working_directory, new_observers_value)
file_format = filepath.split('.')[-1]
- # Python file format
+ # Load module from working directory
if file_format == 'py':
observer_module_path = new_observers_value.split('.')[0]
@@ -744,16 +744,18 @@ class PipelineStepObject():
def children(self) -> object:
"""Iterate over children pipeline step objects."""
- for name, item in self.__class__.__dict__.items():
+ for name in dir(self):
- if isinstance(item, property):
+ if not name.startswith('_'):
attr = getattr(self, name)
- if PipelineStepObject in attr.__class__.__bases__:
+ if isinstance(attr, PipelineStepObject) and attr != self.parent:
- yield attr
+ print('-', name, type(attr))
+ yield attr
+
def PipelineStepMethod(method):
"""Define a decorator use into PipelineStepObject class to declare pipeline method.
@@ -843,4 +845,38 @@ class PipelineStepObserver():
!!! warning
This method is called provided that the observed PipelineStepObject is created as a context using a with statement.
"""
+ pass
+
+class PipelineInputProvider(PipelineStepObject):
+ """
+ Define class to ...
+ """
+ def __init__(self, **kwargs):
+
+ # DEBUG
+ print('PipelineInputProvider.__init__')
+
+ super().__init__(**kwargs)
+
+ def attach(self, method):
+
+ # DEBUG
+ print('PipelineInputProvider.attach', method)
+
+ def __enter__(self):
+ """
+ Define abstract __enter__ method to use device as a context.
+
+ !!! warning
+ This method is called provided that the PipelineInputProvider is created as a context using a with statement.
+ """
+ return self
+
+ def __exit__(self, type, value, traceback):
+ """
+ Define abstract __exit__ method to use device as a context.
+
+ !!! warning
+ This method is called provided that the PipelineInputProvider is created as a context using a with statement.
+ """
pass \ No newline at end of file