-
Notifications
You must be signed in to change notification settings - Fork 570
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
Expose RepoCard
at top level + few qol improvements
#1354
Expose RepoCard
at top level + few qol improvements
#1354
Conversation
The documentation is not available anymore as the PR was closed or merged. |
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.
looks good, I just skimmed through it :')
src/huggingface_hub/repocard.py
Outdated
class SpaceCard: | ||
"""Space card is an alias for [`RepoCard`]. | ||
|
||
At the moment, it does not implement any specific logic. `SpaceCard` is defined for |
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.
Do you think it makes sense to have Space-specific attributes in RepoCard
under this instead? (e.g. like the one that tells us about duplicate)
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.
yes!!
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.
Defintely. Not useless to have a separate class in the end 😄
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.
@merveenoyan @julien-c added it in d5e71bb
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.
LGTM! Thanks ❤️ this is super useful.
Thanks for the reviews and feedback @merveenoyan @nateraw |
Resolve #1348.
No need to add a
SpaceCard
class, it wouldn't have any additional features.I took the opportunity to add a few QOL improvement to the
CardData
object (.get
,__getitem__
,__setitem__
,__contains__
,.pop
). More of these could be added but honestly not worth the hassle (those 5 cover 99% of the use cases). Could have been simpler to just inherit fromdict
but this way we can explicitly add an "export" step when serializing the metadata.Added some tests and completed a docstring.