annofabapi-3dpc-extensions 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/PKG-INFO +12 -4
- {annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/README.md +6 -1
- {annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/annofab_3dpc/__version__.py +1 -1
- {annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/annofab_3dpc/annotation.py +9 -9
- annofabapi_3dpc_extensions-0.2.2/pyproject.toml +125 -0
- annofabapi_3dpc_extensions-0.2.1/pyproject.toml +0 -68
- {annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/LICENSE +0 -0
- {annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/annofab_3dpc/__init__.py +0 -0
- {annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/annofab_3dpc/py.typed +0 -0
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: annofabapi-3dpc-extensions
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: annofabapiの3DPC Editor用の拡張機能です。
|
|
5
5
|
Home-page: https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions
|
|
6
6
|
Author: Kurusugawa Computer Inc.
|
|
7
|
-
Requires-Python: >=3.8
|
|
7
|
+
Requires-Python: >=3.8,<4.0
|
|
8
8
|
Classifier: Development Status :: 4 - Beta
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
17
|
Classifier: Topic :: Utilities
|
|
16
18
|
Requires-Dist: dataclasses-json
|
|
17
|
-
Requires-Dist: numpy
|
|
19
|
+
Requires-Dist: numpy (<1.25) ; python_version == "3.8"
|
|
20
|
+
Requires-Dist: numpy (>=1.26) ; python_version >= "3.9"
|
|
18
21
|
Project-URL: Repository, https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions
|
|
19
22
|
Description-Content-Type: text/markdown
|
|
20
23
|
|
|
21
24
|
# annofabapi-3dpc-extensions
|
|
22
|
-
[](https://app.travis-ci.com/kurusugawa-computer/annofabapi-3dpc-extensions)
|
|
23
26
|
[](https://badge.fury.io/py/annofabapi-3dpc-extensions)
|
|
24
27
|
[](https://pypi.org/project/annofabapi-3dpc-extensions/)
|
|
25
28
|
[](https://annofabapi-3dpc-extensions.readthedocs.io/en/latest/?badge=latest)
|
|
@@ -92,3 +95,8 @@ with parser.open_outer_file(Path(segment_annotation_data.data_uri).name) as f:
|
|
|
92
95
|
|
|
93
96
|
```
|
|
94
97
|
|
|
98
|
+
|
|
99
|
+
# 開発者向けドキュメント
|
|
100
|
+
|
|
101
|
+
https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions/blob/main/README_for_developer.md 参照
|
|
102
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# annofabapi-3dpc-extensions
|
|
2
|
-
[](https://app.travis-ci.com/kurusugawa-computer/annofabapi-3dpc-extensions)
|
|
3
3
|
[](https://badge.fury.io/py/annofabapi-3dpc-extensions)
|
|
4
4
|
[](https://pypi.org/project/annofabapi-3dpc-extensions/)
|
|
5
5
|
[](https://annofabapi-3dpc-extensions.readthedocs.io/en/latest/?badge=latest)
|
|
@@ -71,3 +71,8 @@ with parser.open_outer_file(Path(segment_annotation_data.data_uri).name) as f:
|
|
|
71
71
|
# => [130439, 130442, ... ]
|
|
72
72
|
|
|
73
73
|
```
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# 開発者向けドキュメント
|
|
77
|
+
|
|
78
|
+
https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions/blob/main/README_for_developer.md 参照
|
{annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/annofab_3dpc/__version__.py
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.2" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
|
{annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/annofab_3dpc/annotation.py
RENAMED
|
@@ -19,14 +19,14 @@ class Location(DataClassJsonMixin):
|
|
|
19
19
|
y: float
|
|
20
20
|
z: float
|
|
21
21
|
|
|
22
|
-
def __add__(self, other):
|
|
22
|
+
def __add__(self, other: "Location") -> "Location":
|
|
23
23
|
return self.__class__(
|
|
24
24
|
x=self.x + other.x,
|
|
25
25
|
y=self.y + other.y,
|
|
26
26
|
z=self.z + other.z,
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
def __sub__(self, other):
|
|
29
|
+
def __sub__(self, other: "Location") -> "Location":
|
|
30
30
|
return self.__class__(
|
|
31
31
|
x=self.x - other.x,
|
|
32
32
|
y=self.y - other.y,
|
|
@@ -51,10 +51,10 @@ class _Quaternion:
|
|
|
51
51
|
https://github.com/KieranWynn/pyquaternion/blob/99025c17bab1c55265d61add13375433b35251af/pyquaternion/quaternion.py#L138
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
def __init__(self, array: Union[Sequence[float], numpy.ndarray]):
|
|
54
|
+
def __init__(self, array: Union[Sequence[float], numpy.ndarray]) -> None:
|
|
55
55
|
self.q = numpy.array(array)
|
|
56
56
|
|
|
57
|
-
def _q_matrix(self):
|
|
57
|
+
def _q_matrix(self) -> numpy.ndarray:
|
|
58
58
|
"""Matrix representation of quaternion for multiplication purposes."""
|
|
59
59
|
return numpy.array(
|
|
60
60
|
[
|
|
@@ -65,7 +65,7 @@ class _Quaternion:
|
|
|
65
65
|
]
|
|
66
66
|
)
|
|
67
67
|
|
|
68
|
-
def _q_bar_matrix(self):
|
|
68
|
+
def _q_bar_matrix(self) -> numpy.ndarray:
|
|
69
69
|
"""Matrix representation of quaternion for multiplication purposes."""
|
|
70
70
|
return numpy.array(
|
|
71
71
|
[
|
|
@@ -77,13 +77,13 @@ class _Quaternion:
|
|
|
77
77
|
)
|
|
78
78
|
|
|
79
79
|
@property
|
|
80
|
-
def rotation_matrix(self):
|
|
80
|
+
def rotation_matrix(self) -> numpy.ndarray:
|
|
81
81
|
"""Get the 3x3 rotation matrix equivalent of the quaternion rotation.
|
|
82
82
|
Returns:
|
|
83
83
|
A 3x3 orthogonal rotation matrix as a 3x3 Numpy array
|
|
84
84
|
Note:
|
|
85
|
-
This feature only makes sense when referring to a unit quaternion. Calling this method will implicitly normalise the Quaternion object to a unit quaternion if it is not already one.
|
|
86
|
-
"""
|
|
85
|
+
This feature only makes sense when referring to a unit quaternion. Calling this method will implicitly normalise the Quaternion object to a unit quaternion if it is not already one.
|
|
86
|
+
""" # noqa: E501
|
|
87
87
|
product_matrix = numpy.dot(self._q_matrix(), self._q_bar_matrix().conj().transpose())
|
|
88
88
|
return product_matrix[1:][:, 1:]
|
|
89
89
|
|
|
@@ -298,7 +298,7 @@ class CuboidAnnotationDetailDataV1(DataClassJsonMixin):
|
|
|
298
298
|
return {"data": str_data, "_type": ANNOTATION_TYPE_UNKNOWN}
|
|
299
299
|
|
|
300
300
|
|
|
301
|
-
def convert_annotation_detail_data(dict_data: Dict[str, Any]) -> Any:
|
|
301
|
+
def convert_annotation_detail_data(dict_data: Dict[str, Any]) -> Any: # noqa: ANN401
|
|
302
302
|
"""
|
|
303
303
|
SimpleAnnotationDetailクラスのdict型であるdataプロパティを、3DPC Editor用のDataclassに変換します。
|
|
304
304
|
3DPC Editor用のDataclassに変換できない場合は、引数をそのまま返します。
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "annofabapi-3dpc-extensions"
|
|
3
|
+
version = "0.2.2" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
|
|
4
|
+
description = "annofabapiの3DPC Editor用の拡張機能です。"
|
|
5
|
+
authors = ["Kurusugawa Computer Inc."]
|
|
6
|
+
packages = [
|
|
7
|
+
{ include = "annofab_3dpc" }
|
|
8
|
+
]
|
|
9
|
+
readme="README.md"
|
|
10
|
+
repository="https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions"
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Topic :: Utilities",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[tool.poetry.dependencies]
|
|
19
|
+
python = "^3.8"
|
|
20
|
+
dataclasses-json="*"
|
|
21
|
+
|
|
22
|
+
# Pythonバージョンでnumpyのバージョンを変えている理由
|
|
23
|
+
# https://qiita.com/yuji38kwmt/items/7ce857bb8698536bfa36
|
|
24
|
+
numpy = [
|
|
25
|
+
{version = ">=1.26", python = ">=3.9"},
|
|
26
|
+
{version = "<1.25", python = "=3.8"}
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
[tool.poetry.group.test.dependencies]
|
|
31
|
+
pytest = "^7"
|
|
32
|
+
pytest-xdist = "*"
|
|
33
|
+
# テストコードで利用するため
|
|
34
|
+
annofabapi = ">=0.47.0"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
[tool.poetry.group.linter.dependencies]
|
|
38
|
+
# pythonバージョンを指定している理由:Python3.11(開発環境)でしかlintを実行していないため
|
|
39
|
+
ruff = {version="^0.2", python=">=3.11"}
|
|
40
|
+
mypy = {version="^1", python=">=3.11"}
|
|
41
|
+
pylint = {version="^3", python=">=3.11"}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
[tool.poetry.group.documentation.dependencies]
|
|
45
|
+
# ドキュメント生成用のライブラリ
|
|
46
|
+
# `python=">=3.11"`を指定している理由:Pytyhon3.11を利用している開発環境かReadTheDocsでしかドキュメントを生成しないため
|
|
47
|
+
sphinx = {version="^7", python=">=3.11"}
|
|
48
|
+
pydata-sphinx-theme = {version=">=0.13", python=">=3.11"}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
[tool.mypy]
|
|
52
|
+
ignore_missing_imports = true
|
|
53
|
+
|
|
54
|
+
check_untyped_defs = true
|
|
55
|
+
|
|
56
|
+
plugins = "numpy.typing.mypy_plugin"
|
|
57
|
+
|
|
58
|
+
[tool.ruff]
|
|
59
|
+
target-version = "py38"
|
|
60
|
+
line-length = 120
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
[tool.ruff.lint]
|
|
64
|
+
ignore = [
|
|
65
|
+
"G004", # `logging-f-string` : loggingでf-stringを使いたいので無視する
|
|
66
|
+
"PD901", #すでに`df`という変数をいろんなところで使っているため
|
|
67
|
+
"PD002", #すでにpandasで`inplace=True`はいろんなところで使っているため
|
|
68
|
+
"RUF001", # 全角記号など`ambiguous unicode character`も使いたいため
|
|
69
|
+
"RUF002",# 全角記号など`ambiguous unicode character`も使いたいため
|
|
70
|
+
"RUF003",# 全角記号など`ambiguous unicode character`も使いたいため
|
|
71
|
+
"PLC1901", # compare-to-empty-string : `if a == "`のように空文字列で直接比較したいときがあるため
|
|
72
|
+
"PLR2004", # magic-value-comparison: listのサイズで判定するときがよくあるため
|
|
73
|
+
"ANN101", # missing-type-self: 引数selfには型ヒントは付けていないため
|
|
74
|
+
"ANN102", # missing-type-cls: 引数clsには型ヒントは付けていないため
|
|
75
|
+
"ERA", # : 役立つこともあるが、コメントアウトしていないコードも警告されるので無視する
|
|
76
|
+
"PERF203", # try-except-in-loop: ループ内でtry-exceptを使うこともあるため無視する。
|
|
77
|
+
"FIX", # TODOやFIXMEを使うため無視する
|
|
78
|
+
"TD", # TODOコメントの書き方に気にしていないので無視する
|
|
79
|
+
|
|
80
|
+
# 以下のルールはannofabcliのコードに合っていないので無効化した
|
|
81
|
+
"RSE", # flake8-raise
|
|
82
|
+
"D", # pydocstyle, Docstringを中途半端にしか書いていないので、除外する
|
|
83
|
+
"C90", # mccabe
|
|
84
|
+
"T20", # flake8-print
|
|
85
|
+
"SLF", # flake8-self
|
|
86
|
+
"BLE", # flake8-blind-except
|
|
87
|
+
"FBT", # flake8-boolean-trap
|
|
88
|
+
"TRY", # tryceratops
|
|
89
|
+
"COM", # flake8-commas
|
|
90
|
+
"S", # flake8-bandit
|
|
91
|
+
"EM",#flake8-errmsg
|
|
92
|
+
"EXE", # flake8-executable
|
|
93
|
+
"ICN", # flake8-import-conventions
|
|
94
|
+
"RET",#flake8-return
|
|
95
|
+
"SIM",#flake8-simplify
|
|
96
|
+
"TCH", # flake8-type-checking
|
|
97
|
+
"PTH", #pathlibを使わないコードが多いので、除外する
|
|
98
|
+
"ISC", #flake8-implicit-str-concat
|
|
99
|
+
"N", # pep8-naming
|
|
100
|
+
"PT", # flake8-pytest-style
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
select = [
|
|
104
|
+
"ALL"
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
[tool.ruff.lint.pydocstyle]
|
|
108
|
+
convention = "google"
|
|
109
|
+
|
|
110
|
+
[tool.ruff.lint.pyupgrade]
|
|
111
|
+
# Python3.8をサポートしているため、`typing.List`などの型ヒントは警告しないようにする
|
|
112
|
+
# https://beta.ruff.rs/docs/settings/#keep-runtime-typing
|
|
113
|
+
keep-runtime-typing = true
|
|
114
|
+
|
|
115
|
+
[tool.ruff.lint.pylint]
|
|
116
|
+
max-args = 10
|
|
117
|
+
|
|
118
|
+
[tool.poetry-dynamic-versioning]
|
|
119
|
+
enable = false
|
|
120
|
+
format = "{base}"
|
|
121
|
+
|
|
122
|
+
[build-system]
|
|
123
|
+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
|
124
|
+
build-backend = "poetry_dynamic_versioning.backend"
|
|
125
|
+
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
[tool.poetry]
|
|
2
|
-
name = "annofabapi-3dpc-extensions"
|
|
3
|
-
version = "0.2.1" # `poetry-dynamic-versioning`を使ってGitHubのバージョンタグを取得している。変更不要
|
|
4
|
-
description = "annofabapiの3DPC Editor用の拡張機能です。"
|
|
5
|
-
authors = ["Kurusugawa Computer Inc."]
|
|
6
|
-
packages = [
|
|
7
|
-
{ include = "annofab_3dpc" }
|
|
8
|
-
]
|
|
9
|
-
readme="README.md"
|
|
10
|
-
repository="https://github.com/kurusugawa-computer/annofabapi-3dpc-extensions"
|
|
11
|
-
classifiers = [
|
|
12
|
-
"Development Status :: 4 - Beta",
|
|
13
|
-
"Intended Audience :: Developers",
|
|
14
|
-
"Topic :: Utilities",
|
|
15
|
-
"Operating System :: OS Independent",
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
[tool.poetry.dependencies]
|
|
19
|
-
python = "^3.8.1"
|
|
20
|
-
dataclasses-json="*"
|
|
21
|
-
numpy = "*"
|
|
22
|
-
|
|
23
|
-
[tool.poetry.dev-dependencies]
|
|
24
|
-
# テストコードで利用するため
|
|
25
|
-
annofabapi = ">=0.47.0"
|
|
26
|
-
|
|
27
|
-
# test library
|
|
28
|
-
pytest = "*"
|
|
29
|
-
pytest-xdist = "*"
|
|
30
|
-
pytest-cov = "*"
|
|
31
|
-
|
|
32
|
-
# format library
|
|
33
|
-
isort = "^5"
|
|
34
|
-
autoflake = "*"
|
|
35
|
-
black = "^23"
|
|
36
|
-
|
|
37
|
-
# lint library
|
|
38
|
-
flake8 = "^6"
|
|
39
|
-
mypy = "^1"
|
|
40
|
-
pylint = "^2"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# document library
|
|
45
|
-
sphinx = "^7"
|
|
46
|
-
# pandasのdocumentationページに近いレイアウトにするためのパッケージ
|
|
47
|
-
pydata-sphinx-theme = ">=0.13.3"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
[tool.black]
|
|
52
|
-
line-length = 120
|
|
53
|
-
|
|
54
|
-
[tool.isort]
|
|
55
|
-
line_length = 120
|
|
56
|
-
[tool.mypy]
|
|
57
|
-
# スタブが無いパッケージのエラーは無視させる.サードパーティのライブラリに型情報がないケースもあるため
|
|
58
|
-
ignore_missing_imports = true
|
|
59
|
-
check_untyped_defs = true
|
|
60
|
-
|
|
61
|
-
[tool.poetry-dynamic-versioning]
|
|
62
|
-
enable = false
|
|
63
|
-
format = "{base}"
|
|
64
|
-
|
|
65
|
-
[build-system]
|
|
66
|
-
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
|
67
|
-
build-backend = "poetry_dynamic_versioning.backend"
|
|
68
|
-
|
|
File without changes
|
{annofabapi_3dpc_extensions-0.2.1 → annofabapi_3dpc_extensions-0.2.2}/annofab_3dpc/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|