Skip to content

Commit d5c6881

Browse files
committed
2 parents a9aaea5 + 8217fb6 commit d5c6881

File tree

15 files changed

+52
-64
lines changed

15 files changed

+52
-64
lines changed

.readthedocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ formats:
2121
python:
2222
version: 3.7
2323
install:
24-
- requirements: requirements.txt
24+
- requirements: requirements.txt
25+
- requirements: requirements_extra.txt

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include README.md
22
include requirements.txt
3+
include requirements_extra.txt
34
include LICENSE

Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
.PHONY: all clean tests stress-tests coverage test_coverage install lint docs dist check_formatting
1+
.PHONY: clean tests stress-tests test_coverage install lint docs dist check_formatting
22

33
PYTHON=python3
44
PYLINT=pylint
55
PYTESTS=pytest
66
COVERAGE=coverage
77

88
tests: check_formatting docs
9-
$(PYTESTS) -n auto
9+
$(PYTESTS) -n auto tests
1010

1111
stress-tests: SA_STRESS_TESTS=1
1212
stress-tests: tests
13-
$(PYTESTS) -n auto
1413

1514
clean:
1615
rm -rf superannotate.egg-info
1716
rm -rf build
1817
rm -rf dist
1918
rm -rf htmlcov
2019

21-
coverage: test_coverage
22-
2320
test_coverage: check_formatting
24-
-$(PYTESTS) --cov=superannotate -n auto
21+
-$(PYTESTS) --cov=superannotate -n auto tests
2522
$(COVERAGE) html
2623
@echo "\033[95m\n\nCoverage successful! View the output at file://htmlcov/index.html.\n\033[0m"
2724

2825
install:
29-
pip install .
26+
pip install -e .
3027

3128
lint: check_formatting
3229
-$(PYLINT) --output-format=json superannotate/ | pylint-json2html -o pylint.html

docs/source/tutorial.sdk.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ SDK is available on PyPI:
2020
The package officially supports Python 3.6+ and was tested under Linux and
2121
Windows (`Anaconda <https://www.anaconda.com/products/individual#windows>`_) platforms.
2222

23-
For Windows based Anaconda distribution
24-
you might also need to install beforehand :py:obj:`shapely` package:
23+
For Windows and Mac OS based installations to use :py:obj:`benchmark` and :py:obj:`consensus`
24+
functions you might also need to install beforehand :py:obj:`shapely` package,
25+
which we found to work properly only under Anaconda distribution, with:
2526

2627
.. code-block:: bash
2728
2829
conda install shapely
2930
30-
and `C++ build tools from Microsoft
31-
<https://go.microsoft.com/fwlink/?LinkId=691126>`_.
3231
3332
----------
3433

install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +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
14+
# pip install shapely
1515
pip install -e .
1616
# pip install --pre superannotate
1717
# pip install superannotate
@@ -20,13 +20,13 @@ pip install -e .
2020
pip install pytest pytest-xdist
2121

2222
# for coverage
23-
# pip install coverage pytest-cov
23+
pip install coverage pytest-cov
2424

2525
# for linting
26-
# pip install pylint pylint-json2html pylint-pytest
26+
pip install pylint pylint-json2html pylint-pytest
2727

2828
# for docs
29-
# pip install sphinx sphinx_rtd_theme
29+
pip install sphinx sphinx_rtd_theme
3030

3131
# for on PyPI distribution
32-
# pip install twine
32+
pip install twine

pytest.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

requirements_extra.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Shapely>=1.7.1

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
import sys
2+
13
from setuptools import find_packages, setup
24

35
with open('requirements.txt') as f:
46
requirements = f.read()
5-
67
requirements = requirements.splitlines()
78

9+
if sys.platform == 'linux':
10+
with open('requirements_extra.txt') as f:
11+
requirements_extra = f.read()
12+
13+
requirements_extra = requirements_extra.splitlines()
14+
requirements += requirements_extra
15+
816
with open('README.md') as f:
917
readme = f.read()
1018
readme = "\n".join(readme.split('\n')[2:])

superannotate/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@
2222
from .consensus_benchmark.benchmark import benchmark
2323
from .consensus_benchmark.consensus import consensus
2424
except:
25+
_WARNING_SHAPELY = "To use superannotate.benchmark or superannotate.consensus functions please install shapely package in Anaconda enviornment with # conda install shapely"
2526

2627
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-
)
28+
raise RuntimeError(_WARNING_SHAPELY)
3029

3130
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-
)
31+
raise RuntimeError(_WARNING_SHAPELY)
3532

3633

3734
from .dataframe_filtering import (

superannotate/db/annotation_classes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ def fill_class_and_attribute_ids(annotation_json, annotation_classes_dict):
350350

351351
def check_annotation_json(annotation_json):
352352
if "metadata" not in annotation_json or "width" not in annotation_json[
353-
"metadata"] or "height" not in annotation_json["metadata"]:
353+
"metadata"] or "height" not in annotation_json[
354+
"metadata"] or "name" not in annotation_json["metadata"]:
354355
return False
355356
else:
356357
return True

0 commit comments

Comments
 (0)