Skip to content

Commit

Permalink
Typos and fix static analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
simonzhaoms committed May 23, 2022
1 parent fbfed2c commit 870cbe7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contrib/sarplus/python/pysarplus/SARPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def get_user_affinity(self, test):
SELECT a.{col_user}, a.{col_item}, CAST(a.{col_rating} AS double) {col_rating}
FROM {prefix}df_train a INNER JOIN {prefix}df_test_users b ON a.{col_user} = b.{col_user}
DISTRIBUTE BY {col_user}
SORT BY {col_user}, {col_item}
SORT BY {col_user}, {col_item}
"""
)

Expand Down
14 changes: 7 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://docs.pytest.org/en/latest/fixture.html:
# "If during implementing your tests you realize that you want to use a fixture function from multiple test files
# you can move it to a conftest.py file. You don't need to import the module you defined your fixtures to use in a test,
# it automatically gets discovered by pytest and thus you can simply receive fixture objects by naming them as
# it automatically gets discovered by pytest, and thus you can simply receive fixture objects by naming them as
# an input argument in the test."

import calendar
Expand Down Expand Up @@ -481,14 +481,14 @@ def test_specs():

@pytest.fixture(scope="module")
def affinity_matrix(test_specs):
"""Generate a random user/item affinity matrix. By increasing the likehood of 0 elements we simulate
"""Generate a random user/item affinity matrix. By increasing the likelihood of 0 elements we simulate
a typical recommending situation where the input matrix is highly sparse.
Args:
users (int): number of users (rows).
items (int): number of items (columns).
ratings (int): rating scale, e.g. 5 meaning rates are from 1 to 5.
spars: probability of obtaining zero. This roughly corresponds to the sparseness.
test_specs["users"] (int): number of users (rows).
test_specs["items"] (int): number of items (columns).
test_specs["ratings"] (int): rating scale, e.g. 5 meaning rates are from 1 to 5.
test_specs["spars"]: probability of obtaining zero. This roughly corresponds to the sparseness.
of the generated matrix. If spars = 0 then the affinity matrix is dense.
Returns:
Expand All @@ -512,7 +512,7 @@ def affinity_matrix(test_specs):
X, ratio=test_specs["ratio"], seed=test_specs["seed"]
)

return (Xtr, Xtst)
return Xtr, Xtst


# DeepRec Fixtures
Expand Down

0 comments on commit 870cbe7

Please sign in to comment.