-
Notifications
You must be signed in to change notification settings - Fork 301
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
Adding metadata getter methods to datasets API #3821
Adding metadata getter methods to datasets API #3821
Conversation
/ok to test |
/ok to test |
/ok to test |
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.
👍
/merge |
@pytest.mark.parametrize("dataset", ALL_DATASETS) | ||
def test_object_getters(dataset): | ||
assert dataset.is_directed() == dataset.metadata["is_directed"] | ||
assert dataset.is_multigraph() == dataset.metadata["is_multigraph"] | ||
assert dataset.is_symmetric() == dataset.metadata["is_symmetric"] | ||
assert dataset.number_of_nodes() == dataset.metadata["number_of_nodes"] | ||
assert dataset.number_of_vertices() == dataset.metadata["number_of_nodes"] | ||
assert dataset.number_of_edges() == dataset.metadata["number_of_edges"] |
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.
This really isn't testing much more than if the APIs are returning the metadata dict, and could start failing if we ever intentionally change the implementation to return something that's still valid but doesn't match the metadata dict exactly.
A better test would be if you verified is_directed
and others are actually True or False based on if the datasets are directed or not, etc.
Closes rapidsai#3820 This PR adds simple getter methods to the `dataset` class, which allows users to easily get information about datasets without need to access the `metadata` dict or look in the directory. ```python from cugraph.datasets import karate # users now call karate.number_of_nodes() # instead of karate.metadata['number_of_nodes'] ``` Authors: - ralph (https://github.com/nv-rliu) Approvers: - Alex Barghi (https://github.com/alexbarghi-nv) URL: rapidsai#3821
Closes #3820
This PR adds simple getter methods to the
dataset
class, which allows users to easily get information about datasets without need to access themetadata
dict or look in the directory.