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

module standardization #32

Merged
merged 16 commits into from
Aug 9, 2024
Merged

module standardization #32

merged 16 commits into from
Aug 9, 2024

Conversation

Rob1in
Copy link
Collaborator

@Rob1in Rob1in commented Jul 18, 2024

No description provided.

@Rob1in Rob1in marked this pull request as draft July 18, 2024 17:32
@Rob1in Rob1in requested a review from bhaney July 18, 2024 17:32
@Rob1in
Copy link
Collaborator Author

Rob1in commented Jul 18, 2024

I will convert it to not a draft after testing the requirements on linux/amd

@Rob1in
Copy link
Collaborator Author

Rob1in commented Jul 18, 2024

tested the build and the module on linux/amd

@Rob1in Rob1in marked this pull request as ready for review July 18, 2024 18:35
Copy link

@bhaney bhaney left a comment

Choose a reason for hiding this comment

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

nice job with the edits, just a question about a name -- if it's a breaking change to change the name of the distance function, then we shouldn't do it.

src/distance.py Outdated

def euclidean_distance(t1, t2):
"""
Computes the Euclidean distance between two tensors using the L1 norm.
Copy link

Choose a reason for hiding this comment

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

Euclidean usually means the L2 norm, not L1 -- the L1 norm is colloquially called the "manhattan" or "taxicab" norm

Comment on lines 26 to 31
"""
if distance_metric == "euclidean":
return 1.1
if distance_metric == "euclidean_l2":
return 1.1
elif distance_metric == "cosine":
if distance_metric == "cosine":
Copy link

Choose a reason for hiding this comment

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

Not sure if it's a breaking change to change the name from euclidean to another name to make it more clear that it is the L1 norm, but if it isn't a breaking change, I would save change the name to "l1_norm" or something similar

@Rob1in Rob1in requested a review from bhaney July 24, 2024 19:20
Copy link

@bhaney bhaney left a comment

Choose a reason for hiding this comment

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

Almost done, I think you just need to eliminate some of the ignored pylint codes, and then it should be good

Makefile Outdated
python3 -m pytest tests/*

lint:
python3 -m pylint src --disable=W0719,C0114,W0201,W1203,E1101,W1203,E0611,R0902,R0913,E0611,E0001,R0914,R0903
Copy link

Choose a reason for hiding this comment

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

C0114: Missing module docstring
W0201: Attribute defined outside init
W1203: Use % formatting in logging functions and pass the % parameters as arguments
E1101: Instance of 'x' has no 'y' member
E0611: No name 'x' in module 'y'
E0001: Syntax error
R0801: Similar lines in 'x' files

Remove these from the disable string, and if you do need to disable them, put the ignore right next to the code where you need it

@Rob1in Rob1in requested a review from bhaney August 5, 2024 16:10
Copy link

@bhaney bhaney left a comment

Choose a reason for hiding this comment

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

LGTM!

@Rob1in Rob1in merged commit 0f3aeb4 into viam-modules:main Aug 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants