Skip to content

Commit

Permalink
Annofab v0.158.4対応 (#513)
Browse files Browse the repository at this point in the history
* poetry update

* yaml追加

* travisciのpoetryバージョンの上限を指定

* generated_apiの追加

* dataclassの名前の変更

* 名前の変更

* version up
  • Loading branch information
yuji38kwmt committed Nov 2, 2022
1 parent c91a216 commit 051fd2a
Show file tree
Hide file tree
Showing 14 changed files with 1,931 additions and 336 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ python:
- "3.10"
install:
- pip install pip --upgrade
- pip install poetry
- pip install "poetry<1.2"
- travis_retry poetry install
script:
- make lint
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.63.0"
__version__ = "0.64.0"
19 changes: 10 additions & 9 deletions annofabapi/dataclass/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
TaskStatus,
)

AnnotationData = Union[str, Dict[str, Any]]
FullAnnotationData = Any
AdditionalDataValue = Dict[str, Any]
FullAnnotationAdditionalDataValue = Dict[str, Any]
AnnotationDataV1 = Union[str, Dict[str, Any]]


@dataclass
Expand Down Expand Up @@ -122,7 +123,7 @@ class FullAnnotationDataRange(DataClassJsonMixin):


@dataclass
class AdditionalData(DataClassJsonMixin):
class AdditionalDataV1(DataClassJsonMixin):
""" """

additional_data_definition_id: str
Expand Down Expand Up @@ -156,7 +157,7 @@ class FullAnnotationAdditionalData(DataClassJsonMixin):
type: AdditionalDataDefinitionType
""""""

value: AdditionalDataValue
value: FullAnnotationAdditionalDataValue
""""""


Expand Down Expand Up @@ -303,7 +304,7 @@ class SingleAnnotationDetail(DataClassJsonMixin):
url: Optional[str]
"""data_holding_typeがouterの場合のみ存在し、データへの一時URLが格納される"""

additional_data_list: List[AdditionalData]
additional_data_list: List[AdditionalDataV1]
"""属性情報。 アノテーション属性の種類(`additional_data_definition`の`type`)によって、属性値を格納するプロパティは変わります。 | 属性の種類 | `additional_data_definition`の`type` | 属性値を格納するプロパティ | |------------|-------------------------|----------------------| | ON/OFF | flag | flag | | 整数 | integer | integer | | 自由記述(1行)| text | comment | | 自由記述(複数行)| comment | comment | | トラッキングID | tracking | comment | | アノテーションリンク | link | comment | | 排他選択(ラジオボタン) |choice | choice | | 排他選択(ドロップダウン) | select | choice | """

created_datetime: str
Expand Down Expand Up @@ -334,7 +335,7 @@ class SingleAnnotation(DataClassJsonMixin):


@dataclass
class AnnotationDetail(DataClassJsonMixin):
class AnnotationDetailV1(DataClassJsonMixin):
""" """

annotation_id: str
Expand All @@ -352,7 +353,7 @@ class AnnotationDetail(DataClassJsonMixin):
data_holding_type: AnnotationDataHoldingType
""""""

data: Optional[AnnotationData]
data: Optional[AnnotationDataV1]
""""""

path: Optional[str]
Expand All @@ -364,7 +365,7 @@ class AnnotationDetail(DataClassJsonMixin):
url: Optional[str]
"""外部ファイルに保存されたアノテーションの認証済み一時URL。`data_holding_type`が`inner`の場合、または[putAnnotation](#operation/putAnnotation) APIのリクエストボディに渡す場合は未指定です。"""

additional_data_list: List[AdditionalData]
additional_data_list: List[AdditionalDataV1]
"""属性情報。 アノテーション属性の種類(`additional_data_definition`の`type`)によって、属性値を格納するプロパティは変わります。 | 属性の種類 | `additional_data_definition`の`type` | 属性値を格納するプロパティ | |------------|-------------------------|----------------------| | ON/OFF | flag | flag | | 整数 | integer | integer | | 自由記述(1行)| text | comment | | 自由記述(複数行)| comment | comment | | トラッキングID | tracking | comment | | アノテーションリンク | link | comment | | 排他選択(ラジオボタン) |choice | choice | | 排他選択(ドロップダウン) | select | choice | """

created_datetime: Optional[str]
Expand All @@ -375,7 +376,7 @@ class AnnotationDetail(DataClassJsonMixin):


@dataclass
class Annotation(DataClassJsonMixin):
class AnnotationV1(DataClassJsonMixin):
""" """

project_id: str
Expand All @@ -387,7 +388,7 @@ class Annotation(DataClassJsonMixin):
input_data_id: str
"""入力データID。[値の制約についてはこちら。](#section/API-Convention/APIID) """

details: List[AnnotationDetail]
details: List[AnnotationDetailV1]
"""矩形、ポリゴン、全体アノテーションなど個々のアノテーションの配列。"""

updated_datetime: Optional[str]
Expand Down
116 changes: 108 additions & 8 deletions annofabapi/generated_api.py

Large diffs are not rendered by default.

0 comments on commit 051fd2a

Please sign in to comment.