Skip to content

Commit 4cf0d87

Browse files
committed
remove finish method
1 parent afd1774 commit 4cf0d87

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

molpipeline/abstract_pipeline_elements/core.py

-7
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,6 @@ def requires_fitting(self) -> bool:
229229
"""Return whether the object requires fitting or not."""
230230
return self._requires_fitting
231231

232-
def finish(self) -> None:
233-
"""Inform object that iteration has been finished. Does in most cases nothing.
234-
235-
Called after all transform singles have been processed. From MolPipeline
236-
"""
237-
238232
def fit(self, values: Any, labels: Any = None) -> Self:
239233
"""Fit object to input_values.
240234
@@ -562,7 +556,6 @@ def transform(self, values: Any) -> Any:
562556
output_rows = self.pretransform(values)
563557
output_rows = self.finalize_list(output_rows)
564558
output = self.assemble_output(output_rows)
565-
self.finish()
566559
return output
567560

568561

molpipeline/any2mol/sdf2mol.py

-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ def set_params(self, **parameters: Any) -> Self:
8686
self.identifier = parameters["identifier"]
8787
return self
8888

89-
def finish(self) -> None:
90-
"""Reset the mol counter which assigns identifiers."""
91-
self.mol_counter = 0
92-
9389
def pretransform_single(self, value: str) -> OptionalMol:
9490
"""Transform an SDF-strings to a rdkit molecule.
9591

molpipeline/pipeline/_molpipeline.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def _get_meta_element_list(
224224
def fit(
225225
self,
226226
x_input: Any,
227-
y: Any = None, # pylint: disable=invalid-name
227+
y: Any = None,
228228
**fit_params: dict[Any, Any],
229229
) -> Self:
230230
"""Fit the MolPipeline according to x_input.
@@ -249,7 +249,7 @@ def fit(
249249
self.fit_transform(x_input)
250250
return self
251251

252-
def fit_transform( # pylint: disable=invalid-name,unused-argument
252+
def fit_transform( # pylint: disable=unused-argument
253253
self,
254254
x_input: Any,
255255
y: Any = None,
@@ -396,11 +396,6 @@ def assemble_output(self, value_list: Iterable[Any]) -> Any:
396396
return last_element.assemble_output(value_list)
397397
return list(value_list)
398398

399-
def _finish(self) -> None:
400-
"""Inform each pipeline element that the iterations have finished."""
401-
for p_element in self._element_list:
402-
p_element.finish()
403-
404399
def _transform_iterator(self, x_input: Any) -> Any:
405400
"""Transform the input according to the sequence of provided PipelineElements.
406401
@@ -431,7 +426,6 @@ def _transform_iterator(self, x_input: Any) -> Any:
431426
else:
432427
yield transformed_value
433428
agg_filter.set_total(len(x_input))
434-
self._finish()
435429

436430
def co_transform(self, x_input: TypeFixedVarSeq) -> TypeFixedVarSeq:
437431
"""Filter flagged rows from the input.

0 commit comments

Comments
 (0)