Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cryosparc/controllers/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,24 @@ def clear(self):
"""
self.model = self.cs.api.jobs.clear(self.project_uid, self.uid)

def set_title(self, title: str):
"""
Set the job title.

Args:
title (str): New job title
"""
self.model = self.cs.api.jobs.set_title(self.project_uid, self.uid, title=title)

def set_description(self, desc: str):
"""
Set the job description. May include Markdown formatting.

Args:
desc (str): New job description
"""
self.model = self.cs.api.jobs.set_description(self.project_uid, self.uid, description=desc)

def set_param(self, name: str, value: Any, **kwargs) -> bool:
"""
Set the given param name on the current job to the given value. Only
Expand Down
18 changes: 18 additions & 0 deletions cryosparc/controllers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,24 @@ def dir(self) -> PurePosixPath:
"""Full path to project directory."""
return PurePosixPathProperty(self.cs.api.projects.get_directory(self.uid))

def set_title(self, title: str):
"""
Set the project title.

Args:
title (str): New project title
"""
self.model = self.cs.api.projects.set_title(self.uid, title=title)

def set_description(self, desc: str):
"""
Set the project description. May include Markdown formatting.

Args:
desc (str): New project description
"""
self.model = self.cs.api.projects.set_description(self.uid, description=desc)

def find_workspaces(self, *, order: Literal[1, -1] = 1) -> Iterable[WorkspaceController]:
"""
Get all workspaces available in the current project.
Expand Down
18 changes: 18 additions & 0 deletions cryosparc/controllers/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ def refresh(self):
self.model = self.cs.api.workspaces.find_one(self.project_uid, self.uid)
return self

def set_title(self, title: str):
"""
Set the workspace title.

Args:
title (str): New workspace title
"""
self.model = self.cs.api.workspaces.set_title(self.project_uid, self.uid, title=title)

def set_description(self, desc: str):
"""
Set the workspace description. May include Markdown formatting.

Args:
desc (str): New workspace description
"""
self.model = self.cs.api.workspaces.set_description(self.project_uid, self.uid, description=desc)

def find_jobs(self, *, order: Literal[1, -1] = 1, **search: Unpack[JobSearch]) -> Iterable[JobController]:
"""
Search jobs in the current workspace.
Expand Down
Loading