Skip to content

Commit

Permalink
Remodelling transformers:
Browse files Browse the repository at this point in the history
- add DeprecationWarnings to not harmonized fpSize bits.
  • Loading branch information
RiesBen committed Nov 15, 2024
1 parent f7d2958 commit 5ae6a2b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scikit_mol/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 5ae6a2b

Please sign in to comment.