Skip to content

Commit 40a9d3d

Browse files
committed
chore: upate models
1 parent 2397261 commit 40a9d3d

File tree

9 files changed

+80
-64
lines changed

9 files changed

+80
-64
lines changed

cryosparc/api.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,13 +703,17 @@ class ResourcesAPI(APINamespace):
703703
704704
"""
705705
...
706-
def add_node(self, body: SchedulerTargetNode) -> SchedulerTargetNode:
706+
def add_node(self, body: SchedulerTargetNode, *, gpu: bool = True) -> SchedulerTargetNode:
707707
"""
708708
Adds a node or updates an existing node. Updates existing node if they share
709-
share the same name.
709+
share the same name. Attempts to connect to the node via SSH to run
710+
the ``cryosparcw connect`` command.
711+
712+
Set ``gpu`` to False to skip GPU detection.
710713
711714
Args:
712715
body (SchedulerTargetNode):
716+
gpu (bool, optional): Defaults to True
713717
714718
Returns:
715719
SchedulerTargetNode: Successful Response

cryosparc/model_registry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
params,
2222
preview,
2323
project,
24+
resource,
2425
scheduler_lane,
2526
scheduler_target,
2627
services,
@@ -38,6 +39,7 @@
3839

3940
register_model_module(job, include_literals=True)
4041
register_model_module(scheduler_target, include_literals=True)
42+
register_model_module(resource, include_literals=True)
4143
register_model_module(gpu, include_literals=True)
4244
register_model_module(api_request, include_literals=True)
4345
register_model_module(session, include_literals=True)

cryosparc/models/api_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE IS AUTO-GENERATED, DO NOT EDIT DIRECTLY
22
# SEE dev/api_generate_models.py
3-
from typing import List, Optional
3+
from typing import List, Literal, Optional
44

55
from pydantic import BaseModel
66

@@ -13,7 +13,7 @@ class BrowseFile(BaseModel):
1313
is_link: bool = False
1414
mtime: Optional[float] = None
1515
size: Optional[int] = None
16-
type: Optional[str] = None
16+
type: Optional[Literal["dir", "file"]] = None
1717
link_path: Optional[str] = None
1818
errmesg: Optional[str] = None
1919

cryosparc/models/job.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
from .instance import InstanceInformation
99
from .job_spec import JobBuildError, JobSpec
10-
from .scheduler_target import FixedResourceSlots, ResourceSlots, SchedulerTarget
10+
from .resource import FixedResourceSlots, ResourceSlots
11+
from .scheduler_target import SchedulerTarget
1112

1213

1314
class AllocatedResources(BaseModel):

cryosparc/models/job_spec.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
from pydantic import BaseModel, ConfigDict, RootModel
66

7+
from .resource import ResourceSpec
8+
79
BuilderTag = Literal[
810
"new", "interactive", "gpuEnabled", "multiGpu", "utility", "import", "live", "benchmark", "wrapper"
911
]
@@ -439,30 +441,6 @@ class Outputs(RootModel):
439441
"""
440442

441443

442-
class ResourceSpec(BaseModel):
443-
"""
444-
Job resource requirements. Used to allocate compute resources for a job
445-
at queue time.
446-
"""
447-
448-
cpu: int = 1
449-
"""
450-
Number of required CPU cores
451-
"""
452-
gpu: int = 0
453-
"""
454-
Number of required GPUs
455-
"""
456-
ram: int = 1
457-
"""
458-
Number of 8GiB RAM slots
459-
"""
460-
ssd: bool = False
461-
"""
462-
Whether an SSD is required for temporary storage.
463-
"""
464-
465-
466444
class JobSpec(BaseModel):
467445
"""
468446
Job's unique specification details. Defines the parameters, inputs, outputs

cryosparc/models/resource.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# THIS FILE IS AUTO-GENERATED, DO NOT EDIT DIRECTLY
2+
# SEE dev/api_generate_models.py
3+
from typing import List
4+
5+
from pydantic import BaseModel
6+
7+
8+
class ResourceSlots(BaseModel):
9+
"""
10+
Listings of available resources on a worker node that may be allocated for
11+
scheduling.
12+
"""
13+
14+
CPU: List[int] = []
15+
"""
16+
List of available CPU core indices.
17+
"""
18+
GPU: List[int] = []
19+
"""
20+
List of available GPU indices.
21+
"""
22+
RAM: List[int] = []
23+
"""
24+
List of available 8GB slots.
25+
"""
26+
27+
28+
class FixedResourceSlots(BaseModel):
29+
"""
30+
Available resource slots that only indicate presence, not the amount that
31+
may be allocated. (i.e., "SSD is available or not available")
32+
"""
33+
34+
SSD: bool = False
35+
"""
36+
Whether this target thas an SSD
37+
"""
38+
39+
40+
class ResourceSpec(BaseModel):
41+
"""
42+
Job resource requirements. Used to allocate compute resources for a job
43+
at queue time.
44+
"""
45+
46+
cpu: int = 1
47+
"""
48+
Number of required CPU cores
49+
"""
50+
gpu: int = 0
51+
"""
52+
Number of required GPUs
53+
"""
54+
ram: int = 1
55+
"""
56+
Number of 8GiB RAM slots
57+
"""
58+
ssd: bool = False
59+
"""
60+
Whether an SSD is required for temporary storage.
61+
"""

cryosparc/models/scheduler_target.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,7 @@
55
from pydantic import BaseModel
66

77
from .gpu import Gpu
8-
9-
10-
class ResourceSlots(BaseModel):
11-
"""
12-
Listings of available resources on a worker node that may be allocated for
13-
scheduling.
14-
"""
15-
16-
CPU: List[int] = []
17-
"""
18-
List of available CPU core indices.
19-
"""
20-
GPU: List[int] = []
21-
"""
22-
List of available GPU indices.
23-
"""
24-
RAM: List[int] = []
25-
"""
26-
List of available 8GB slots.
27-
"""
28-
29-
30-
class FixedResourceSlots(BaseModel):
31-
"""
32-
Available resource slots that only indicate presence, not the amount that
33-
may be allocated. (i.e., "SSD is available or not available")
34-
"""
35-
36-
SSD: bool = False
37-
"""
38-
Whether this target thas an SSD
39-
"""
8+
from .resource import FixedResourceSlots, ResourceSlots
409

4110

4211
class Node(BaseModel):

cryosparc/models/session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class ExposureGroup(BaseModel):
5252
defect_path: Optional[str] = None
5353
file_engine_recursive: bool = False
5454
file_engine_watch_path_abs: str = "/"
55+
file_engine_enable: bool = False
5556
file_engine_filter: str = "*"
5657
file_engine_interval: int = 10
5758
file_engine_min_file_size: int = 0
5859
file_engine_min_modified_time_delta: int = 0
5960
exp_group_id: int = 1
6061
num_exposures_found: int = 0
6162
file_engine_strategy: Literal["entity", "timestamp", "eclathena"] = "entity"
62-
file_engine_enable: bool = False
6363
final: bool = False
6464
is_any_eer: bool = False
6565

@@ -74,6 +74,7 @@ class ExposureGroupUpdate(BaseModel):
7474
defect_path: Optional[str] = None
7575
file_engine_recursive: bool = False
7676
file_engine_watch_path_abs: str = "/"
77+
file_engine_enable: bool = False
7778
file_engine_filter: str = "*"
7879
file_engine_interval: int = 10
7980
file_engine_min_file_size: int = 0

cryosparc/models/session_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class LivePreprocessingParams(BaseModel):
3333
"""
3434
Are the samples negative stain (True) or cryo (False)?
3535
"""
36-
eer_upsampfactor: int = 2
36+
eer_upsampfactor: int = 1
3737
"""
3838
EER upsampling factor (applies to .eer/.ecc format data only.
3939
"""
@@ -226,7 +226,7 @@ class LivePreprocessingParams(BaseModel):
226226
"""
227227
templates_from_job: Optional[str] = None
228228
templates_selected: Optional[str] = None
229-
thresh_score_min: Optional[float] = None
229+
thresh_score_min: float = 0.3
230230
"""
231231
Minimum picking score threshold
232232
"""

0 commit comments

Comments
 (0)