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

Workspaces api docgen source #33

Merged
merged 28 commits into from
Oct 15, 2024
Merged

Workspaces api docgen source #33

merged 28 commits into from
Oct 15, 2024

Conversation

ngrayluna
Copy link
Contributor

@ngrayluna ngrayluna commented Sep 17, 2024

Summary of changes

  • Adds descriptions to Reports API
  • Hides some class methods that should not be exposed e.g. to_model and from_model using single underscores.
    • This ensures that lazydocs can generate markdown files properly.
    • (You can check they are exposed today by doing help wandb_workspaces.reports.v2.ClassName or wandb_workspaces.reports.v2.ClassName? in a notebook for classes that have either defined:
def to_model()

or

def from_model() 
  • Updated reports and workspaces tests files to reflect to_model -> _to_model changes
  • Removed @classmethod decorator on Workspaces.save() and Workspaces.save_as_new. Re: for the latter, the method is an instance method, not a class method.
  • For those descriptions I was not sure of, I used CoPilot.
  • Added "INSERT" for some (what I assume) are Classes that we don't want to show. Re: API generator sees them. In the future, do a) confirm and b) add an underscore so lazydocs doesn't pick them up.

@anandwandb and/or someone to verify:

  1. Should these be exposed?
  • Spotify
  • SoundCloud
  • Twitter
  1. Do these Weave* Classes should be renamed to QueryPanels? i.e.
  • 'WeaveBlockArtifact',
  • 'WeaveBlockArtifactVersionedFile',
  • 'WeaveBlockSummaryTable',
  • 'WeavePanel',
  • 'WeavePanelArtifact',
  • 'WeavePanelArtifactVersionedFile',
  • 'WeavePanelSummaryTable',
  1. Finish descriptions for
    a. running_* in ScatterPlot
    b. gradient in ParallelCoordinatesPlot
    c. chart_* in from_table
    d. Overview description for for Block class

Testing

  • Passes circleCI tests.
poetry run pytest --cov
  • Unsure how to resolve, troubleshoot pre commit errors (returned error is vague). I tried:
poetry run pre-commit run --all-files

Doc link preview:

Preview the docs here https://reports-api.docodile.pages.dev/ref/python/wandb_workspaces/reports/ and here https://reports-api.docodile.pages.dev/ref/python/wandb_workspaces/workspaces

@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 85.81560% with 20 lines in your changes missing coverage. Please review.

Project coverage is 70.41%. Comparing base (d656a2a) to head (a1d358e).

Files with missing lines Patch % Lines
wandb_workspaces/reports/v2/interface.py 85.83% 17 Missing ⚠️
wandb_workspaces/workspaces/interface.py 85.71% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
- Coverage   70.88%   70.41%   -0.47%     
==========================================
  Files          16       16              
  Lines        2356     2319      -37     
==========================================
- Hits         1670     1633      -37     
  Misses        686      686              
Files with missing lines Coverage Δ
wandb_workspaces/reports/v2/__init__.py 100.00% <ø> (ø)
wandb_workspaces/workspaces/__init__.py 100.00% <ø> (ø)
wandb_workspaces/workspaces/interface.py 87.33% <85.71%> (-1.82%) ⬇️
wandb_workspaces/reports/v2/interface.py 57.46% <85.83%> (ø)

@ngrayluna
Copy link
Contributor Author

ngrayluna commented Oct 1, 2024

Things for Noah to do

  1. Finish adding attribute types
  2. Change the path to something more readable in https://github.com/wandb/docodile/pull/828

report_id: str


@dataclass(config=dataclass_config, repr=False)
class GalleryURL(Base):
"""A URL to an external resource.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarify as in the gallery

@ngrayluna
Copy link
Contributor Author

@sephmard What do we want to do about these APIs? They refer to the old Weave product and might confuse customers.

'WeaveBlockArtifact',
'WeaveBlockArtifactVersionedFile',
'WeaveBlockSummaryTable',
'WeavePanel',
'WeavePanelArtifact',
'WeavePanelArtifactVersionedFile',
'WeavePanelSummaryTable',

@andrewtruong Within reports, do we want to expose? Current implementation shows them:

Block
Heading
ListItem
UnknownBlock
UnknownPanel

@ngrayluna
Copy link
Contributor Author

  • Decided to leave in Weave* and added a note clarifying that it is not releated to LLM Weave. In the future, remove.
  • Added "INSERT" for some (what I assume) are Classes that we don't want to show. Re: API generator sees them. In the future, do a) confirm and b) add an underscore so lazydocs doesn't pick them up.

@ngrayluna ngrayluna merged commit 93ec1f2 into main Oct 15, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants