Skip to content

added logger warning and error for cosine similarity computation for … - #203

Merged
Devis Lucato (dluc) merged 11 commits into
microsoft:python-previewfrom
vivekpandit-msft:vivekp/cos_sim_zero_vector
Apr 4, 2023
Merged

Devis Lucato (dluc) merged 11 commits into
microsoft:python-previewfrom
vivekpandit-msft:vivekp/cos_sim_zero_vector

Conversation

@vivekpandit-msft

@vivekpandit-msft vivekpandit-msft commented Mar 29, 2023 •

Copy link
Copy Markdown
Contributor

Added logger warning and error for cosine similarity computation for zero vectors

@alexchaomander Alex Chao (alexchaomander) added the python Pull requests for the Python Semantic Kernel label Mar 29, 2023
@alexchaomander

Copy link
Copy Markdown
Contributor

This PR addresses #130

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@jjhenkel Jordan Henkel (jjhenkel) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for this vivekpandit-msft! I left a few requests for fixes. Some other broader requests:

Can you run make pre-commit before and apply fixes, looks like some things are out-of-compliance w/ the linter. This also runs things like isort (which we will be adding to the linting workflow soon).

My output from make pre-commit on this PR:

make pre-commit
poetry run pre-commit run --all-files -c .conf/.pre-commit-config.yaml
Check Toml...............................................................Passed
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Mixed line ending........................................................Passed
black....................................................................Passed
isort....................................................................Failed
- hook id: isort
- files were modified by this hook

Fixing /home/jjhenkel/workspace/semantic-kernel/python/semantic_kernel/core_skills/__init__.py
Fixing /home/jjhenkel/workspace/semantic-kernel/python/semantic_kernel/core_skills/file_io_skill.py
Fixing /home/jjhenkel/workspace/semantic-kernel/python/tests/test_time_skill.py
Fixing /home/jjhenkel/workspace/semantic-kernel/python/semantic_kernel/memory/volatile_memory_store.py

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

python/semantic_kernel/memory/volatile_memory_store.py:57:89: E501 line too long (110 > 88 characters)
python/semantic_kernel/memory/volatile_memory_store.py:58:89: E501 line too long (120 > 88 characters)
python/semantic_kernel/memory/volatile_memory_store.py:65:89: E501 line too long (112 > 88 characters)
python/semantic_kernel/memory/volatile_memory_store.py:89:89: E501 line too long (92 > 88 characters)

Can you structure the tests similar to the others that were recently merged (put them under ./unit/memory/test_volatile_memory_store.py)?

@vivekpandit-msft

Copy link
Copy Markdown
Contributor Author

Thanks for this vivekpandit-msft! I left a few requests for fixes. Some other broader requests:

Can you run make pre-commit before and apply fixes, looks like some things are out-of-compliance w/ the linter. This also runs things like isort (which we will be adding to the linting workflow soon).

My output from make pre-commit on this PR:

make pre-commit
poetry run pre-commit run --all-files -c .conf/.pre-commit-config.yaml
Check Toml...............................................................Passed
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Mixed line ending........................................................Passed
black....................................................................Passed
isort....................................................................Failed
- hook id: isort
- files were modified by this hook

Fixing /home/jjhenkel/workspace/semantic-kernel/python/semantic_kernel/core_skills/__init__.py
Fixing /home/jjhenkel/workspace/semantic-kernel/python/semantic_kernel/core_skills/file_io_skill.py
Fixing /home/jjhenkel/workspace/semantic-kernel/python/tests/test_time_skill.py
Fixing /home/jjhenkel/workspace/semantic-kernel/python/semantic_kernel/memory/volatile_memory_store.py

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

python/semantic_kernel/memory/volatile_memory_store.py:57:89: E501 line too long (110 > 88 characters)
python/semantic_kernel/memory/volatile_memory_store.py:58:89: E501 line too long (120 > 88 characters)
python/semantic_kernel/memory/volatile_memory_store.py:65:89: E501 line too long (112 > 88 characters)
python/semantic_kernel/memory/volatile_memory_store.py:89:89: E501 line too long (92 > 88 characters)

Can you structure the tests similar to the others that were recently merged (put them under ./unit/memory/test_volatile_memory_store.py)?

I have made all the changes you suggested Jordan Henkel (@jjhenkel). Thanks for the review.

@dluc Devis Lucato (dluc) added the PR: feedback to address Waiting for PR owner to address comments/questions label Apr 2, 2023
@dluc

Copy link
Copy Markdown
Contributor

vivekpandit-msft could address the conflict. Jordan Henkel (@jjhenkel) I'll wait for your approval, thanks!

@jjhenkel Jordan Henkel (jjhenkel) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the changes vivekpandit-msft! LGTM now, left some minor comments (but mostly things we should just follow-up on, and things that don't apply just to this PR like docstring consistency).

@vivekpandit-msft

Copy link
Copy Markdown
Contributor Author

vivekpandit-msft could address the conflict. Jordan Henkel (@jjhenkel) I'll wait for your approval, thanks!

Addressed the conflict and Jordan Henkel (@jjhenkel)'s comments

@dluc
Devis Lucato (dluc) merged commit d05d29f into microsoft:python-preview Apr 4, 2023
Devis Lucato (dluc) pushed a commit that referenced this pull request Apr 12, 2023
#203)

Added logger warning and error for cosine similarity computation for
zero vectors
Devis Lucato (dluc) pushed a commit that referenced this pull request Apr 13, 2023
#203)

Added logger warning and error for cosine similarity computation for
zero vectors
Devis Lucato (dluc) pushed a commit that referenced this pull request Apr 13, 2023
#203)

Added logger warning and error for cosine similarity computation for
zero vectors
Desmond Howard (dehoward) pushed a commit to lemillermicrosoft/semantic-kernel that referenced this pull request Jun 1, 2023
microsoft#203)

Added logger warning and error for cosine similarity computation for
zero vectors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feedback to address Waiting for PR owner to address comments/questions python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants