Skip to content

Commit

Permalink
Fix linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nnansters committed Jul 19, 2024
1 parent 8e8ea5d commit 4d2e401
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nannyml/drift/multivariate/domain_classifier/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,16 @@ def _fit(self, reference_data: pd.DataFrame, *args, **kwargs):
# been provided the timestamp column name.
#
# The reference data will be sorted according to the timestamp column (when available) to mimic
# Chunker behavior. This means the reference data will be "aligned" with chunked reference data.
# Chunker behavior. This means the reference data will be "aligned" with chunked reference data.
# This way we can use chunk indices on the internal reference data copy.
if self.chunker.timestamp_column_name:
if self.chunker.timestamp_column_name not in list(reference_data.columns):
raise InvalidArgumentsException(
f"timestamp column '{self.chunker.timestamp_column_name}' not in columns: {list(reference_data.columns)}." # noqa: E501
)
self._reference_X = reference_data.sort_values(
by=[self.chunker.timestamp_column_name]
).reset_index(drop=True)[self.feature_column_names]
self._reference_X = reference_data.sort_values(by=[self.chunker.timestamp_column_name]).reset_index(
drop=True
)[self.feature_column_names]
else:
self._reference_X = reference_data[self.feature_column_names]

Expand Down Expand Up @@ -306,7 +306,7 @@ def _calculate_chunk(self, chunk: Chunk):
y = np.concatenate([reference_y, chunk_y])
else:
# Use information from chunk indices to identify reference chunk's location. This is possible because
# both the internal reference data copy and the chunk data were sorted by timestamp, so these
# both the internal reference data copy and the chunk data were sorted by timestamp, so these
# indices align. This way we eliminate the need to combine these two data frames and drop duplicate rows,
# which is a costly operation.
X = self._reference_X
Expand Down

0 comments on commit 4d2e401

Please sign in to comment.