Skip to content

[SYNPY-1402] Update reticulate tutorial for new OOP models/operations API#1352

Merged
thomasyu888 merged 4 commits intodevelopfrom
SYNPY-1402-update-reticulate-docs
Apr 16, 2026
Merged

[SYNPY-1402] Update reticulate tutorial for new OOP models/operations API#1352
thomasyu888 merged 4 commits intodevelopfrom
SYNPY-1402-update-reticulate-docs

Conversation

@thomasyu888
Copy link
Copy Markdown
Member

@thomasyu888 thomasyu888 commented Apr 5, 2026

Problem:

  • The reticulate tutorial at docs/tutorials/reticulate.md was written against the legacy synapseclient API (synapseclient$File, syn$store(), syn$get(), etc.)
  • The new OOP API (models.*, operations.*, entity$store()) was not documented for R/reticulate users
  • Python version requirement was listed as 3.6+ (now 3.10+)
  • No setup instructions existed for getting a working RStudio + Python environment

Solution:

  • Replace all legacy class references (synapseclient$File, synapseclient$Project, etc.) with models$File, models$Project, etc.
  • Use entity$store() OOP pattern throughout; keep operations$get() for type-unknown retrieval by Synapse ID
  • Update tables section: use models$Table + store_rows() with SchemaStorageStrategy$INFER_FROM_DATA and models$Column with snake_case fields (column_type, maximum_size)
  • Update views section: use models$EntityView with ViewTypeMask bitmask
  • Replace syn$tableQuery()$asDataFrame() with models$query()
  • Add Docker setup instructions for a fresh RStudio environment with Python
  • Update Python version requirement to 3.10+
  • Update install command to py_install("synapseclient[pandas,curator]")
  • Move R package onLoad/delay_load guidance to its own section at the end (it was mixed into the general usage section)

Testing:

  • Walk through the examples in a fresh RStudio Docker environment (setup instructions now included in the doc)
  • Verify entity$store(), entity$get(), operations$get(), models$query(), and table$store_rows() calls work end-to-end against Synapse
  • Build docs locally with mkdocs serve and confirm the page renders correctly
  • https://synapsepythonclient--1352.org.readthedocs.build/en/1352/

…s API

- Add Docker setup instructions for fresh RStudio environment
- Update Python version requirement to 3.10+
- Update install command to include pandas,curator extras
- Replace legacy synapseclient$File/Project/etc with models$* pattern
- Replace syn$store/get with entity$store() OOP pattern; keep operations$get for type-unknown retrieval
- Update tables to use models$Table + store_rows with SchemaStorageStrategy
- Update views to use models$EntityView with ViewTypeMask
- Replace syn$tableQuery with models$query
- Move R package onLoad guidance to its own section at end of doc

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread docs/tutorials/reticulate.md Outdated
@andrewelamb
Copy link
Copy Markdown
Contributor

LGTM! I had one suggestion for clarity.

@thomasyu888 thomasyu888 marked this pull request as ready for review April 6, 2026 17:57
@thomasyu888 thomasyu888 requested a review from a team as a code owner April 6, 2026 17:57
Copilot AI review requested due to automatic review settings April 6, 2026 17:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the R/reticulate tutorial to reflect synapseclient’s new OOP models.* / operations.* APIs, adds environment setup guidance, and refreshes version/dependency instructions so R users can follow modern examples end-to-end.

Changes:

  • Add Docker-based RStudio + Python setup instructions and update Python requirement to 3.10+.
  • Replace legacy synapseclient$* entity usage with models$* entities and entity$store() / models$query() patterns.
  • Refresh table/view examples to use Table.store_rows(), SchemaStorageStrategy, and EntityView + ViewTypeMask.
Comments suppressed due to low confidence (1)

docs/tutorials/reticulate.md:161

  • This section reintroduces syn$get_annotations() / syn$set_annotations(), which are deprecated in the client (marked for removal in 5.0.0). Since the tutorial is positioning the new OOP API, it would be better to either remove this alternative or clearly label it as deprecated and keep the recommended approach as updating entity$annotations + entity$store().
Alternatively, retrieve and update annotations directly:

```r
annotations <- syn$get_annotations(project$id)

annotations$foo <- "bar"
annotations$fooList <- list("bar", "baz")

syn$set_annotations(annotations)
</details>



---

💡 <a href="/Sage-Bionetworks/synapsePythonClient/new/develop?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.

Comment thread docs/tutorials/reticulate.md Outdated
Comment thread docs/tutorials/reticulate.md
Comment thread docs/tutorials/reticulate.md Outdated
Comment thread docs/tutorials/reticulate.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread docs/tutorials/reticulate.md Outdated
@thomasyu888 thomasyu888 merged commit 7287c7b into develop Apr 16, 2026
27 of 28 checks passed
@thomasyu888 thomasyu888 deleted the SYNPY-1402-update-reticulate-docs branch April 16, 2026 02:31
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.

3 participants