Skip to content

Commit d7fca34

Browse files
linting
1 parent bb76e1c commit d7fca34

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

python/src/lazylearn/ingestion/ingestion_pipeline_steps/interpreter_step.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ def numeric_test(types: list):
8787
:return: True if column is numeric, False otherwise
8888
"""
8989
return all(
90-
[item == float or item == int for item in set(types) if item is not None]
90+
[
91+
item == float or item == int
92+
for item in set(types)
93+
if item is not None # noqa
94+
]
9195
)
9296

9397
@staticmethod
@@ -125,17 +129,23 @@ def id_check(self, types, values):
125129
:param values:
126130
:return:
127131
"""
128-
return all([item == int for item in set(types) if item is not None]) and len(
132+
return all(
133+
[item == int for item in set(types) if item is not None]
134+
) and len( # noqa
129135
set(values)
130-
) == len(self.df)
136+
) == len(
137+
self.df
138+
)
131139

132140
@staticmethod
133141
def build_type_collections(column_type_map):
134142
collections = {}
135143

136144
for data_type in ["datetime", "numeric", "categorical"]:
137145
collections[data_type] = [
138-
col for col in column_type_map if column_type_map[col] == data_type
146+
col
147+
for col in column_type_map
148+
if column_type_map[col] == data_type # noqa
139149
]
140150

141151
return collections

python/src/lazylearn/preprocessing/time/date_processor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ def date_processor(dataset: Dataset) -> Dataset:
2020
dataset.df[f"{date_column}_week"] = (
2121
dataset.df[date_column].dt.isocalendar().week
2222
)
23-
dataset.df[f"{date_column}_day"] = dataset.df[date_column].dt.isocalendar().day
23+
dataset.df[f"{date_column}_day"] = (
24+
dataset.df[date_column].dt.isocalendar().day
25+
) # noqa
2426

2527
new_categorical_cols.append(f"{date_column}_year")
2628
new_categorical_cols.append(f"{date_column}_month")

python/src/lazylearn/regression/models/randomforest/randomforest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from models.models import Dataset
22
from pipeline.pipeline import RegressionPipeline
3-
from sklearn.ensemble import RandomForestRegressor
43

54

65
class RandomForestRegressionPipeline(RegressionPipeline):

0 commit comments

Comments
 (0)