-
Notifications
You must be signed in to change notification settings - Fork 80
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
Make neighbor's dataset path as optional #464
Conversation
@@ -2862,20 +2862,20 @@ def test_params_default(self): | |||
Context.QUERY, | |||
self.data_set_dir | |||
) | |||
neighbors_data_set_path = create_data_set( | |||
create_data_set( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is this being used? Should we just remove this callable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, In this case we are creating neighbor's dataset as part of query's dataset. In first step, you see that query dataset is created and it returns the dataset path. In step two, we pass same file and in this case, we don't create new file, instead create new dataset with key as neighbors in same file.
If neighbor's dataset path or corpus is not set, use dataset path as neighbor's dataset path. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
if not self.data_set_path and not self.data_set_corpus: | ||
raise exceptions.ConfigurationError( | ||
"Dataset is missing. Provide either dataset file path or valid corpus.") | ||
if self.data_set_path and self.data_set_corpus: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when both path and corpus are specified?
raise exceptions.ConfigurationError( | ||
"Provide either dataset file path '%s' or corpus '%s'." % (self.data_set_path, self.data_set_corpus)) | ||
"Provide either neighbor's dataset file path '%s' or corpus '%s'." % (file_path, corpus)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend using f-strings for newer code.
@@ -188,12 +188,16 @@ def create_data_set( | |||
dimension: int, | |||
extension: str, | |||
data_set_context: Context, | |||
data_set_dir | |||
data_set_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a type hint for clarity.
Description
If neighbor's dataset path or corpus is not set,
use dataset path as neighbor's dataset path. This will avoid
users to set neighbors dataset path if same h5 file with
different dataset is used.
Issues Resolved
Testing
[Describe how this change was tested]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.