Skip to content

Commit 8001bc4

Browse files
committed
remove additional_attributes and to_json method
1 parent 289fdec commit 8001bc4

File tree

1 file changed

+0
-29
lines changed
  • molpipeline/abstract_pipeline_elements

1 file changed

+0
-29
lines changed

molpipeline/abstract_pipeline_elements/core.py

-29
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from uuid import uuid4
1616

17-
import numpy as np
1817
from joblib import Parallel, delayed
1918
from loguru import logger
2019
from rdkit import Chem
@@ -205,11 +204,6 @@ def set_params(self, **parameters: Any) -> Self:
205204
setattr(self, att_name, att_value)
206205
return self
207206

208-
@property
209-
def additional_attributes(self) -> dict[str, Any]:
210-
"""Any attribute relevant for recreating and exact copy, which is not a parameter."""
211-
return {}
212-
213207
@property
214208
def n_jobs(self) -> int:
215209
"""Get the number of cores."""
@@ -571,29 +565,6 @@ def transform(self, values: Any) -> Any:
571565
self.finish()
572566
return output
573567

574-
def to_json(self) -> dict[str, Any]:
575-
"""Return all defining attributes of object as dict.
576-
577-
Returns
578-
-------
579-
dict[str, Any]
580-
A dictionary with all attributes necessary to initialize a object with same parameters.
581-
"""
582-
json_dict: dict[str, Any] = {
583-
"__name__": self.__class__.__name__,
584-
"__module__": self.__class__.__module__,
585-
}
586-
json_dict.update(self.parameters)
587-
if self.additional_attributes:
588-
adittional_attributes = {}
589-
for key, value in self.additional_attributes.items():
590-
if isinstance(value, np.ndarray):
591-
adittional_attributes[key] = value.tolist()
592-
else:
593-
adittional_attributes[key] = value
594-
json_dict["additional_attributes"] = adittional_attributes
595-
return json_dict
596-
597568

598569
class MolToMolPipelineElement(TransformingPipelineElement, abc.ABC):
599570
"""Abstract PipelineElement where input and outputs are molecules."""

0 commit comments

Comments
 (0)