feat: add description to projects and workspaces#314
Open
msd-11 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for a description field on SimAI and GeomAI project/workspace objects, including retrieval via a property, update via a setter method, and inclusion on object creation.
Changes:
- Added
descriptionproperty andset_description()mutator on Project/Workspace data models (SimAI + GeomAI). - Extended
create()methods for projects/workspaces to accept an optionaldescription. - Generalized API
update_*methods to accept arbitrary fields (via**kwargs) and added/extended tests for the new behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_workspace.py | Adds workspace description tests (get/set/create). |
| tests/test_projects.py | Adds project description tests (get/set/create). |
| tests/geomai/test_geomai_workspaces.py | Adds GeomAI workspace description tests (get/set/create). |
| tests/geomai/test_geomai_projects.py | Adds GeomAI project description tests (get/set/create). |
| src/ansys/simai/core/data/workspaces.py | Adds description + set_description() and supports description in workspace creation. |
| src/ansys/simai/core/data/projects.py | Adds description + set_description() and supports description in project creation. |
| src/ansys/simai/core/data/geomai/workspaces.py | Adds description + set_description() and supports description in GeomAI workspace creation. |
| src/ansys/simai/core/data/geomai/projects.py | Adds description + set_description() and supports description in GeomAI project creation. |
| src/ansys/simai/core/api/workspace.py | Changes workspace update API to accept **kwargs. |
| src/ansys/simai/core/api/project.py | Changes project update API to accept **kwargs. |
| src/ansys/simai/core/api/geomai/workspaces.py | Changes GeomAI workspace update API to accept **kwargs. |
| src/ansys/simai/core/api/geomai/projects.py | Changes GeomAI project update API to accept **kwargs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+294
to
+296
| return self._model_from( | ||
| self._client._api.create_workspace(name, model_id, description=description) | ||
| ) |
Comment on lines
+344
to
+346
| return self._model_from( | ||
| self._client._api.create_project(name=name, description=description) | ||
| ) |
Comment on lines
218
to
222
| return self._model_from( | ||
| self._client._api.create_geomai_workspace(name, get_id_from_identifiable(project)) | ||
| self._client._api.create_geomai_workspace( | ||
| name, get_id_from_identifiable(project), description=description | ||
| ) | ||
| ) |
Comment on lines
+226
to
+228
| return self._model_from( | ||
| self._client._api.create_geomai_project(name=name, description=description) | ||
| ) |
Comment on lines
+115
to
119
| def update_workspace(self, workspace_id: str, **kwargs): | ||
| """Update a workspace. | ||
|
|
||
| Args: | ||
| workspace_id: ID of the workspace. |
Comment on lines
+53
to
57
| def update_project(self, project_id: str, **kwargs): | ||
| """Update a project. | ||
|
|
||
| Args: | ||
| project_id: ID of the project. |
Comment on lines
+109
to
113
| def update_geomai_workspace(self, workspace_id: str, **kwargs): | ||
| """Update a GeomAI workspace. | ||
|
|
||
| Args: | ||
| workspace_id: ID of the workspace. |
Comment on lines
+53
to
+60
| def update_geomai_project(self, project_id: str, **kwargs): | ||
| """Update a GeomAI project. | ||
|
|
||
| Args: | ||
| project_id: ID of the project. | ||
| **kwargs: Project fields to pass as keyword arguments. | ||
| """ | ||
| self._patch(f"geomai/projects/{project_id}", json=kwargs, return_json=False) |
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.
Add
descriptionfield to SimAI and GeomAI project/workspace objects.It is possible to retrieve and update this field, and to set it on object creation.