Skip to content

Commit b0f82a1

Browse files
committed
chore: update models and api types
1 parent 9a771e7 commit b0f82a1

File tree

3 files changed

+92
-7
lines changed

3 files changed

+92
-7
lines changed

cryosparc/api.pyi

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ class JobsAPI(APINamespace):
13491349
13501350
"""
13511351
...
1352-
def set_param(self, project_uid: str, job_uid: str, param: str, /, *, value: Any) -> Job:
1352+
def set_param(self, project_uid: str, job_uid: str, param: str, /, value: Any) -> Job:
13531353
"""
13541354
Sets the given job parameter to the value
13551355
@@ -1710,9 +1710,12 @@ class JobsAPI(APINamespace):
17101710
self, project_uid: str, job_uid: str, output_name: str, /, result_names: Optional[List[str]] = None
17111711
) -> None:
17121712
"""
1713-
Prepares a job's output for import to another project or instance. Creates a folder in the project directory → exports subfolder,
1714-
then links the output's associated files there..
1715-
Note that the returned .csg file's parent folder must be manually copied with symlinks resolved into the target project folder before importing.
1713+
Prepares a job's output for import to another project or instance.
1714+
Creates a folder in the project directory → exports subfolder,
1715+
then links the output's associated files there.
1716+
1717+
Note that the returned .csg file's parent folder must be manually copied
1718+
with symlinks resolved into the target project folder before importing.
17161719
17171720
Args:
17181721
project_uid (str): Project UID, e.g., "P3"
@@ -2688,6 +2691,31 @@ class SessionsAPI(APINamespace):
26882691
Returns:
26892692
Session: Successful Response
26902693
2694+
"""
2695+
...
2696+
def clone(
2697+
self,
2698+
project_uid: str,
2699+
session_uid: str,
2700+
/,
2701+
*,
2702+
title: Optional[str] = None,
2703+
description: Optional[str] = None,
2704+
created_by_job_uid: Optional[str] = None,
2705+
) -> Session:
2706+
"""
2707+
Clones an existing session, copying session configuration, parameters, and exposure groups.
2708+
2709+
Args:
2710+
project_uid (str): Project UID, e.g., "P3"
2711+
session_uid (str): Session UID, e.g., "S3"
2712+
title (str, optional): Defaults to None
2713+
description (str, optional): Defaults to None
2714+
created_by_job_uid (str, optional): Defaults to None
2715+
2716+
Returns:
2717+
Session: Successful Response
2718+
26912719
"""
26922720
...
26932721
def find_exposure_groups(self, project_uid: str, session_uid: str, /) -> List[ExposureGroup]:
@@ -2801,6 +2829,27 @@ class SessionsAPI(APINamespace):
28012829
Returns:
28022830
Session: Successful Response
28032831
2832+
"""
2833+
...
2834+
def configure_auto_pause(
2835+
self,
2836+
project_uid: str,
2837+
session_uid: str,
2838+
/,
2839+
*,
2840+
auto_pause: Literal["disabled", "graceful", "immediate"],
2841+
auto_pause_after_idle_minutes: int = 10,
2842+
) -> Session:
2843+
"""
2844+
Args:
2845+
project_uid (str): Project UID, e.g., "P3"
2846+
session_uid (str): Session UID, e.g., "S3"
2847+
auto_pause (Literal['disabled', 'graceful', 'immediate']):
2848+
auto_pause_after_idle_minutes (int, optional): Defaults to 10
2849+
2850+
Returns:
2851+
Session: Successful Response
2852+
28042853
"""
28052854
...
28062855
def update_compute_configuration(
@@ -3117,6 +3166,22 @@ class SessionsAPI(APINamespace):
31173166
Returns:
31183167
Session: Successful Response
31193168
3169+
"""
3170+
...
3171+
def set_session_phase_one_wait_for_exposures(
3172+
self, project_uid: str, session_uid: str, /, *, phase_one_wait_for_exposures: bool
3173+
) -> Session:
3174+
"""
3175+
Sets whether to wait until exposures are available before queuing the session's preprocessing worker jobs.
3176+
3177+
Args:
3178+
project_uid (str): Project UID, e.g., "P3"
3179+
session_uid (str): Session UID, e.g., "S3"
3180+
phase_one_wait_for_exposures (bool):
3181+
3182+
Returns:
3183+
Session: Successful Response
3184+
31203185
"""
31213186
...
31223187
def update_picking_threshold_values(
@@ -3914,6 +3979,20 @@ class ExposuresAPI(APINamespace):
39143979
Returns:
39153980
Exposure: Unrejected exposure
39163981
3982+
"""
3983+
...
3984+
def mark_failed(self, project_uid: str, session_uid: str, exposure_uid: int, /) -> Exposure:
3985+
"""
3986+
Mark an exposure as failed.
3987+
3988+
Args:
3989+
project_uid (str): Project UID, e.g., "P3"
3990+
session_uid (str): Session UID, e.g., "S3"
3991+
exposure_uid (int):
3992+
3993+
Returns:
3994+
Exposure: Successful Response
3995+
39173996
"""
39183997
...
39193998
def toggle_manual_reject_exposure(self, project_uid: str, session_uid: str, exposure_uid: int, /) -> Exposure:
@@ -4521,6 +4600,7 @@ class ProjectsAPI(APINamespace):
45214600
clear_categories: List[Category] = [],
45224601
clear_types: List[str] = [],
45234602
clear_statuses: List[JobStatus] = [],
4603+
clear_preprocessing: bool = False,
45244604
) -> None:
45254605
"""
45264606
Cleanup project or workspace data, clearing/deleting jobs based on final result status, sections, types, or job status
@@ -4534,6 +4614,7 @@ class ProjectsAPI(APINamespace):
45344614
clear_categories (List[Category], optional): Defaults to []
45354615
clear_types (List[str], optional): Defaults to []
45364616
clear_statuses (List[JobStatus], optional): Defaults to []
4617+
clear_preprocessing (bool, optional): Defaults to False
45374618
45384619
"""
45394620
...

cryosparc/models/session.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class LiveComputeResources(BaseModel):
9191
auxiliary_gpus: int = 1
9292
auxiliary_ssd: bool = True
9393
priority: int = 0
94+
phase_one_workers_per_gpu: int = 1
9495

9596

9697
class LiveVolumeInfo(BaseModel):
@@ -343,6 +344,7 @@ class Session(BaseModel):
343344
compute_resources: LiveComputeResources = LiveComputeResources()
344345
notes: str = ""
345346
notes_lock: Optional[str] = None
347+
phase_one_wait_for_exposures: bool = False
346348
phase_one_workers: Dict[str, RtpWorkerState] = {}
347349
"""
348350
Example: {'J1': RtpWorkerState(status=<JobStatus.BUILDING: 'building'>, errors=[]),
@@ -431,11 +433,13 @@ class Session(BaseModel):
431433
phase2_refine_ready_partial: bool = False
432434
phase2_refine_num_particles_in: int = 0
433435
phase2_refine_last_updated: Optional[datetime.datetime] = None
434-
athena_epu_run_id: Optional[str] = None
435-
is_multigrid_epu_run: bool = False
436+
auto_pause: Literal["disabled", "graceful", "immediate"] = "disabled"
437+
auto_pause_after_idle_minutes: int = 10
436438
is_gracefully_pausing: bool = False
437439
computed_stats_last_run_time: Optional[datetime.datetime] = None
438440
last_processed_exposure_priority: Literal["normal", "oldest", "latest", "alternate"] = "oldest"
441+
athena_epu_run_id: Optional[str] = None
442+
is_multigrid_epu_run: bool = False
439443
ecl: ECLSessionProperties = ECLSessionProperties()
440444
uid_num: int
441445
project_uid_num: int

cryosparc/models/session_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def __getattr__(self, key: str) -> Any: ...
265265
class LiveAbinitParams(BaseModel):
266266
abinit_symmetry: str = "C1"
267267
abinit_K: int = 1
268-
abinit_num_particles: Optional[int] = None
268+
abinit_num_particles: Optional[int] = 100000
269269

270270
model_config = ConfigDict(extra="allow")
271271
if TYPE_CHECKING:

0 commit comments

Comments
 (0)