Skip to content
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

Add short summary field to dataset and clean up repr #9015

Merged
merged 9 commits into from
Jul 5, 2024

Conversation

BrendanSchell
Copy link
Contributor

@BrendanSchell BrendanSchell commented Jul 3, 2024

Description

Updates Dataset with summary field and revises its standalone and collection repr with this and some additional changes to appear cleaner.

Updated Dataset

  • Adds a summary field to Dataset and CreateDataset that contains a shorter text description of the dataset.
  • The html repr is updated to show this summary along with the full dataset description (converted from markdown to html).
  • Updated header levels in dataset repr (now h1 and h2 so that description markdown can be level 3 and below while still being child of Description header)
  • Added some additional h2 headers to section off the different pieces of the repr
    Screenshot 2024-07-04 at 6 17 54 PM

Updated dataset collection

  • Summary field appears as part of the dataset fields when listed as a collection.
    Screenshot 2024-07-03 at 6 39 08 PM

Styling changes

  • Changed some text styling to use variable for syft-dataset fonts so so that it's legible in VS code notebooks in dark mode.

Example usage for adding summary

dataset = sy.Dataset(
    name="my dataset 3",
    asset_list=[
        sy.Asset(name="my asset", data=np.array([1, 2, 3]), mock=np.array([1, 1, 1]))
    ],
    summary="This is a short summary of the dataset.",
    description="Long description",
)

Closes https://github.com/OpenMined/Heartbeat/issues/1281.

Affected Dependencies

List any dependencies that are required for this change.

How has this been tested?

  • Tested manually to make sure it displays ok
  • Tested migrations manually using dataset.migrate_to(version) for both CreateDataset and Dataset

Checklist

@tcp
Copy link
Collaborator

tcp commented Jul 4, 2024

@BrendanSchell if you wanna pair so we take care of the repr in different modes, let me know :)

@BrendanSchell BrendanSchell force-pushed the bschell/fix-dataset-markdown-repr branch from 000122e to d3dc366 Compare July 4, 2024 14:47
@BrendanSchell BrendanSchell force-pushed the bschell/fix-dataset-markdown-repr branch from d3dc366 to eef3cfc Compare July 4, 2024 22:28
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@BrendanSchell BrendanSchell changed the title [WIP] Add short summary field to dataset and clean up repr Add short summary field to dataset and clean up repr Jul 4, 2024
@IonesioJunior IonesioJunior merged commit 0629260 into dev Jul 5, 2024
26 checks passed
@IonesioJunior IonesioJunior deleted the bschell/fix-dataset-markdown-repr branch July 5, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants