Skip to content

Commit

Permalink
Mark _BaseIntervalIdentifier as private and add NotImplementedError
Browse files Browse the repository at this point in the history
for `_transform`.
  • Loading branch information
mansenfranzen committed Mar 16, 2019
1 parent ccc65e1 commit fc94238
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/pywrangler/wranglers/pandas/interval_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pywrangler.wranglers.pandas.base import PandasSingleNoFit


class BaseIntervalIdentifier(PandasSingleNoFit, IntervalIdentifier):
class _BaseIntervalIdentifier(PandasSingleNoFit, IntervalIdentifier):
"""Provides `transform` and `validate_input` methods common to more than
one implementation of the pandas interval identification wrangler.
Expand Down Expand Up @@ -70,8 +70,15 @@ def transform(self, df: pd.DataFrame) -> pd.DataFrame:

return df_result

def _transform(self, series: pd.Series) -> List[int]:
"""Needs to be implemented.
"""

raise NotImplementedError


class NaiveIterator(BaseIntervalIdentifier):
class NaiveIterator(_BaseIntervalIdentifier):
"""Most simple, sequential implementation which iterates values while
remembering the state of start and end markers.
Expand Down Expand Up @@ -157,7 +164,7 @@ def is_valid_end(value, active):
return result


class VectorizedCumSum(BaseIntervalIdentifier):
class VectorizedCumSum(_BaseIntervalIdentifier):
"""Sophisticated approach using multiple, vectorized operations. Using
cumulative sum allows enumeration of intervals to avoid looping.
Expand Down

0 comments on commit fc94238

Please sign in to comment.