Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jul 24, 2021
1 parent 5d8eb14 commit 0bc89af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/ensae_projects/datainc/croix_rouge.py
Expand Up @@ -93,7 +93,7 @@ def get_meaning(table="invoice", password=None):
df = decrypt_dataframe(name, password=password)
df.columns = [_.strip() for _ in df.columns]
for c in df.columns:
df[c] = df[c].apply(lambda s: s.strip())
df[c] = df[c].apply(lambda s: s.strip()) # pylint: disable=E1101,E1137
df.columns = ["Zone"] + list(df.columns[1:])
return df
if table in {"ITMMASTER", "SINVOICE", "SINVOICE_V", "stojou"}:
Expand All @@ -103,10 +103,10 @@ def get_meaning(table="invoice", password=None):
sep="," if "stojou" in table else "\t")
if table in "ITMMASTER":
df["Zone"] = df.index + 1
df["Zone"] = df.Zone.apply(lambda x: "ITM_%03d" % x)
df["Zone"] = df.Zone.apply(lambda x: "ITM_%03d" % x) # pylint: disable=E1101,E1137
df.columns = [_.strip() for _ in df.columns]
# we remove column always null
df = df.dropna(axis=1, how='all')
df = df.dropna(axis=1, how='all') # pylint: disable=E1101
return df
raise ProjectDataException(
"unable to find information about table {0}".format(table))
Expand Down
8 changes: 4 additions & 4 deletions src/ensae_projects/datainc/data_cresus.py
Expand Up @@ -233,12 +233,12 @@ def split_train_test_cresus_data(tables, outfold, ratio=0.20, fLOG=fLOG): # pyl
else:
raise Exception("unexpected: {0}".format(k))
try:
spl = data[key].apply(lambda x, ens=select: x in ens)
spl = data[key].apply(lambda x, ens=select: x in ens) # pylint: disable=E1136
except KeyError as e:
raise Exception("issue for table '{0}' and columns={1}".format(
k, data.columns)) from e
train_tables[k] = data[spl].copy()
test_tables[k] = data[~spl].copy()
k, data.columns)) from e # pylint: disable=E1101
train_tables[k] = data[spl].copy() # pylint: disable=E1136
test_tables[k] = data[~spl].copy() # pylint: disable=E1136
fLOG("[split_train_test_cresus_data] split for", k,
train_tables[k].shape, test_tables[k].shape)

Expand Down
2 changes: 1 addition & 1 deletion src/ensae_projects/hackathon/image_knn.py
Expand Up @@ -191,7 +191,7 @@ def kneighbors_graph(self, X=None, n_neighbors=None, mode='connectivity', fLOG=N
"""
return self._private_kn("kneighbors_graph", X=X, n_neighbors=n_neighbors, mode=mode, fLOG=fLOG)

def radius_neighbors(self, X=None, radius=None, return_distance=True, fLOG=None): # pylint: disable=W0221
def radius_neighbors(self, X=None, radius=None, return_distance=True, fLOG=None): # pylint: disable=W0221,W0237
"""
See :epkg:`NearestNeighbors`, method :epkg:`radius_neighbors`.
Parameter *X* can be a file, the image is then loaded and converted
Expand Down

0 comments on commit 0bc89af

Please sign in to comment.