Skip to content

Commit b805c12

Browse files
committed
Error message on shapely package absence
1 parent 4415f03 commit b805c12

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"python.pythonPath": "~/miniconda3/bin/python",
33
"python.formatting.provider": "yapf"
4-
}
4+
}

install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ rm -rf venv_sa_conv
1111
python${PYTHON_VER} -m venv venv_sa_conv
1212
source venv_sa_conv/bin/activate
1313

14+
pip install shapely
1415
pip install -e .
1516
# pip install --pre superannotate
1617
# pip install superannotate

superannotate/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@
2222
from .consensus_benchmark.benchmark import benchmark
2323
from .consensus_benchmark.consensus import consensus
2424
except:
25-
pass
25+
26+
def benchmark(*args, **kwargs):
27+
raise RuntimeError(
28+
"To use superannotate.benchmark or superannotate.consensus functions please install shapely package with # conda install shapely or # pip install shapely"
29+
)
30+
31+
def consensus(*args, **kwargs):
32+
raise RuntimeError(
33+
"To use superannotate.benchmark or superannotate.consensus functions please install shapely package with # conda install shapely or # pip install shapely"
34+
)
35+
2636

2737
from .dataframe_filtering import (
2838
filter_annotation_instances, filter_images_by_comments,

superannotate/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.5.9"
1+
__version__ = "2.5.10"

tests/consensus_benchmark/test_benchmark.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22

3-
from superannotate.consensus_benchmark.benchmark import benchmark
3+
import superannotate as sa
44

55
test_root = Path().resolve() / 'tests'
66

@@ -15,7 +15,7 @@ def test_benchmark():
1515
]
1616
export_path = test_root / 'consensus_benchmark'
1717
for annot_type in annot_types:
18-
res_df = benchmark(
18+
res_df = sa.benchmark(
1919
gt_project_name,
2020
project_names,
2121
export_root=export_path,
@@ -39,7 +39,7 @@ def test_benchmark():
3939
]
4040

4141
#test filtering images with given image names list
42-
res_images = benchmark(
42+
res_images = sa.benchmark(
4343
gt_project_name,
4444
project_names,
4545
export_root=export_path,

tests/consensus_benchmark/test_consensus.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22

3-
from superannotate.consensus_benchmark.consensus import consensus
3+
import superannotate as sa
44

55
test_root = Path().resolve() / 'tests'
66

@@ -14,7 +14,7 @@ def test_consensus():
1414
]
1515
export_path = test_root / 'consensus_benchmark'
1616
for annot_type in annot_types:
17-
res_df = consensus(
17+
res_df = sa.consensus(
1818
project_names, export_root=export_path, annot_type=annot_type
1919
)
2020
#test content of projectName column
@@ -35,7 +35,7 @@ def test_consensus():
3535
]
3636

3737
#test filtering images with given image names list
38-
res_images = consensus(
38+
res_images = sa.consensus(
3939
project_names, export_root=export_path, image_list=image_names
4040
)
4141

0 commit comments

Comments
 (0)