Skip to content

Commit d7c8002

Browse files
authored
Merge pull request #594 from superannotateai/develop
Develop
2 parents 144146c + 82b48bd commit d7c8002

35 files changed

+1002
-606
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ on:
77
jobs:
88
build-n-publish:
99
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
10-
runs-on: ubuntu-18.04
10+
runs-on: ubuntu-20.04
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1313
- name: Set up Python
14-
uses: actions/setup-python@v1
14+
uses: actions/setup-python@v4
1515
with:
16-
python-version: "3.7"
16+
python-version: "3.8"
1717
- name: Upgrade pip
1818
run: >-
1919
python -m
@@ -36,7 +36,7 @@ jobs:
3636
.
3737
- name: Publish distribution 📦 to PyPI
3838
if: startsWith(github.ref, 'refs/tags')
39-
uses: pypa/gh-action-pypi-publish@master
39+
uses: pypa/gh-action-pypi-publish@release/v1
4040
with:
4141
password: ${{ secrets.pypi_password }}
4242
verbose: true

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22
All release highlights of this project will be documented in this file.
3+
## 4.4.11 - April 2, 2023
4+
### Added
5+
- `SAClient.set_project_status()` method.
6+
- `SAClient.set_folder_status()` method.
7+
### Updated
8+
- `SAClient.create_annotation_class()` added OCR type attribute group support in the vector projects.
9+
- `SAClient.create_annotation_classes_from_classes_json()` added OCR type attribute group support in the vector projects.
310
## 4.4.10 - March 12, 2023
411
### Updated
512
- Configuration file creation flow

docs/source/api_reference/api_client.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Contents
99
:maxdepth: 8
1010

1111
api_project
12+
api_folder
1213
api_item
1314
api_annotation
1415
api_annotation_class
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=======
2+
Folders
3+
=======
4+
5+
.. automethod:: superannotate.SAClient.search_folders
6+
.. automethod:: superannotate.SAClient.assign_folder
7+
.. automethod:: superannotate.SAClient.unassign_folder
8+
.. automethod:: superannotate.SAClient.get_folder_by_id
9+
.. automethod:: superannotate.SAClient.get_folder_metadata
10+
.. automethod:: superannotate.SAClient.create_folder
11+
.. automethod:: superannotate.SAClient.delete_folders

docs/source/api_reference/api_image.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
==========
1+
======
22
Images
3-
==========
3+
======
44

55

66
.. _ref_search_images:
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
==========
1+
========
22
Projects
3-
==========
3+
========
44
.. _ref_projects:
55
.. _ref_search_projects:
6-
.. automethod:: superannotate.SAClient.search_projects
76
.. automethod:: superannotate.SAClient.create_project
7+
.. automethod:: superannotate.SAClient.search_projects
88
.. automethod:: superannotate.SAClient.create_project_from_metadata
99
.. automethod:: superannotate.SAClient.clone_project
10-
.. automethod:: superannotate.SAClient.delete_project
1110
.. automethod:: superannotate.SAClient.rename_project
11+
.. automethod:: superannotate.SAClient.delete_project
1212
.. _ref_get_project_metadata:
1313
.. automethod:: superannotate.SAClient.get_project_by_id
14+
.. automethod:: superannotate.SAClient.set_project_status
1415
.. automethod:: superannotate.SAClient.get_project_metadata
1516
.. automethod:: superannotate.SAClient.get_project_image_count
16-
.. automethod:: superannotate.SAClient.search_folders
17-
.. automethod:: superannotate.SAClient.assign_folder
18-
.. automethod:: superannotate.SAClient.unassign_folder
19-
.. automethod:: superannotate.SAClient.get_folder_by_id
20-
.. automethod:: superannotate.SAClient.get_folder_metadata
21-
.. automethod:: superannotate.SAClient.create_folder
22-
.. automethod:: superannotate.SAClient.delete_folders
2317
.. automethod:: superannotate.SAClient.upload_images_to_project
2418
.. automethod:: superannotate.SAClient.attach_items_from_integrated_storage
2519
.. automethod:: superannotate.SAClient.upload_image_to_project
@@ -30,5 +24,5 @@ Projects
3024
.. automethod:: superannotate.SAClient.add_contributors_to_project
3125
.. automethod:: superannotate.SAClient.get_project_settings
3226
.. automethod:: superannotate.SAClient.set_project_default_image_quality_in_editor
33-
.. automethod:: superannotate.SAClient.get_project_workflow
3427
.. automethod:: superannotate.SAClient.set_project_workflow
28+
.. automethod:: superannotate.SAClient.get_project_workflow

docs/source/api_reference/api_team.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
==========
1+
====
22
Team
3-
==========
3+
====
44

55

66
.. automethod:: superannotate.SAClient.get_team_metadata

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ mixpanel==4.8.3
1717
pydantic>=1.10.4
1818
setuptools>=57.4.0
1919
email-validator>=1.0.3
20-
nest-asyncio==1.5.4
2120
jsonschema==3.2.0
2221
pandas>=1.1.4
2322
aiofiles==0.8.0

src/superannotate/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import sys
44
import typing
55

6-
__version__ = "4.4.10"
6+
__version__ = "4.4.11"
7+
78

89
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
910

src/superannotate/lib/app/interface/base_interface.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import functools
22
import json
33
import os
4+
import platform
45
import sys
56
import typing
67
from inspect import signature
@@ -33,7 +34,7 @@ def __init__(self, token: TokenStr = None, config_path: str = None):
3334
if token:
3435
config = ConfigEntity(SA_TOKEN=token)
3536
elif config_path:
36-
config_path = Path(config_path)
37+
config_path = Path(config_path).expanduser()
3738
if not Path(config_path).is_file() or not os.access(
3839
config_path, os.R_OK
3940
):
@@ -124,10 +125,10 @@ def _retrieve_configs_from_env() -> typing.Union[ConfigEntity, None]:
124125
class Tracker:
125126
def get_mp_instance(self) -> Mixpanel:
126127
client = self.get_client()
127-
mp_token = "ca95ed96f80e8ec3be791e2d3097cf51"
128-
if client:
129-
if client.host != constants.BACKEND_URL:
130-
mp_token = "e741d4863e7e05b1a45833d01865ef0d"
128+
if client.controller._config.API_URL == constants.BACKEND_URL: # noqa
129+
mp_token = "ca95ed96f80e8ec3be791e2d3097cf51"
130+
else:
131+
mp_token = "e741d4863e7e05b1a45833d01865ef0d"
131132
return Mixpanel(mp_token)
132133

133134
@staticmethod
@@ -137,6 +138,8 @@ def get_default_payload(team_name, user_id):
137138
"Team": team_name,
138139
"Team Owner": user_id,
139140
"Version": __version__,
141+
"Python version": platform.python_version(),
142+
"Python interpreter type": platform.python_implementation(),
140143
}
141144

142145
def __init__(self, function):
@@ -170,6 +173,10 @@ def default_parser(function_name: str, kwargs: dict) -> tuple:
170173
for key, value in kwargs.items():
171174
if key == "self":
172175
continue
176+
elif key == "token":
177+
properties["sa_token"] = str(bool(value))
178+
elif key == "config_path":
179+
properties[key] = str(bool(value))
173180
elif value is None:
174181
properties[key] = value
175182
elif key == "project":
@@ -241,5 +248,6 @@ def __new__(mcs, name, bases, attrs):
241248
attr_value, FunctionType
242249
) and not attr_value.__name__.startswith("_"):
243250
attrs[attr_name] = Tracker(validate_arguments(attr_value))
251+
attrs["__init__"] = Tracker(validate_arguments(attrs["__init__"]))
244252
tmp = super().__new__(mcs, name, bases, attrs)
245253
return tmp

0 commit comments

Comments
 (0)