Skip to content

Commit f2d0a83

Browse files
authored
allow datasetId on project creation (#70)
1 parent 64b9ed1 commit f2d0a83

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ htmlcov/
2626
nosetests.xml
2727
coverage.xml
2828
*.cover
29+
30+
.idea

scaleapi/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import IO, Dict, Generator, Generic, List, TypeVar, Union
1+
from typing import IO, Dict, Generator, Generic, List, Optional, TypeVar, Union
22

33
from scaleapi.batches import Batch, BatchStatus
44
from scaleapi.evaluation_tasks import EvaluationTask
@@ -782,20 +782,29 @@ def create_project(
782782
params: Dict = None,
783783
rapid: bool = False,
784784
studio: bool = False,
785+
dataset_id: Optional[str] = None,
785786
) -> Project:
786787
"""Creates a new project.
787788
https://docs.scale.com/reference#project-creation
788789
789790
Args:
790791
project_name (str):
791792
Project name
792-
793793
task_type (TaskType):
794794
Task Type i.e. `TaskType.ImageAnnotation`
795-
796795
params (Dict):
797-
Project parameters to be specificed.
796+
Project parameters to be specified.
798797
i.e. `{'instruction':'Please label the kittens'}`
798+
rapid (bool):
799+
Whether the project being created is a
800+
Scale Rapid project
801+
studio (bool):
802+
Whether the project being created is a
803+
Scale Studio project
804+
dataset_id (str):
805+
Link this project to an existing Nucleus dataset.
806+
All tasks annotated in this project will
807+
be synced to the given dataset.
799808
800809
Returns:
801810
Project: [description]
@@ -807,6 +816,7 @@ def create_project(
807816
params=params,
808817
rapid=rapid,
809818
studio=studio,
819+
datasetId=dataset_id,
810820
)
811821
projectdata = self.api.post_request(endpoint, body=payload)
812822
return Project(projectdata, self)

0 commit comments

Comments
 (0)