Skip to content

Commit

Permalink
アノテーション仕様の標準プラグインに関するEnumを追加しました。 (#520)
Browse files Browse the repository at this point in the history
* プラグイン関係のEnumを定義

* type hintの修正

* ドキュメント更新

* readthedocsのpip更新

* version up

* format

* version up

* エディタプラグインの定義

* version up
  • Loading branch information
yuji38kwmt committed Nov 14, 2022
1 parent d5ea566 commit 6db5d1c
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 20 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ python:
- "3.8"
- "3.9"
- "3.10"
- "3.11-dev"
install:
- pip install pip --upgrade
- pip install "poetry<1.2"
Expand Down
2 changes: 1 addition & 1 deletion annofabapi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.65.0"
__version__ = "0.67.1"
42 changes: 42 additions & 0 deletions annofabapi/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""プラグイン関係"""

from enum import Enum


class EditorPluginId(Enum):
"""
アノテーションエディタの標準(ビルトイン)プラグインのID
"""

THREE_DIMENSION = "bdc16348-107e-4fbc-af4a-e482bc84a60f"
"""
3次元アノテーションエディタの標準プラグインのID
"af-default-annotation-editor-plugin-for-3d-editor"
(Annofab本番環境/開発環境でIDは同じ)
"""


class ExtendSpecsPluginId(Enum):
"""
アノテーション仕様の拡張プラグインのID
"""

THREE_DIMENSION = "703ababa-96ac-4920-8afb-d4f2bddac7e3"
"""
3次元プロジェクトのアノテーション仕様を定義した標準プラグインのID
"af-default-extended-spec-plugin-for-3d-editor"
(Annofab本番環境/開発環境でIDは同じ)
"""


class ThreeDimensionAnnotationType(Enum):
"""
3次元アノテーションの種類(アノテーション種類の標準プラグインで定義されている)
"""

BOUNDING_BOX = "user_bounding_box"
"""バウンディングボックス"""
INSTANCE_SEGMENT = "user_instance_segment"
"""インスタンスセグメント"""
SEMANTIC_SEGMENT = "user_semantic_segment"
"""セマンティックセグメント"""
4 changes: 3 additions & 1 deletion annofabapi/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,9 @@ def delete_all_succeeded_job(self, project_id: str, job_type: ProjectJobType) ->

return deleted_jobs

def get_all_project_job(self, project_id: str, query_params: Dict[str, Any] = None) -> List[ProjectJobInfo]:
def get_all_project_job(
self, project_id: str, query_params: Optional[Dict[str, Any]] = None
) -> List[ProjectJobInfo]:
"""
すべてのバックグランドジョブを取得する。
Expand Down
1 change: 1 addition & 0 deletions docs/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ API reference
resource
utils
parser
plugin
models
dataclass
exceptions
Expand Down
8 changes: 8 additions & 0 deletions docs/api_reference/plugin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
annofabapi.plugin module
==========================



.. automodule:: annofabapi.plugin
:members:

1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
html_theme_options = {
"github_url": "https://github.com/kurusugawa-computer/annofab-api-python-client",
"use_edit_page_button": True,
"footer_items": [], # footerを空にする
}

html_logo = "img/logo_landscape.png"
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx==4.0.2
pydata-sphinx-theme==0.6.3
sphinx==5.3.0
pydata-sphinx-theme==0.11.0


4 changes: 2 additions & 2 deletions docs/user_guide/basic_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WebAPIにリクエストを投げる方法
--------------------------------------------------

``service.api`` には、Web APIに対応するメソッドが定義されています。
メソッド名は、AnnoFab Web APIのOpenAPI specificationに記載されている ``operationId`` を、スネークケース"input1","input2"に変換したものです。
メソッド名は、Annofab Web APIのOpenAPI specificationに記載されている ``operationId`` を、スネークケース"input1","input2"に変換したものです。
各メソッドの戻り値の型は ``Tupple[Content, Response]`` です。 ``Response`` はrequestsモジュールの ``Reponse`` オブジェクトです。
``Content`` は ``Reponse`` の中身です。

Expand Down Expand Up @@ -120,7 +120,7 @@ annofabapiは、pythonのloggingモジュールを利用してログメッセー
from annofabapi import build
servcie = build()
# DEBUG : 2020-12-09 21:09:04,728 : resource.py : annofabapi.resource : build_from_netrc : .netrcファイルからAnnoFab認証情報を読み込みました
# DEBUG : 2020-12-09 21:09:04,728 : resource.py : annofabapi.resource : build_from_netrc : .netrcファイルからAnnofab認証情報を読み込みました
2 changes: 1 addition & 1 deletion docs/user_guide/for_developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@



ローカルのAnnoFab環境にアクセスする方法
ローカルのAnnofab環境にアクセスする方法
--------------------------------------------------

.. code-block:: python
Expand Down
20 changes: 9 additions & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "annofabapi"
version = "0.65.0"
version = "0.67.1"
description = "Python Clinet Library of Annofab WebAPI (https://annofab.com/docs/api/)"
authors = ["yuji38kwmt"]
license = "MIT"
Expand Down
4 changes: 3 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def test_get_annotation(self):
SimpleAnnotation.from_dict(annotation)

def test_get_editor_annotation(self):
editor_annotation, _ = api.get_editor_annotation(project_id, task_id, self.input_data_id, query_params={"v":"2"})
editor_annotation, _ = api.get_editor_annotation(
project_id, task_id, self.input_data_id, query_params={"v": "2"}
)
assert type(editor_annotation) == dict
# dataclassに変換できることの確認
AnnotationV2Output.from_dict(editor_annotation)
Expand Down

0 comments on commit 6db5d1c

Please sign in to comment.