-
Notifications
You must be signed in to change notification settings - Fork 21
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
DomainAwareDataset str repr edge case handling #49
DomainAwareDataset str repr edge case handling #49
Conversation
…in_names_ is too large + Print the number of datapoints in the dataset
The goal is to have a similar string representation as torchvision for datasets: However rn in the |
skada/datasets/_base.py
Outdated
|
||
def __repr__(self) -> str: | ||
return self.__str__() | ||
head = self.__str__() | ||
body = [f"Number of datapoints: {sum(len(tup[0]) for tup in self.domains_)}"] |
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.
you shoudl also print teh numer of domains and call it total sizes (giving both total n and d)
skada/datasets/_base.py
Outdated
output = "\n".join([head] + body) | ||
return output | ||
|
||
def get_domain_representation(self, max_domains=5, max_length=50): |
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.
I suggest renaming the function to _get_domain_representation
to emphasize its role as an internal function. This change will help clarify that it should not be considered part of the class's public API.
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 seems OK but you need to do some testing (add at leats one test) with different types of datasets and check that nothing breaks
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #49 +/- ##
==========================================
+ Coverage 83.98% 84.16% +0.18%
==========================================
Files 35 35
Lines 2135 2160 +25
==========================================
+ Hits 1793 1818 +25
Misses 342 342 ☔ View full report in Codecov by Sentry. |
@YanisLalou Flake8 is not happy here as well. |
Issue #12