Skip to content

Commit 784bedf

Browse files
committed
Enhance documentation and update API client content for clarity and accuracy
1 parent 27be821 commit 784bedf

3 files changed

Lines changed: 37 additions & 31 deletions

File tree

.github/workflows/documentation.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,15 @@ jobs:
3232
# By making the PyTorch CPU wheel index the primary index, `pip install .[...]` will resolve
3333
# `torch`/`torchvision` from there, while everything else is still fetched from PyPI.
3434
PIP_INDEX_URL: https://download.pytorch.org/whl/cpu
35-
PIP_EXTRA_INDEX_URL: https://pypi.org/simple
35+
PIP_EXTRA_INDEX_URL: https://pypi.org/simple
36+
37+
# sphinx-notes/pages@v3 deploys straight to Pages but doesn't leave a
38+
# downloadable copy of the build. This grabs the same HTML directory it
39+
# just built (steps.deployment.outputs.artifact) and attaches it as a
40+
# regular workflow-run artifact so it can be downloaded from the Actions UI.
41+
- name: Upload built HTML as a downloadable artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: sphinx-html-docs
45+
path: ${{ steps.deployment.outputs.artifact }}
46+
retention-days: 30

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ junit/
115115
.vscode/
116116

117117
# claude
118-
CLAUDE.md
118+
CLAUDE.md

docs/source/client_api_content.rst

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,24 @@ First, import the |ApiClass| class and create an instance:
1111
1212
The |ApiClass| class provides access to different endpoint handlers:
1313

14-
+----------------------------+---------------------------------------------------------------+
15-
| Handler | Purpose |
16-
+----------------------------+---------------------------------------------------------------+
17-
| ``api.resources`` | Uploading, downloading, and managing resources |
18-
+----------------------------+---------------------------------------------------------------+
19-
| ``api.annotations`` | Creating and managing annotations/segmentations |
20-
+----------------------------+---------------------------------------------------------------+
21-
| ``api.projects`` | Creating and managing projects |
22-
+----------------------------+---------------------------------------------------------------+
23-
| ``api.channels`` | Organizing resources into channels |
24-
+----------------------------+---------------------------------------------------------------+
25-
| ``api.users`` | User management operations |
26-
+----------------------------+---------------------------------------------------------------+
27-
| ``api.models`` | Managing registered models |
28-
+----------------------------+---------------------------------------------------------------+
29-
| ``api.annotationsets`` | Working with annotation set configurations |
30-
+----------------------------+---------------------------------------------------------------+
31-
| ``api.deploy`` | Deploying models to the Datamint platform |
32-
+----------------------------+---------------------------------------------------------------+
33-
| ``api.inference`` | Running and managing inference jobs |
34-
+----------------------------+---------------------------------------------------------------+
14+
+------------------------+--------------------------------------------------+
15+
| Property | Purpose |
16+
+------------------------+--------------------------------------------------+
17+
| ``api.resources`` | Upload, download, and manage data files |
18+
+------------------------+--------------------------------------------------+
19+
| ``api.annotations`` | Create and manage annotations |
20+
+------------------------+--------------------------------------------------+
21+
| ``api.projects`` | Organize resources into projects |
22+
+------------------------+--------------------------------------------------+
23+
| ``api.channels`` | Group resources by category |
24+
+------------------------+--------------------------------------------------+
25+
| ``api.models`` | Register and manage ML models |
26+
+------------------------+--------------------------------------------------+
27+
| ``api.deploy`` | Deploy models |
28+
+------------------------+--------------------------------------------------+
29+
| ``api.inference`` | Run inference jobs |
30+
+------------------------+--------------------------------------------------+
31+
3532

3633
Most day-to-day workflows can stay object-based. Endpoint handlers return
3734
entity objects such as :py:class:`~datamint.entities.resource.Resource`,
@@ -152,8 +149,8 @@ To delete a resource:
152149
resource = api.resources.get_list(filename="temp_file.dcm")[0]
153150
api.resources.delete(resource)
154151
155-
# Delete multiple resources
156-
api.resources.delete_resources(resources_to_delete)
152+
# Delete multiple resources at once
153+
api.resources.bulk_delete(resources_to_delete)
157154
158155
Working with Annotations
159156
------------------------
@@ -343,8 +340,9 @@ to inspect one resource within a project:
343340
train_resources = resources[:100]
344341
val_resources = resources[100:120]
345342
346-
api.projects.assign_splits(project, train_resources, "train")
347-
api.projects.assign_splits(project, val_resources, "val")
343+
# Note: assign_splits(resources, split_name, project) — project is the third argument
344+
api.projects.assign_splits(train_resources, "train", project)
345+
api.projects.assign_splits(val_resources, "val", project)
348346
349347
assignments = api.projects.get_splits(project)
350348
train_assignments = api.projects.get_splits(project, split_name="train")
@@ -423,8 +421,5 @@ User management operations:
423421
# List all users
424422
users = api.users.get_all()
425423
426-
# Get user by email
424+
# Get user by email (email serves as the entity ID)
427425
user = api.users.get_by_email("user@example.com")
428-
429-
# Get current user info
430-
current_user = api.users.get_current_user()

0 commit comments

Comments
 (0)