feat: Code Ocean version 4.2 functionality#66
Merged
jake-valsamis merged 10 commits intomainfrom Jan 29, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the Code Ocean Python SDK to separate model classes from API client classes, adds new functionality for attaching/detaching data assets to cloud workstation computations, and introduces support for creating data assets from Cloud Workstation sources. The changes support Code Ocean platform version 4.1.
Changes:
- Refactored model classes into a new
codeocean.modelspackage to resolve circular imports - Added
attach_data_assetsanddetach_data_assetsmethods to theComputationsclass - Added
CloudWorkstationSourceas a new source type for data asset creation - Updated minimum Code Ocean platform version to 4.1.0
- Updated examples to use the new import paths
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/codeocean/models/init.py | New package initialization for models module |
| src/codeocean/models/components.py | Moved permission and search component models from components.py |
| src/codeocean/models/capsule.py | Moved capsule models from capsule.py |
| src/codeocean/models/computation.py | Moved computation models from computation.py |
| src/codeocean/models/data_asset.py | Moved data asset models from data_asset.py, added CloudWorkstationSource |
| src/codeocean/models/folder.py | Moved folder models from folder.py |
| src/codeocean/pipeline.py | Updated imports to use models package |
| src/codeocean/capsule.py | Refactored to import models from models package, kept API client class |
| src/codeocean/computation.py | Refactored to import models from models package, added attach/detach methods |
| src/codeocean/data_asset.py | Refactored to import models from models package, kept API client class |
| src/codeocean/client.py | Updated MIN_SERVER_VERSION to 4.1.0 |
| pyproject.toml | Bumped version to 0.13.0 |
| CHANGELOG.md | Added entry for version 0.13.0 |
| RELEASE.md | Added note about updating MIN_SERVER_VERSION |
| examples/create_data_asset.py | Updated imports to use models package |
| examples/run_capsule.py | Updated imports to use models package |
| examples/run_pipeline.py | Updated imports to use models package (contains errors) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Users can now import models from codeocean.data_asset, codeocean.computation, codeocean.capsule, and codeocean.folder instead of codeocean.models.*. Updated examples to use the new import paths. Replaced duplicate folder.py definitions with re-exports from models. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zvikagart
approved these changes
Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
attach_data_assetsanddetach_data_assetstocomputation.pyCloudWorkstationSourceas source for data asset creation