擅长:python、mysql、java
<p>创建此类:</p>
<pre><code>class ProcessingChain:
def __init__(self, *callables):
self.operations = callables
def process(self, *args):
for operation in self.operations:
args = operation(*args)
return args
</code></pre>
<p>用法如下:</p>
<pre><code>processing = ProcessingChain(format_files, rename_columns, data_transformation_stage_1, data_transformation_stage_2, data_transformation_stage_3, observation_date_fill)
data_file, hash_file, cols = read_file()
observation, survey_data, cleaned_hash_file = processing.process(data_file, hash_file, cols )
write_file(observation, survey_data, cleaned_hash_file)
</code></pre>