From 5ae6a2b326f9a47fcd6174be0b84cae9eeaccab4 Mon Sep 17 00:00:00 2001 From: riesben Date: Fri, 15 Nov 2024 07:16:15 +0100 Subject: [PATCH] Remodelling transformers: - add DeprecationWarnings to not harmonized fpSize bits. --- scikit_mol/fingerprints.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scikit_mol/fingerprints.py b/scikit_mol/fingerprints.py index a6f90bc..bea43e0 100644 --- a/scikit_mol/fingerprints.py +++ b/scikit_mol/fingerprints.py @@ -45,6 +45,17 @@ def __init__( self.safe_inference_mode = safe_inference_mode self.dtype = dtype + + @property + def nBits(self): + warn("nBits will be replace by fpSize, due to changes harmonization!", DeprecationWarning) + return self.fpSize + + @nBits.setter + def nBits(self, nBits): + warn("nBits will be replace by fpSize, due to changes harmonization!", DeprecationWarning) + self.fpSize = nBits + def _get_column_prefix(self) -> str: matched = _PATTERN_FINGERPRINT_TRANSFORMER.match(type(self).__name__) if matched: @@ -299,10 +310,12 @@ def seed(self, seed): @property def n_permutations(self): + warn("n_permutations will be replace by fpSize, due to changes harmonization!", DeprecationWarning) return self.fpSize @n_permutations.setter def n_permutations(self, n_permutations): + warn("n_permutations will be replace by fpSize, due to changes harmonization!", DeprecationWarning) self.fpSize = n_permutations # each time the n_permutations parameter is modified refresh an instance of the encoder self._recreate_encoder() @@ -402,7 +415,7 @@ def n_permutations(self, n_permutations): @property def length(self): - # to be compliant with the requirement of the base class + warn("length will be replace by fpSize, due to changes harmonization!", DeprecationWarning) return self.fpSize