Skip to content

Commit

Permalink
F821 undefined name 'X' **
Browse files Browse the repository at this point in the history
  • Loading branch information
Jianjie Liu committed Oct 19, 2021
1 parent 2c4de7b commit 9ac4543
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions recommenders/datasets/amazon_reviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ def _data_generating_no_history_expanding(
fo = f_test
if user_id != last_user_id or tfile == "valid" or tfile == "test":
if last_user_id is not None:
history_clk_num = len(movie_id_list)
history_clk_num = len(movie_id_list) # noqa: F821 undefined name 'movie_id_list'
cat_str = ""
mid_str = ""
dt_str = ""
for c1 in cate_list[:-1]:
for c1 in cate_list[:-1]: # noqa: F821 undefined name 'cate_list'
cat_str += c1 + ","
for mid in movie_id_list[:-1]:
for mid in movie_id_list[:-1]: # noqa: F821 undefined name 'movie_id_list'
mid_str += mid + ","
for dt_time in dt_list[:-1]:
for dt_time in dt_list[:-1]: # noqa: F821 undefined name 'dt_list'
dt_str += dt_time + ","
if len(cat_str) > 0:
cat_str = cat_str[:-1]
Expand Down
2 changes: 1 addition & 1 deletion recommenders/tuning/nni/ncf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def compute_test_results(model, train, test, rating_metrics, ranking_metrics):
all_predictions = merged[merged.rating.isnull()].drop('rating', axis=1)

for metric in ranking_metrics:
test_results[metric] = eval(metric)(test, all_predictions, col_prediction='prediction', k=K)
test_results[metric] = eval(metric)(test, all_predictions, col_prediction='prediction', k=K) # noqa: F821 undefined name 'K'

return test_results

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ignore =
; W605 # invalid escape sequence (done)
; F403 # 'from X import *' used; unable to detect undefined names (done)
; F405 # 'Dense' may be undefined, or defined from star imports: tensorflow.keras.layers (done)
F821 # undefined name 'K'
; F821 # undefined name 'K'

# File-specific flake8 ignore rules (too risky to implement the changes)
per-file-ignores =
Expand Down

0 comments on commit 9ac4543

Please sign in to comment.