Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply standard template and formatting #349

Merged
merged 11 commits into from
Nov 11, 2023

Conversation

mdekstrand
Copy link
Member

@mdekstrand mdekstrand commented Nov 11, 2023

This applies our standard LK project template and reformats the code with Ruff. Closes #342.

@mdekstrand mdekstrand added the build Build, test, and platform support label Nov 11, 2023
@mdekstrand mdekstrand added this to the 0.15.0 milestone Nov 11, 2023
@@ -48,7 +48,7 @@ def partition_rows(data, partitions, *, rng_spec=None):
# convert each partition into a split
for i, ts in enumerate(test_sets):
test = data.iloc[ts, :]
trains = test_sets[:i] + test_sets[(i + 1):]
trains = test_sets[:i] + test_sets[(i + 1) :]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace before ':'

@@ -132,8 +136,8 @@
# convert each partition into a split
for i in range(n):
start = i * size
test = xs[start:start + size]
train = np.concatenate((xs[:start], xs[start + size:]))
test = xs[start : start + size]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace before ':'

test = xs[start:start + size]
train = np.concatenate((xs[:start], xs[start + size:]))
test = xs[start : start + size]
train = np.concatenate((xs[:start], xs[start + size :]))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace before ':'

self.n = n
self.column = col

def __call__(self, udf):
return udf.sort_values(self.column).iloc[-self.n:]
return udf.sort_values(self.column).iloc[-self.n :]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace before ':'

@@ -322,12 +330,12 @@
for i in range(partitions):
# get our test users!
if disjoint:
test_us = users[i*size:(i+1)*size]
test_us = users[i * size : (i + 1) * size]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace before ':'

)
if self.aggregate == "weighted-average":
_logger.warning(
"item-item configured to ignore ratings, but using weighted averages - likely bug"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long (102 > 100 characters)

Copy link

codeclimate bot commented Nov 11, 2023

Code Climate has analyzed commit 2c1adf8 and detected 7 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Style 6

View more on Code Climate.

Copy link

codecov bot commented Nov 11, 2023

Codecov Report

Attention: 104 lines in your changes are missing coverage. Please review.

Comparison is base (18e224f) 90.16% compared to head (cb9c4ce) 90.79%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   90.16%   90.79%   +0.63%     
==========================================
  Files          41       41              
  Lines        3234     3119     -115     
==========================================
- Hits         2916     2832      -84     
+ Misses        318      287      -31     
Files Coverage Δ
lenskit/__init__.py 100.00% <100.00%> (ø)
lenskit/algorithms/bias.py 100.00% <100.00%> (ø)
lenskit/algorithms/funksvd.py 97.86% <100.00%> (ø)
lenskit/algorithms/mf_common.py 100.00% <100.00%> (ø)
lenskit/batch/_train.py 100.00% <100.00%> (ø)
lenskit/crossfold.py 98.52% <100.00%> (ø)
lenskit/datasets/__init__.py 100.00% <100.00%> (ø)
lenskit/metrics/predict.py 100.00% <100.00%> (ø)
lenskit/metrics/topn.py 99.53% <100.00%> (ø)
lenskit/sharing/shm.py 100.00% <100.00%> (ø)
... and 24 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mdekstrand mdekstrand merged commit cb9c4ce into lenskit:main Nov 11, 2023
15 of 16 checks passed
@mdekstrand mdekstrand deleted the tweak/standard branch November 11, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build, test, and platform support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reformat LensKit with Ruff
1 participant