Skip to content

Commit fd4f6d9

Browse files
committed
clone project rename
1 parent e1cf3b9 commit fd4f6d9

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

docs/source/superannotate.sdk.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ________
2323
.. _ref_search_projects:
2424
.. autofunction:: superannotate.search_projects
2525
.. autofunction:: superannotate.create_project
26+
.. autofunction:: superannotate.clone_project
2627
.. autofunction:: superannotate.create_project_like_project
2728
.. autofunction:: superannotate.delete_project
2829
.. autofunction:: superannotate.rename_project

superannotate/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
image_path_to_annotation_paths, project_type_int_to_str,
2222
project_type_str_to_int, user_role_str_to_int
2323
)
24-
from .consensus_benchmark.consensus import consensus
2524
from .consensus_benchmark.benchmark import benchmark
25+
from .consensus_benchmark.consensus import consensus
2626
from .dataframe_filtering import (
2727
filter_annotation_instances, filter_images_by_comments,
2828
filter_images_by_tags
@@ -50,7 +50,7 @@
5050
assign_images, copy_image, move_image, pin_image, upload_image_to_project
5151
)
5252
from .db.projects import (
53-
create_project, create_project_like_project, delete_project,
53+
clone_project, create_project, create_project_like_project, delete_project,
5454
get_project_default_image_quality_in_editor, get_project_image_count,
5555
get_project_settings, get_project_workflow, rename_project,
5656
set_project_default_image_quality_in_editor, set_project_settings,

superannotate/db/projects.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def create_project(project_name, project_description, project_type):
8181
)
8282
return res
8383

84-
8584
def create_project_like_project(
8685
project_name,
8786
from_project,
@@ -90,6 +89,22 @@ def create_project_like_project(
9089
copy_settings=True,
9190
copy_workflow=True,
9291
copy_project_contributors=False
92+
):
93+
"""Deprecated. Function name changed to clone_project.
94+
"""
95+
logger.warning("Deprecated. Function name changed to clone_project.")
96+
clone_project(project_name, from_project, project_description,
97+
copy_annotation_classes, copy_settings,
98+
copy_workflow, copy_project_contributors)
99+
100+
def clone_project(
101+
project_name,
102+
from_project,
103+
project_description=None,
104+
copy_annotation_classes=True,
105+
copy_settings=True,
106+
copy_workflow=True,
107+
copy_project_contributors=False
93108
):
94109
"""Create a new project in the team using annotation classes and settings from from_project.
95110

tests/test_create_project_like.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_create_like_project(tmpdir):
4242
for project in projects:
4343
sa.delete_project(project)
4444

45-
new_project = sa.create_project_like_project(
45+
new_project = sa.clone_project(
4646
PROJECT_NAME2, PROJECT_NAME, copy_project_contributors=True
4747
)
4848
assert new_project["description"] == "tt"

0 commit comments

Comments
 (0)