Skip to content

Commit

Permalink
transforms: Move class name UUIDObject to Operator
Browse files Browse the repository at this point in the history
According the docs, all transformations are based on Operators. So, the
base class should have the same name. That's why we are moving to a new
name.

Signed-off-by: Julio Faracco <[email protected]>
  • Loading branch information
jcfaracco committed Oct 29, 2023
1 parent b39398f commit 4af4ec9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dasf/transforms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
from dasf.utils.types import is_dask_gpu_dataframe
from dasf.utils.funcs import block_chunk_reduce

class UUIDObject:
class Operator:
def get_uuid(self):
if not hasattr(self, "_uuid"):
self._uuid = uuid4()
return self._uuid

class Fit(UUIDObject):
class Fit(Operator):
def _lazy_fit_cpu(self, X, y=None, **kwargs):
raise NotImplementedError

Expand All @@ -46,7 +46,7 @@ def fit_from_model(model, X, y, sample_weight=None, **kwargs):
return model.fit(X=X, y=y, sample_weight=sample_weight, **kwargs)


class FitPredict(UUIDObject):
class FitPredict(Operator):
def _lazy_fit_predict_cpu(self, X, y=None, **kwargs):
raise NotImplementedError

Expand All @@ -69,7 +69,7 @@ def fit_predict_from_model(model, X, y, sample_weight=None, **kwargs):
**kwargs)


class FitTransform(UUIDObject):
class FitTransform(Operator):
def _lazy_fit_transform_cpu(self, X, y=None, **kwargs):
raise NotImplementedError

Expand All @@ -92,7 +92,7 @@ def fit_transform_from_model(model, X, y, sample_weight=None, **kwargs):
**kwargs)


class Predict(UUIDObject):
class Predict(Operator):
def _lazy_predict_cpu(self, X, sample_weight=None, **kwargs):
raise NotImplementedError

Expand All @@ -116,7 +116,7 @@ def predict_from_model(model, X, sample_weight=None, **kwargs):
return model.predict(X=X, sample_weight=sample_weight, **kwargs)


class GetParams(UUIDObject):
class GetParams(Operator):
def _lazy_get_params_cpu(self, deep=True, **kwargs):
raise NotImplementedError

Expand All @@ -134,7 +134,7 @@ def get_params(self, deep=True, **kwargs):
...


class SetParams(UUIDObject):
class SetParams(Operator):
def _lazy_set_params_cpu(self, **params):
raise NotImplementedError

Expand All @@ -152,7 +152,7 @@ def set_params(self, **params):
...


class Transform(UUIDObject):
class Transform(Operator):
def _lazy_transform_cpu(self, X, **kwargs):
raise NotImplementedError

Expand Down

0 comments on commit 4af4ec9

Please sign in to comment.